[SOLVED] Sitemap: un switchable items

Thanks.

I also have “read-only” switches (e.g. smoke detectors).
To see them in BasicUI as readonly I used 2 things:

  1. Used mappings to be able to map ON/OFF state to string
    Switch KitchenSmokeDetected "Smoke detected (Kitchen) [MAP(SwitchPresence.map):%s]" <fire> (gEmergencyDetectors,gSmokeDetectors) {channel="mihome:smoke:158d0002b0b1c6:alarm"}

Content of conf/transform/SwitchPresence.map is

ON=Yes
OFF=No
NULL=Not set
UNDEF=(not defined)
-=?
  1. Using Text type in sitemap
Text item=KitchenSmokeDetected

And it looks like this:

1 Like

When you use the Group widget for display in sitemap, you are stuck with default displays for everything. No mappings, visibility, colour options; no choice of item ordering.
It’s a quick fix to get you started and most people soon abandon the use - for display

It often seems little understood that you can get the same “one line” display that is clickable to expand to a new page sub-items like this:

Text item=myGroup {
   Switch item=switchA mappings=[ON="fred",OFF="mary"]
   Text item=switchB icon="bell"
}

More tedious (once), more flexible, more precise.

3 Likes

I’m at a very early stage in what concerns OH use, my first goal is to have everything working, so for the time being I will continue with group display, but soon I will optimize and your suggestion will be very usefull.