Page 1 of 1

Blocky Toggle Switch. Doorbell Button triggers On or Off (Set or Reset)

Posted: Tuesday 15 August 2017 12:38
by irab
To control my garden lights with a KlikaanKlikuit (KaKu) doorbell button I wanted to use Blocky.
After some experimenting I ended up with 4 Switches, 3 scenes and 2 events to realise this function. My solution is not very elegant, but Blocky's restrictions forced me to choose this way.
Please note that the 1 second Off delays are required!

Screenshot 2017-08-15 10.30.20.png
Screenshot 2017-08-15 10.30.20.png (321.17 KiB) Viewed 2406 times

domoticzscenes.jpg
domoticzscenes.jpg (212.51 KiB) Viewed 2406 times
domoticzevents.jpg
domoticzevents.jpg (92.43 KiB) Viewed 2406 times

Re: Blocky Toggle Switch. Doorbell Button triggers On or Off (Set or Reset)

Posted: Friday 01 December 2023 21:38
by f12004
few lines of code, a more elegant solution (dzEvents)

return {
on = {
devices = { 'Pulsante01_hold' }
},
execute = function(domoticz, device)
domoticz.devices('Luce_Piazzale').toggleSwitch()
end
}