The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.3.14-1~deb10u1 (Linux)
File Line Function
/showthread.php 895 errorHandler->error



  • 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sunrise and daylight saving time issue
#1
I have one sunrise and one sunset rule.
I used labels to test for the exact times when these rules are being triggered.
The rules are using DATE_ADD() to shift the switching times 10 minutes before sunrise and 30 minutes after sunset.

Code:
"sunrise-decolight": {
"rule": "IF (sunrisesetdev.sunrise == DATE_FORMAT(DATE_ADD(datetimedev, -10 MINUTE), \"%Y-%m-%d %H:%M:%S\", %H.%M)) AND datetimedev.second == 0 THEN switch DEVICE light_deco_mirror_livingroom TO off AND label DEVICE labelsunrise TO \"Sun rises in 10 minutes; Light off\" DATE_FORMAT(datetimedev, \"%d.%m.%Y %H:%M\") COLOR green",
"active": 1
},
"sunset-decolight": {
"rule": "IF (sunrisesetdev.sunset == DATE_FORMAT(DATE_ADD(datetimedev, +30 MINUTE), \"%Y-%m-%d %H:%M:%S\", %H.%M)) AND datetimedev.second == 0 THEN switch DEVICE light_deco_mirror_livingroom TO on AND label DEVICE labelsunset TO \"Sun set 30 minutes ago; Light on\" DATE_FORMAT(datetimedev, \"%d.%m.%Y %H:%M\") COLOR green",
"active": 1
}

My log shows correct timezone Europe/Berlin based on my latitude and longitude settings in config.json.
Code:
pilight-daemon: INFO: datetime datetimedev 13.404954:52.520007 seems to be in timezone: Europe/Berlin
pilight-daemon: INFO: sunriseset sunrisesetdev 13.404954:52.520007 seems to be in timezone: Europe/Berlin

The sunset rule is working as defined in config but the sunrise rule gets parsed one hour later.

Could there be an issue with DST and/or the timezone recognition in the latest version 8 or do I miss something else?
Code:
pilight-daemon version v8.0.4

In addition:
Placing the rule condition AND datetimedev.second == 0 inside the IF parenthesis is breaking the rule from getting parsed correctly at all.
Any ideas on this?
 
Reply
  


Messages In This Thread
Sunrise and daylight saving time issue - by apartmedia - 12-24-2017, 08:54 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
Bug Full cpu usage after random time andiwand 4 2,659 05-01-2016, 09:05 PM
Last Post: andiwand
  Time based calculations wo_rasp 7 3,434 03-19-2016, 01:28 AM
Last Post: wo_rasp
  [Solved] Time Stamp Information wo_rasp 5 2,942 03-05-2016, 11:29 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)