J'ai tenté un script Lua pour la gestion de mon thermostat de mon garage, en fouillant dans les forums je suis arrivé à ça:
Code : Tout sélectionner
--Gestion du chauffage: Lorsque la porte est ouverte (Porte_Garage)
-- Descendre le thermostat a 10°c (Heating 1)
--Lorsque la porte est fermée (Porte_Garage)
-- Monter le thermostat a 17°c (Heating 1)
commandArray = {}
if (devicechanged['Porte_Garage'] == 'On') then
print('Porte garage ouverte')
oss = "curl 'http://ip domoticz/json.htm?type=command¶m=switchlight&idx=145&switchcmd=Set%20Level&level=10'&"
os.execute(oss)
end
if (devicechanged['Porte_Garage'] == 'Off') then
print('Porte garage fermée')
oss = "curl 'http://ip domoticz/json.htm?type=command¶m=switchlight&idx=6&switchcmd=Set%20Level&level=17'&"
os.execute(oss)
end
return commandArrayQuelqu'un a une idée ?