What do i mis? Strange behaviour of script(s)
Posted: Friday 17 May 2019 21:49
I have a script which monitor if my dashboard is ON or OFF.
Between times it will be switched OFF.
In stable 4.0097 i had it as 1 script. But didn't used it to much, so testing was not 100%
Now in the next stable version 4.10717 i can't get it to work. Althouged not 100% tested in the previous version, it still looks like it reacts different now
I saved both codes with little scripts. Not 1 script with both in it.
This to overlook in de log, which scripts is triggered.
But when i switch, both scripts are triggered. I don't know why, because i ask to look at the device.state.
What do i mis here?
Between times it will be switched OFF.
In stable 4.0097 i had it as 1 script. But didn't used it to much, so testing was not 100%
Now in the next stable version 4.10717 i can't get it to work. Althouged not 100% tested in the previous version, it still looks like it reacts different now
I saved both codes with little scripts. Not 1 script with both in it.
This to overlook in de log, which scripts is triggered.
But when i switch, both scripts are triggered. I don't know why, because i ask to look at the device.state.
What do i mis here?
Code: Select all
return {
on = {
devices = {'Backlight Dashboard'}
},
execute = function(domoticz, device)
if(
device.state == 'Off' and
domoticz.time.matchesRule('on thu,fri,sat,sun') and
domoticz.time.matchesRule('between 07:00 and 21:00')) then
domoticz.openURL({url = 'http://192.168.178.189/control?cmd=gpio,13,1'})
domoticz.openURL({url = 'http://192.168.178.189/control?cmd=gpio,13,0'}).afterSec(1)
end
end
}Code: Select all
return {
on = {
devices = {'Backlight Dashboard'}
},
execute = function(domoticz, device)
if(
device.state == 'On' and
domoticz.time.matchesRule('on mon,tue,wed,thu,fri,sat,sun') and
(domoticz.time.hour >= 21 or domoticz.time.hour < 7)) then
domoticz.openURL({url = 'http://192.168.178.189/control?cmd=gpio,13,1'}).afterSec(150)
domoticz.openURL({url = 'http://192.168.178.189/control?cmd=gpio,13,0'}).afterSec(151)
end
end
}