String with a binary state?


I’d like to add an item in BasicUI that looks something like:

“Alarm: ‘panel string’” where the icon represents the state of the alarm (ie: armed vs not).

I can easily do either in isolation (ie: a switch for the panel state OR a string to display the panel), but I can’t seem to do both. In a purist world, I would argue that what I really want is a contact object that displays a string which is separate from its state. I don’t want the user to be able to change the state of the switch and for that matter don’t really want a switch object. I just want to display the panel’s string along with an icon that changes its state based on the alarm’s state.

The specifics:

String PanelDisplay         "Alarm: [%s]"                { alarmdecoder="KPM:00#text" }
Contact ContactAway         "panel away: [%d]"           { alarmdecoder="KPM:00#contact,bit=16" }

Contact ContactAway         "panel away: [%d]"           { alarmdecoder="KPM:00#contact,bit=16" }

Is it possible to do what I want? It seems like a pretty basic thing to want to do, yet there doesn’t seem to be a way to really do it or maybe I’m missing something?

It sure is possible:

I’m not sure that work. One of the string’s state is “A CHIME,Rdy to Arm”. I’ve tried to create a filename in lower-caps with that string and it didn’t pick it up. I have characters in my string which aren’t part of the allowed icon names.

Then you probably need a rule to update the state of another Item (for example your Contact) and then display that on your sitemap. a Contact Item should work with dynamic icons, and you can use a MAP transform in the Item label to display whatever string you want.

This would be a sitemap Text widget. A Text widget can display any Item type without a means for the user to twiddle it.

What you put in a sitemap are widgets. These are completely unrelated to Item types, though some share the same name. Example, Switch is fairly self evident.
Note that you can display a String or Number type Item using a Switch widget.
You choose, though not all choices are sensible.

No problem. Make your own dynamic icons. (often this is just copying some existing images and renaming them, don’t be put off)

You can use a MAP transform in an Item’s label to transform the display of an Item’s state.
When you are bored with the display of real state e.g. CLOSED, transform it to “Alarm Armed”