Switches indicators and values from mapping not displayed after OH3 restart

Hi all.

Im running OH3 and RRD4j persistence on RPi 4.

openHAB 3.3.0 - Release Build
Release = Raspbian GNU/Linux 10 (buster)
Kernel = Linux 5.10.103-v7l+
Platform = Raspberry Pi 4 Model B Rev 1.4

After OH3 restart, no switch indicators and mapping values are displayed. Items have correct values however on BasicUI I cant see any switch translating its value into proper coloring. Same for mappings where no “human” values are displayed, instead only IDs from mapping are displayed.

Items are defined via UI (specifically via “Add Items from Textual Definition”). Sitemap is defined via UI, mapping is defined in sitemap. Definition in mapping:

Switch item=i_arduino_03_mega_irrigation_schedulers_scheduler1_Buttons label=“Ovládanie []” mappings=[0=“☒ NEAKTÍVNY”,1=“:stopwatch: ČASOVAČ”,2=“ᐅ”]

Selection item=i_arduino_03_mega_irrigation_schedulers_scheduler1_Set label=“Set” mappings=[1=“A”,2=“B”,3=“C”,4=“D”,5=“E”]

Before and after OH restart, BasicUI looks like:

I expect to have same look after restart as well.

I tried also MapDB but without the luck. Is it issue with persistence or values update after OH3 start? Haven’t found similar problem here in community. Could you please guide me what should be set or executed or how to solve this?

Thank you.

Not sure if that’s really related to persistence.

Are you item and the metadata both defined in a text file or via mainui?
Have you validated that after restart the item definition is still including the mapping you want?

Hi Matthias.

Thank you for reply.

Items are defined via UI (specifically via “Add Items from Textual Definition”). Sitemap is defined via UI, mapping is defined in sitemap.

No metadata needed in my case. I thought this is standard OH behavior and nothing special needs to be defined/set.

On the item select add meta data and add state description meta data, where you can insert your mappings into the options.

This should than survive want restart.

Not sure if that’s by design or never was implemented, that the mappings are not copied into the item if you create the item by entering the textual definition into ui :person_shrugging:

I’d be a bit cautious that the problem as described may be about about a glitch in the UI if you reload the remote OH service.

There’s a complicated hidden arrangement of the UI registering to receive state updates.
When OH is reloaded, existing registrations are destroyed and the UI does not know to make ones.

Thx for hint. So do we have a solution or workaround? Any kind of forced reload, caching mapping for UI, etc?

Tried this and no luck, GUI remains only with IDs as 1 or 2, no translation to mapping values “A” or “B”.

Maybe worth to test with an item manually created within the UI, if that’s working or if there is a general issue with your setup

Like any other webpage, poke the ‘refresh’ button and see what happens.

Hi guys, I tried to:

  1. remove mapping part from sitemap, so from
    Selection item=i_arduino_03_mega_irrigation_schedulers_scheduler1_Set label=“Set” mappings=[1=“A”,2=“B”,3=“C”,4=“D”,5=“E”]
    Selection item=i_arduino_03_mega_irrigation_schedulers_scheduler1_Set label=“Set”

  2. after step 1 I created state description and mapping in it

  3. create item manually several times via “+” button and “Add Item”

  4. refresh of page doesn’t also help

No luck with these options - still only number displayed after OH restart. Is there something else what to check? I think this is standard use case in case of OH restart or outage - to bring values back also on GUI. Wondering if I’m the first one facing this issue. Or… I’m overlooking something here :wink:

Are all of the changes you applied gone after restart? Do the new created items still exist?

The standard use case is that you would be starting a new BasicUI instance, not expecting an already running UI to pick up from a restarted openHAB.

Yes, I doubt the SSE connections can survive to a server restart. At least you meed to reload your WEB page.

Sure, I dont expect to see new values after OH restart immediately. But even after refresh of webpage or OH mobile application I see only IDs and not values. I need to set another value in order to force the GUI to show values and not IDs. Lets say I see ID 1 (which means ‘A’) so I need to select ‘B’ (it shows ‘B’) and then back ‘A’ to show ‘A’. So my question was more about the way of forcing the GUI (OH?) to reload/refresh/cache. Thinking also about sending command to item after OH start to force value update, need to test it.

Refresh of a webpage does not necessarily re-create the event registrations at the OH server end that are part of the UI update process.

Try starting a brand new instance of UI after an OH reboot, and see what you get then,

I’m sure there may well be some kind of limitation, which may or may not be circumvented, but you haven’t really pinned it down yet.