UV, Pluie, Vent sont des virtuel Device mis à jour part Darksky
Nuit: un virtuel device mis à jour en fonction de l'heure du coucher du soleil
Store terrasse un virtuel device qui pilote un module quinto pour la gestion du store
Voila le script mais cela ne marche pas
le script en device
Code : Tout sélectionner
commandArray={}
if otherdevices['Absence']=='Off' then
-- Ouverture Store Terrasse
if (otherdevices['UV']>='4' and otherdevices['Pluie']<='0,5' and otherdevices['Nuit']=='Off' and otherdevices['Vent']<='8.0') then
if otherdevices['Store Terrasse']=='Off' then
commandArray['Store Terrasse']='On'
print('Ouverture Store Terrasse')
commandArray['SendNotification']='Store Terrasse#Ouverture Store Terrasse'
end
end
elseif
-- Fermeture du Store Terrasse
otherdevices['Store Terrasse']=='On' and otherdevices['Nuit']=='On' then
commandArray['Store Terrasse']='Off'
print('Fermeture Store Terrasse')
commandArray['SendNotification']='Store Terrasse#Fermeture Store Terrasse'
end
return commandArray