[Solved] Switch design - how change

Hello,

I want to know how I can change the layout of Switch.

Exemple here :

One is the Fibaro Zwave sensor, the other is Xiaomi Zigbee.
I want to have the same layout for the 2.

My migration to OH2 is progressing well but I want to have a clean install.

Thx all for support

Can you post those two items definitions side by side?

1 Like

And also your sitemap code, merci

Items

Switch Chambre_smoke “Feu Etage” (gSmoke) {channel=“mihome:smoke:34ce00fb6030:158d0001d8f173:alarm”}

Switch Cuisine_smoke “Feu Cuisine” (gSmoke) {channel=“zwave:fibaro_fgsd002_00_000:aec5d933:node3:alarm_smoke”}

And the sitemaps part

Frame label=“Sensors”
{
Group item=Gxiaomi
Group item=gMotion
Group item=gSmoke
Group item=Beacons
}

Try that

Frame label=“Sensors”
{
Group item=Gxiaomi
Group item=gMotion
Switch item=Chambre_smoke
Switch item=Cuisine_smoke
Group item=Beacons
}

It’s the same.

Ok the second one is due to the binding providing a mapping to the switch.
I don’t have a solution in my head right now. sorry.

You could use mappings in the first item: https://www.openhab.org/docs/configuration/sitemaps.html#mappings

So you would map that on/off state to ok/alarm.

1 Like

Yes it’s works !

But you know if possible to put this device with mapping in a group also ?

:smiley:

Big thx !

You do not really want to use group in the sitemap.
You have no control over mappings, no control of the order the items are displayed.

I would recommend that you spend time on your sitemap and build it item by item

Using frames item by item, will help for sure!

Noted, thank you
I take your advice and I learn.
Thank you

1 Like

+1 on this :+1:

It takes a while to construct it but I’m sure it’s worth it.

1 Like