Re: aide pour réalisation script en lua
Publié : 10 mai 2020, 17:35
bon alors le store se ferme bien si j'enlève la condition de la variable utilisateur dans le script
et comme on voit dans les logs on dirait qu'il n'y a pas inscription de variable quand j'ouvre le store
Par contre c'est bon pour la fermeture
2020-05-10 17:36:56.035 Status: LUA: otherdevices[uservariables["store exterieur"]] ferme
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 uservariables["store exterieur"] == 'ferme' and otherdevices['Absence']=='Off' and otherdevices['UV']>='4' and otherdevices['Pluie']<='0,5') 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
Par contre c'est bon pour la fermeture
2020-05-10 17:36:56.035 Status: LUA: otherdevices[uservariables["store exterieur"]] ferme