Switch mapping doesnt update

Raspberry

Hallo,
i 've a sitemap with some switch. I dont understand why some switch update the number but not the mapping

sitemap

Switch item=hvac_stato_salone  label="Stato Hvac" mappings=[1="COMFORT", 2="STANDBY", 4="BLD Prot"] icon="temperature"

item

Number        hvac_stato_salone      "HVAC Salone Setting"            	{ channel="knx:device:bridge:generic:hvac_stato_salone", autoupdate="true" }

on the sitemap it shows the number before the mapping but doesnt update the button

Can anyone help me?

The button may not update until clicked if I remember correctly. I would have to test it it has been a while since I looked at it.

If the correct number is in the text then the item is functioning.

The Number shown Is correct but no mapping become red

Does it update correctly when you press F5?

No, never

Have you tried restarting OH since making a change to the sitemap file? May not hurt to also clean the cache while OH is stopped.

Previous discussion on this topic.
Nothing has changed since then; so far as I know it is by design that buttons “light up red” to indicate User action, not to reflect Item state.

My use-case was slightly different (scene selection with buttons) but the problem was the same - no matter if I used Switch or Selection, I can never get the option to activate when update came from the bus (KNX).

My item:
Number mainBathroomHeatingMatScene "Main bathroom heater scene [MAP(mainbathroom_heating_scenes.map):%s]" <heating> (mainBathroom, restoreOnStartUpMapDB) { channel="knx:device:bridge:generic:mainBathroomHeatingMatScene" }

Sitemap that worked (i.e. switched modes) but did not update when set from the bus:
Switch item=mainBathroomHeatingMatScene label=“Heating mode []” mappings=[0=“AUTO”, 1=“Force-ON”, 2=“Force-OFF”]

What I have found out that OH, for some reason, needs to see a decimal for the mapping to match, thus this worked for me:

Switch item=mainBathroomHeatingMatScene label=“Heating mode []” mappings=[0.0=“AUTO”, 1.0=“Force-ON”, 2.0=“Force-OFF”]Switch item=mainBathroomHeatingMatScene label=“Heating mode []” mappings=[0.0=“AUTO”, 1.0=“Force-ON”, 2.0=“Force-OFF”]

I wonder if similar approach (matching type/capitalisation) would work for the other use case?

1 Like