thanks! awesome widget. Does it also work with “0” and “1”?
I have implemented my presence switch with digital numbers not with the “ON” and “OFF” strings.
And may I kindly ask you to provide a sitemap example?
First things first, great work with the widget and with all the support that you and the other guys provide in the forum.
I’m fairly new to OH, I just started tinkering with it about a week ago. Anyway, I was able to setup openHabian in a RPi4 and I have started to implement presence.
That’s your problem. This is a List Item Widget, not a Stand Alone Widget. The widget above is used when showing the Item inside a list, such as in a Locations card on the Locations tab of the Overview page. It is no designed to be a widget you plop onto a Layout page by itself.
As for the state changing, it will only show “green” and “present” when the Item configured in the widget’s props is “ON”. If the Item’s state is “OFF”, “NULL”, “UNDEF”, or if you misstyped and selected the wrong Item it will always show as red and away. So check you have the right Item configured for the Widget.
When I add the widget inside a list it works correctly, so that part is done.
For the state, after I reload a couple times it started to work correctly so… that seems ok.
Last thing to ask (I have been trying for a while to solve that on my own…) is that the status of the Item appears at the end (IMHO that´s redundant and besides, I don’t see that behaviour in your picture)
Just to make sure, since @rlkoshak is the creator of the widget. Is this how you intended it to be? Should I need to set stateDescription of the Presence Items to " "?
I am trying to solve the same problem with displayed item state next to the presence status.
Unfortunately placing " " this kind of pattern inside the StateDescription does not make the ON/OFF status disappeared. What shall be the right pattern to high the item status text? Is this the intended place to define the pattern in OH3?
This does not work for me. I also set this in code tab of the Item’s stateDescription directly. the “ON/OFF” is always visible.
What do I do wrong?
You will have to change to the testing repo to upgrade to a milestone release. However, this widget has worked, with the space in the state description since before 3.0 was released. I’ve not modified it.
Hi.
This was just what I needed. One little tweak I’d like to do though is to show the configured icon for every item instead of the little general person image. If I just change the icon to for example “oh:boy_1” I get the nice boy image, but how could I get the icon from the item settings instead? I’ve fiddled around with items.props.whatever stuff but can’t seem to get it right, nor do I find any docs that help me…
edit: My best try this far is
icon: '="oh:" + items[props.item].category'
…which I think should work, but I just get “undefined” for category though my items for sure has a category defined…