OH3 dscAlarm binding error

Hello!

I’m working to migrate from v2.5.11 to 3.0.0. v2 has been running successfully for about a year.

The error I’m getting is:

Blockquote
2021-01-01 23:28:21.743 [WARN ] [ab.core.internal.events.EventHandler] - Creation of event failed, because one of the registered event factories has thrown an exception: Error invoking #valueOf(String) on class ‘org.openhab.core.library.types.DateTimeType’ with value ‘2-01-01T00:00:00.000-0700’.
java.lang.IllegalStateException: Error invoking #valueOf(String) on class ‘org.openhab.core.library.types.DateTimeType’ with value ‘2-01-01T00:00:00.000-0700’.
at org.openhab.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:188) ~[bundleFile:?]
at org.openhab.core.items.events.ItemEventFactory.parseType(ItemEventFactory.java:156) ~[bundleFile:?]
at org.openhab.core.items.events.ItemEventFactory.getState(ItemEventFactory.java:134) ~[bundleFile:?]
at org.openhab.core.items.events.ItemEventFactory.createStateEvent(ItemEventFactory.java:114) ~[bundleFile:?]
at org.openhab.core.items.events.ItemEventFactory.createEventByType(ItemEventFactory.java:78) ~[bundleFile:?]
at org.openhab.core.events.AbstractEventFactory.createEvent(AbstractEventFactory.java:53) ~[bundleFile:?]
at org.openhab.core.internal.events.EventHandler.createEvent(EventHandler.java:131) [bundleFile:?]
at org.openhab.core.internal.events.EventHandler.handleEvent(EventHandler.java:106) [bundleFile:?]
at org.openhab.core.internal.events.EventHandler.handleEvent(EventHandler.java:84) [bundleFile:?]
at org.openhab.core.internal.events.ThreadedEventHandler.lambda$0(ThreadedEventHandler.java:67) [bundleFile:?]
at java.lang.Thread.run(Thread.java:834) [?:?]

After a little digging, I think this was caused by removing the deprecated code in org.openhab.core/src/main/java/org/openhab/core/library/types/DateTimeType.java on June 13, 2020.

The issue appears to start in the binding org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/PanelThingHandler.java at line 95
updateState(channelUID, new DateTimeType(systemTime));

Since the variable systemTime seems to contain ‘2-01-01T00:00:00.000-0700’ (a wayyy old bogus date), I’m guessing that it would work to change the binding code to DateTimeType() and allowed to take the new ‘now’ default:
public DateTimeType() {
this(ZonedDateTime.now());

I’m not setup to compile my own bindings (haven’t tried setting up a development environment) to test the fix, but I think everyone currently using the dscAlarm binding may be vulnerable to this error.?.?

Thank you for the help!

Gary

Blockquote
Static hostname: temp
Icon name: computer
Machine ID:
Boot ID:
Operating System: Raspbian GNU/Linux 10 (buster)
Kernel: Linux 5.4.79-v7+
Architecture: arm

1 Like

Any chance this item made it onto the team’s to-be-fixed list?

1 Like

I filed a bug here and referenced your post, I’m also having the same warning messages:

1 Like

Doing an upgrade tonight and checking back to see if this made the fixed list.