Thanks, that helped me quite a lot. My current code:
rule “Android Alarm”
when
Item Test_Trigger_For_Testrules changed or
Item Android_Alarm changed
then
if (Android_Alarm.state.toString == “1970-01-01T00:00:00.000+0000”) {
timerTillAlarm = null
logInfo(“Rule triggered”, “android_events.rules: Android Alarm: Es ist kein Alarm eingestellt”)
}
else
{
var nextAlarmMinusTimespanForEarlierAlarm = new DateTime(Android_Alarm.state.toString)
logInfo(“Rule triggered”, “android_events.rules: Android Alarm: Nächster Alarm: " + Android_Alarm.state.format(”%1$td.%1$tm %1$tH:%1$tM")")
[…]
*.items:
DateTime Android_Alarm “Nächster Wecker[%1$tH:%1$tM Uhr, %1$td.%1$tm.]”
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):
[marthome.model.script.Rule triggered] - android_events.rules: Android Alarm: Nächster Alarm: 18.04 12:25
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