I tried DE and Europe/Berlin for local timezone. Both did not work. Also i set the local timezone with “sudo raspi-config” to de_DE.UTF-8 but no success.
-
Sunrise and Sunset plugin
-
It should be enough to set the locale in the rpi and don’t use the timezone fields in the sunrise device.
In raspi-config you select Localization Options -> Change Timezone -> Europe -> Berlin -
Until yesterday it worked for me also. But now it does not help.
-
@daice said in Sunrise and Sunset plugin:
Did you check the locale with timedatectl. This is the result on my rpi
Local time: do 2020-02-20 19:33:58 CET Universal time: do 2020-02-20 18:33:58 UTC RTC time: n/a Time zone: Europe/Amsterdam (CET, +0100) Network time on: yes NTP synchronized: yes RTC in local TZ: no
-
@bertreb said in Sunrise and Sunset plugin:
timedatectl
Local time: Do 2020-02-20 19:42:03 CET Universal time: Do 2020-02-20 18:42:03 UTC RTC time: n/a Time zone: Europe/Berlin (CET, +0100) Network time on: yes NTP synchronized: no RTC in local TZ: no
-
OK thank you. Looks like i am not the only one with this issue…
-
The problem for AM/PM seems to be in Node 10.16.3
-
@ed-vrijmoet said in Sunrise and Sunset plugin:
10.16.3
Thanks, could installing 10.17.0 solve it?
Update, i’m on 10.17.0 and it isnt solved. -
@bertreb I don’t know did not try it still the same problem here and sorry not much time to try because of work
-
For the moment ist there a way to transform the time into the 24h format with a expression for a variable in pimatic?
-
A rule like ‘when its after <vars>.sunrise then …’ should work independent of the formatting.
What kind of sunrise rules do you use that don’t work anymore?In node 13 this problems seems to be solved.
If this double formatting doesn’t work for you, there’s another way to solve this with change of the sunrise module and use a time formatting library.
Is not complex but is is a local hack. -
The rule that does not work for example is:
When:
[every 1 minute and [it is after $sunset_plus_1h or before $sunrise_plus_1h]] and terr_heat_auto_sw is on and $aut_terr_heat = 1 and eg-pms2-lan_s02 is presentThen:
turn Heizstab off after 5 seconds and set $aut_terr_heat = 0 after 5 seconds and set $messages to “Heizung im Terrarium ausgeschaltet.” after 5 secondsThe variable $sunset_plus_1h has the following expression: timeFormat(timeDecimal($sunrise-device.sunset)+1)
So it generates a time without am and pm inside. So $sunrise-device.sunset=5:39:59 AM, but $sunise_plus_1h=06:39:59So i think this rule will switch off my device 6:39:59 AM and not 18:39:59 (6:39:59 PM)
-
Ok, i understand.
The rule action handler is not using string comparison but uses the date value (number of millisecond since midnight January 1, 1970 UTC) to compare.
The rules could work and the AM/PM is ‘just’ a display format issue.Did you already test the a rule if its acting on the right moment or do you have to wait till PM ?
-
Is this 24h format issue only a pimatic-sunrise problem or is the hole pimatic involved?
I am asking because when i restart pimatic the timestamp in the daemon-log is in 24h format.
-
I’m not sure but it seems a nodejs problem in the standard date lib
When you use date format libraries like moment (is used in the logger) there’s no problem.
Using a date format module in sunrise is a solution for this problem.
If you want and can update a plugin module i can provide a solution. You must edit it yourself in your own system.