aide pour réalisation script en lua
Re: aide pour réalisation script en lua
si si vill1driver je lis tes messages mais je ne réponds pas comme je ne suis pas le demandeur.
Dernière modification par thier le 10 mai 2020, 17:58, modifié 1 fois.
PI3+, Buster, Domoticz V2020.2, rflink, zwave, chauffage piloté par qubino, sondes oregon et Vil1d, boite aux lettres détection passage facteur, volets roulants qubino fibaro.
Re: aide pour réalisation script en lua
post ton script.
PI3+, Buster, Domoticz V2020.2, rflink, zwave, chauffage piloté par qubino, sondes oregon et Vil1d, boite aux lettres détection passage facteur, volets roulants qubino fibaro.
Re: aide pour réalisation script en lua
Code : Tout sélectionner
commandArray={}
--pour connaitre les valeurs on met des print. Tu les commentes avec -- quand tu n'en as plus besoin.
print('otherdevices[\'UV\'] '..otherdevices['UV'])
print('otherdevices[\'Pluie\'] '..otherdevices['Pluie'])
-- print('otherdevices[\'Nuit\'] '..otherdevices['Nuit'])
print('otherdevices[\'Vent\'] '..otherdevices['Vent'])
-- print('otherdevices[\'Absence\'] '..otherdevices['Absence'])
print('otherdevices[\'Store Terrasse\'] '..otherdevices['Store Terrasse'])
print('otherdevices[uservariables["store exterieur"]] '..uservariables["store exterieur"])
-- Ouverture Store Terrasse
if (devicechanged['Store Terrasse']=='On' and otherdevices['Absence']=='Off') then
commandArray['Ouverture Store Terrasse']='On'
print('Ouverture Store Terrasse')
commandArray ['Variable:store exterieur']='ouvert'
commandArray['SendNotification']='Store Terrasse#Ouverture Store Terrasse'
-- Fermeture du Store Terrasse
elseif (devicechanged['Nuit']=='On' and otherdevices['Absence']=='Off' and otherdevices['Store Terrasse']=='16.0') then
commandArray['Fermeture Store Terrasse']='On'
print('Fermeture Store Terrasse')
commandArray ['Variable:store exterieur']='ferme'
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArray
Re: aide pour réalisation script en lua
Code : Tout sélectionner
commandArray={}
--pour connaitre les valeurs on met des print. Tu les commentes avec -- quand tu n'en as plus besoin.
print('otherdevices[\'UV\'] '..otherdevices['UV'])
print('otherdevices[\'Pluie\'] '..otherdevices['Pluie'])
-- print('otherdevices[\'Nuit\'] '..otherdevices['Nuit'])
print('otherdevices[\'Vent\'] '..otherdevices['Vent'])
-- print('otherdevices[\'Absence\'] '..otherdevices['Absence'])
print('otherdevices[\'Store Terrasse\'] '..otherdevices['Store Terrasse'])
print('otherdevices[uservariables["store exterieur"]] '..uservariables["store exterieur"])
-- Ouverture Store Terrasse
if (devicechanged['Store Terrasse']=='On' and otherdevices['Absence']=='Off') then
commandArray['Ouverture Store Terrasse']='On'
print('Ouverture Store Terrasse')
commandArray ['Variable:store exterieur']='ouvert'
commandArray['SendNotification']='Store Terrasse#Ouverture Store Terrasse'
-- Fermeture du Store Terrasse
elseif (devicechanged['Nuit']=='On' and otherdevices['Absence']=='Off' and otherdevices['Store Terrasse']=='16.0') then
commandArray['Fermeture Store Terrasse']='On'
print('Fermeture Store Terrasse')
commandArray ['Variable:store exterieur']='ferme'
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArray
Re: aide pour réalisation script en lua
celui ci fonctionne?
j'ai toujours un problème avec ton retour 16.0.
Code : Tout sélectionner
commandArray={}
--pour connaitre les valeurs on met des print. Tu les commentes avec -- quand tu n'en as plus besoin.
print('otherdevices[\'Store Terrasse\'] '..otherdevices['Store Terrasse'])
print('otherdevices[uservariables["store exterieur"]] '..uservariables["store exterieur"])
-- Ouverture Store Terrasse
if (devicechanged['Store Terrasse']=='On' and uservariables["store exterieur"] == 'ferme' and otherdevices['Absence']=='Off') then
commandArray['Ouverture Store Terrasse']='On'
print('Ouverture Store Terrasse')
commandArray ['Variable:store exterieur']='ouvert'
commandArray['SendNotification']='Store Terrasse#Ouverture Store Terrasse'
-- Fermeture du Store Terrasse
elseif (devicechanged['Store Terrasse']=='Off' and uservariables["store exterieur"] == 'ouvert' and otherdevices['Absence']=='Off') then
commandArray['Fermeture Store Terrasse']='On'
print('Fermeture Store Terrasse')
commandArray ['Variable:store exterieur']='ferme'
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArrayPI3+, Buster, Domoticz V2020.2, rflink, zwave, chauffage piloté par qubino, sondes oregon et Vil1d, boite aux lettres détection passage facteur, volets roulants qubino fibaro.
Re: aide pour réalisation script en lua
Verifie que ta variable est bien la valeur qui correspond à l'état de ton store.
PI3+, Buster, Domoticz V2020.2, rflink, zwave, chauffage piloté par qubino, sondes oregon et Vil1d, boite aux lettres détection passage facteur, volets roulants qubino fibaro.
Re: aide pour réalisation script en lua
oui la variable est bonne
le script ne fonctionne que si je met 16.0 pour store terrasse
Par contre comment rajouter pour que le store ne s'ouvre pas si il fait nuit
le script ne fonctionne que si je met 16.0 pour store terrasse
Par contre comment rajouter pour que le store ne s'ouvre pas si il fait nuit
Re: aide pour réalisation script en lua
Chaque chose en son temps.
celui-ci doit fonctionner car il s'affranchie de la valeur de retour de store terrasse
celui-ci doit fonctionner car il s'affranchie de la valeur de retour de store terrasse
Code : Tout sélectionner
commandArray={}
--pour connaitre les valeurs on met des print. Tu les commentes avec -- quand tu n'en as plus besoin.
print('otherdevices[\'Store Terrasse\'] '..otherdevices['Store Terrasse'])
print('otherdevices[uservariables["store exterieur"]] '..uservariables["store exterieur"])
-- Ouverture Store Terrasse
if (devicechanged['Store Terrasse'])
if uservariables["store exterieur"] == 'ferme' and otherdevices['Absence']=='Off') then
commandArray['Ouverture Store Terrasse']='On'
print('Ouverture Store Terrasse')
commandArray ['Variable:store exterieur']='ouvert'
commandArray['SendNotification']='Store Terrasse#Ouverture Store Terrasse'
-- Fermeture du Store Terrasse
elseif (uservariables["store exterieur"] == 'ouvert' and otherdevices['Absence']=='Off') then
commandArray['Fermeture Store Terrasse']='On'
print('Fermeture Store Terrasse')
commandArray ['Variable:store exterieur']='ferme'
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
end
return commandArrayPI3+, Buster, Domoticz V2020.2, rflink, zwave, chauffage piloté par qubino, sondes oregon et Vil1d, boite aux lettres détection passage facteur, volets roulants qubino fibaro.
Re: aide pour réalisation script en lua
Je ne vois pas l’intérêt puisque tu appuies sur le bouton, tu regardes s'il fait nuit.vr6man a écrit : 10 mai 2020, 18:13 Par contre comment rajouter pour que le store ne s'ouvre pas si il fait nuit
PI3+, Buster, Domoticz V2020.2, rflink, zwave, chauffage piloté par qubino, sondes oregon et Vil1d, boite aux lettres détection passage facteur, volets roulants qubino fibaro.
Re: aide pour réalisation script en lua
Pour éviter une mauvaise manipulation
sinon ca fonctionne
fermeture du store et mise a jour de la variable avec le script suivant:
sinon ca fonctionne
fermeture du store et mise a jour de la variable avec le script suivant:
Code : Tout sélectionner
commandArray={}
--pour connaitre les valeurs on met des print. Tu les commentes avec -- quand tu n'en as plus besoin.
print('otherdevices[\'UV\'] '..otherdevices['UV'])
print('otherdevices[\'Pluie\'] '..otherdevices['Pluie'])
-- print('otherdevices[\'Nuit\'] '..otherdevices['Nuit'])
print('otherdevices[\'Vent\'] '..otherdevices['Vent'])
-- print('otherdevices[\'Absence\'] '..otherdevices['Absence'])
print('otherdevices[\'Store Terrasse\'] '..otherdevices['Store Terrasse'])
print('otherdevices[uservariables["store exterieur"]] '..uservariables["store exterieur"])
-- Ouverture Store Terrasse
if (devicechanged['Store Terrasse']=='On' and otherdevices['Absence']=='Off') then
commandArray['Ouverture Store Terrasse']='On'
print('Ouverture Store Terrasse')
commandArray ['Variable:store exterieur']='ouvert'
commandArray['SendNotification']='Store Terrasse#Ouverture Store Terrasse'
-- Fermeture du Store Terrasse
elseif (devicechanged['Nuit']=='On' and uservariables["store exterieur"] == 'ouvert'and otherdevices['Absence']=='Off' and otherdevices['Store Terrasse']=='16.0') then
commandArray['Fermeture Store Terrasse']='On'
print('Fermeture Store Terrasse')
commandArray ['Variable:store exterieur']='ferme'
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArray