Page 1 of 1

Problems at specific time

Posted: Thursday 15 November 2018 9:36
by straatm
All,

Sometime ago my script(s) stopped working at 23:00 at nighttime. The entire script seems to work but the 23:00 at night time is not switching off. And there is no logentry anymore.
It started in 4.9700 and I upgrade to 4.10199 but it is still not working.
The state of "$Hulp-Laat-Thuis" is off.

I am familar with some programming but I can not explain this.
Is there anyone who could explain this?

Thanks in advance for your support,
BR,
Marc

return {
on = { timer = { 'at nighttime at 07:00 on mon, tue, wed, thu, fri',
'at nighttime at 08:20 on sat, sun',
'at sunrise',
'at sunset',
'at 17:26',
'at 15 minutes before sunset',
'at 22:00 at nighttime on mon, tue, wed, thu, fri, sat, sun',
'at 23:00 at nighttime on mon, tue, wed, thu, fri, sat, sun' }
},
execute = function(domoticz, timer)
if (domoticz.time.matchesRule('at 07:00')) then
domoticz.log('Dit werkt om 7:00 uur')
domoticz.groups('Binnen-Lampen').switchOn().repeatAfterSec(1,3)
elseif (domoticz.time.matchesRule('at 08:20')) then
domoticz.log('Dit werkt om 8:20 uur op Zaterdag en Zondag')
domoticz.groups('Binnen-Lampen').switchOn().repeatAfterSec(1,3)
elseif (domoticz.time.matchesRule('at sunrise')) then
domoticz.log('Zonsopkomst')
domoticz.groups('Binnen-Lampen').switchOff().repeatAfterSec(1,3)
elseif (domoticz.time.matchesRule('at 15 minutes before sunset') and domoticz.time.matchesRule('at 00:00-23:00')) then
domoticz.log('15 minuten voor Zonsondergang')
domoticz.groups('Binnen-Lampen').switchOn().repeatAfterSec(1,3)
elseif (domoticz.time.matchesRule('at 23:00') and domoticz.devices('$Hulp-Laat-Thuis').state == 'Off') then
domoticz.log('Slaaplekker')
domoticz.groups('Binnen-Lampen').switchOff().repeatAfterSec(1,3)
else
domoticz.log('Slaaplekkerrrrrr binnen')
end
end
}

Re: Problems at specific time

Posted: Thursday 15 November 2018 9:54
by emme
try switching domoticz.time.matchesRule to
timer.trigger = 'at 07:00'

Re: Problems at specific time

Posted: Thursday 15 November 2018 11:14
by waaren
straatm wrote: Thursday 15 November 2018 9:36 Sometime ago my script(s) stopped working at 23:00 at nighttime. The entire script seems to work but the 23:00 at night time is not switching off.
Please correct me if I am wrong but would

Code: Select all

on = { timer = { 'at nighttime at 07:00 on mon, tue, wed, thu, fri',
                     'at nighttime at 08:20 on sat, sun',
                     'at sunrise', 
                     'at sunset',
                     'at 17:26',
                     'at 15 minutes before sunset',
                     'at 22:00 at nighttime',
                     'at 23:00 at nighttime' }
	},
not do the same ? And if your location is not northern of Oslo 23:00 will be always at nighttime.
To investigate further I suggest to add some domoticz.log statements and maybe start with a domoticz.log(timer.trigger) .