Regression in 4.1.0 when comparing to UNDEF? No!

  • Platform information:
    • OS: Docker
    • openHAB version: 4.1.0

After updating from 4.0.0 to 4.1.0 one rule doesn’t work as expected anymore:

if (items.getItem("DateTimeItem").state == "UNDEF") {
	// do something if the item has no state set

The if branch wasn’t entered as the item state was "NULL", so I had to update the rule to items.getItem("DateTimeItem").state == "NULL". Is this some regression of 4.1? IMO that should be listed as breaking change.

I use the integrated js lib:

Maybe a change in the binding behind this item ?
NULL is the initial state.
A binding can then set the channel state to NULL or UNDEF.

1 Like

I found the issue: The DateTime Item is set to the alarm clock on my phone by the Android app. The app sends UNDEF, but there’s no persistence for this item, so it becomes NULL on restart (and upgrade) of openHAB.