I have to find a way to avoid loop. I have two options that I have tried.
1: A variable that is changed from the shelly
Code: Select all
/json.htm?type=command¶m=updateuservariable&vname=Shelly_kallaren&vtype=integer&vvalue=0
Then to update the switch I tried this event but cant get it to update the switch (or I think it is the trigger that never happen)
Code: Select all
return {
on = {
variables = {
'Shelly_kallaren'
}
},
execute = function(domoticz, item, triggerInfo)
if uservariables['Shelly_kallaren'] == '1' then
domoticz.devices(451).switchOn().checkFirst()
elseif uservariables['Shelly_kallaren'] == '0' then
device.Shelly_kallaren.switchOff().checkFirst()
end
end
}
I have used
Code: Select all
http://192.168.3.10:8080/json.htm?type=command¶m=switchlight&idx=451&switchcmd=Off
Code: Select all
http://192.168.3.10:8080/json.htm?type=command¶m=switchlight&idx=451&switchcmd=Off.checkFirst()
I know that I can use MQTT but I wolud like to use the shelly cloud as well but the memory in the shelly only allows one of them.
Please you all clever people out there, point me in the right direction!