I have a couple of Siemens devices connected via the Home-Connect binding. As soon as you turn the device off, a bunch of items return to the ‘UNDEF’ status. As far as I can tell, this is expected behavior.
But not really a nice sight in the UI…
Looking for a way to replace 'UNDEF with something nicer in the UI, I am trying to solve this with a ‘State Description’ pattern, hoping the following transformation would do the trick, but it does absolutely nothing. JS(| input == 'UNDEF' ? '-' : input):%s
I have a feeling I am approaching this the wrong way.
Is there anything in the openhab.log? I assume you installed the Map Transformation Add-on.
You may check the real items value that needs to be transformed with a logInfo statement in a rule so the entry in the MAP file matches exactly.
In OH2, internal “preprocessing” for the equivalent of displayState presented a “-” for display, when actual state is NULL or UNDEF.
This will still be present in OH3, i.e.if you look at a sitemap-using UI you will see - not NULL, with no other formatting.
Where are you looking? The Item state will still be UNDEF, so an “administrators” view of the Item should still show UNDEF.
Fpr prettifying a “user” view, you’ll need to identify what UI and widget you are trying to use.
I’m not sure that 0 is going to work well with datetime formatters.