I have problem with blockly events and I decided to try dzVents. Unfortunately, but it is not understandable to me. Is there anyone who can help me? I have a Xiaomi selector / switch and I would like one click to either turn on 2 lights and turn off depending on whether the device is turned on or off.
I made this code but it does not work and I do not know how to approach it.
Please help
Code: Select all
return {
active = true,
on = {
devices = {
'XiaomiSwitch'
}
},
execute = function(domoticz, roomSwitch)
if (roomSwitch.state == 'On' ) then
domoticz.devices('Lampka Router').switchOn()
domoticz.notify('This rocks!',
'Turns out that it is getting warm here',
domoticz.PRIORITY_LOW)
end
end
}