Problems at specific time

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
straatm
Posts: 19
Joined: Monday 15 January 2018 10:06
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Problems at specific time

Post 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
}
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Problems at specific time

Post by emme »

try switching domoticz.time.matchesRule to
timer.trigger = 'at 07:00'
The most dangerous phrase in any language is:
"We always done this way"
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Problems at specific time

Post 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) .
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest