Sunset time is "hanging"

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:

Sunset time is "hanging"

Post by straatm »

All,

I have a dzvent script that is trigged at sunset and 15 minutes before sunset.
But is seems that after the daylight saving suddenly the sunset is "fixed" it is always 20:11 even the sunset is already later but the time does not change.
If I restart the Domoticz proces it will take that day the correct sunset time but after that it is again "hanging" and takes every day after the same time again.

I am running domoticz on a win10 machine and I downloaded already the latest beta release but nothing solved the problem, any one any idea what this could be.

My location is correct and the sunset is also correct displayed on the dashboard.

Thanks for any reaction
SweetPants

Re: Sunset time is "hanging"

Post by SweetPants »

If you share the script maybe somebody can help you. It's a wild guess now
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Sunset time is "hanging"

Post by dannybloe »

Or perhaps restart your domoticz?
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
straatm
Posts: 19
Joined: Monday 15 January 2018 10:06
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Sunset time is "hanging"

Post by straatm »

Thanks for the reply here is the script

Code: Select all

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 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' }
          -- LET OP maak van daytime op zat en zon nighttime daytime was alleen om te testen
          -- timer = { 'at sunrise' },
          -- timer = { '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
}
Last edited by dannybloe on Tuesday 24 April 2018 8:01, edited 1 time in total.
Reason: Please use code blocks when posting code
straatm
Posts: 19
Joined: Monday 15 January 2018 10:06
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Sunset time is "hanging"

Post by straatm »

Here is also some logging, I will add the logging of tonight also that will be definitely also at 20:10, but according to my dashboard sunset is at 20:44 tonight.

2018-04-21 20:10:00.392 dzVents: Info: ------ Start internal script: DZ_SfeerVerlichtingBinnen:, trigger: at 15 minutes before sunset
2018-04-21 20:10:00.392 dzVents: Info: 15 minuten voor Zonsondergang
2018-04-21 20:10:00.392 dzVents: Info: ------ Finished DZ_SfeerVerlichtingBinnen
2018-04-21 20:10:00.642 EventSystem: Script event triggered: C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua


2018-04-22 20:10:00.187 dzVents: Info: ------ Start internal script: DZ_SfeerVerlichtingBinnen:, trigger: at 15 minutes before sunset
2018-04-22 20:10:00.187 dzVents: Info: 15 minuten voor Zonsondergang
2018-04-22 20:10:00.187 dzVents: Info: ------ Finished DZ_SfeerVerlichtingBinnen
2018-04-22 20:10:00.797 EventSystem: Script event triggered: C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua
SweetPants

Re: Sunset time is "hanging"

Post by SweetPants »

dannybloe wrote: Monday 23 April 2018 7:27 Or perhaps restart your domoticz?
He already did
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Sunset time is "hanging"

Post by dannybloe »

Interesting... looks like a bug in Domoticz. dzVents just gets the sunset and sunrise time from Domoticz. Does it show this time in the GUI as well?
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
straatm
Posts: 19
Joined: Monday 15 January 2018 10:06
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Sunset time is "hanging"

Post by straatm »

dannybloe wrote: Tuesday 24 April 2018 8:08 Interesting... looks like a bug in Domoticz. dzVents just gets the sunset and sunrise time from Domoticz. Does it show this time in the GUI as well?
In the GUI the sunset time is correct.
Attachments
GUI Domoticz.jpg
GUI Domoticz.jpg (142.99 KiB) Viewed 1393 times
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Sunset time is "hanging"

Post by dannybloe »

Can you print _G.timeofday['SunsetInMinutes'] and _G.timeofday['SunriseInMinutes'] from your script? And compare that with what you see in the GUI?
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
rjblake
Posts: 142
Joined: Friday 21 October 2016 9:25
Target OS: NAS (Synology & others)
Domoticz version:
Location: Netherlands
Contact:

Re: Sunset time is "hanging"

Post by rjblake »

Running v3.9300 and using the Sunset/Sunrise in my scripts on RasPi without issue. Has been moving on daily as the sunset time gets later
straatm
Posts: 19
Joined: Monday 15 January 2018 10:06
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Sunset time is "hanging"

Post by straatm »

dannybloe wrote: Tuesday 24 April 2018 15:08 Can you print _G.timeofday['SunsetInMinutes'] and _G.timeofday['SunriseInMinutes'] from your script? And compare that with what you see in the GUI?
Danny,

How to use this print command, just add it to the script??
If yes where exactly :?: :oops:
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Sunset time is "hanging"

Post by dannybloe »

Yes. Just use print() in lua
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
SweetPants

Re: Sunset time is "hanging"

Post by SweetPants »

Did some testing with parts of your script with latest Beta on Linux and do not see your problem. Could be something with the windows version.

Date Sunrise Sunset
2018-04-23 06:31 20:54

2018-04-23 20:39:00.426 dzVents: Info: dz_TimerTest: ------ Start internal script: dz_TimerTest:, trigger: at 15 minutes before sunset
2018-04-23 20:39:00.426 dzVents: Info: dz_TimerTest: 15 minuten voor Zonsondergang
2018-04-23 20:39:00.426 dzVents: Info: dz_TimerTest: ------ Finished dz_TimerTest

2018-04-23 20:54:00.217 dzVents: Info: dz_TimerTest: ------ Start internal script: dz_TimerTest:, trigger: at sunset
2018-04-23 20:54:00.217 dzVents: Info: dz_TimerTest: Slaaplekkerrrrrr binnen
2018-04-23 20:54:00.217 dzVents: Info: dz_TimerTest: ------ Finished dz_TimerTest

Date Sunrise Sunset
2018-04-24 08:29 20:56


2018-04-24 20:41:00.245 dzVents: Info: dz_TimerTest: ------ Start internal script: dz_TimerTest:, trigger: at 15 minutes before sunset
2018-04-24 20:41:00.246 dzVents: Info: dz_TimerTest: 15 minuten voor Zonsondergang
2018-04-24 20:41:00.246 dzVents: Info: dz_TimerTest: ------ Finished dz_TimerTest

2018-04-24 20:56:00.533 dzVents: Info: dz_TimerTest: ------ Start internal script: dz_TimerTest:, trigger: at sunset
2018-04-24 20:56:00.533 dzVents: Info: dz_TimerTest: Slaaplekkerrrrrr binnen
2018-04-24 20:56:00.533 dzVents: Info: dz_TimerTest: ------ Finished dz_TimerTest
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest