Help with dummy selector switch
Posted: Sunday 01 October 2017 16:08
Hey, i made this for a dummy switch i have. When pressed it will trigger this script and turns on my airco for 1 hour and then turns it off again:
But i want to use it for a selector with 3 options.
Like 1 hour, 2 hours and 3 hours options.
How can i achieve this?
Code: Select all
return {
active = true,
on = {
devices = {
'Airco 20C voor 1u'
}
},
execute = function(domoticz, roomSwitch)
if (roomSwitch.state == 'On') then
domoticz.devices('Airco nachtstand').switchOn()
domoticz.devices('Airco uit').switchOn().afterSec(3600)
domoticz.notify('Airco staat nu voor 1u aan')
end
end
}Like 1 hour, 2 hours and 3 hours options.
How can i achieve this?