My idea is that I want to show the next upcomming Alarm in my sitemap. For this I got the item
Numer AndroidAlarm
which has an state of sth. like this: 1587188700000
This then gets transfered in my rule to the variable nextAlarmOriginal which then has a output sth. like this: 07:45, 18.04 which then gets logged as you can see in the rule:
rule "Android Alarm"
when
Item Android_Alarm changed
then
[...]
var nextAlarmOrginal = (new DateTime((Android_Alarm.state as Number).longValue )).toString(“HH:mm, dd.MM.”)
The docs were never updated, but the Android app has supported sending the alarm to a DateTimeItem for a while now…
Once you’ve changed this, you can put the formatting into the Item label definition or the Sitemap. If you go a different route, I recommend not using Joda, since it is not avaialble in OH 3.0.
The Alarm works properly and triggers at the right time. I can display the alarm time in the sitemap and it shows the correct time. However the log message doesn’t show the right time. It shows UTC and not +0200 (where I am):
while the sitemap shows the correct time: 14:25 Uhr, 18.04. .The alarm triggers at the right time (14:25).
How can I adjust the logmessage to show the time in my timezone?
I just the settings in the paperui and there the timezone is configured correctly
So it formatted the String, but the timezone problem didnt change. I set the alarm for 16:00 and the log says 14:00. So the converting the time didnt work.
Isn’t there a way to just add two hours to the output? However I dont like this solution because it has to be adjusted every 6 month due to the clock change.
From the command line what’s the output of timedatectl? If your local time is different then Universal time then you may want to use openhbian-config tool to set the correct time.
I setup an Item to test this with and this appears to be a bug. Habdroid is sending the alarm in UTC, not your local time. I’ll open an issue for this. The workaround is to convert from UTC to your local timezone…