OH3 MainUI: Some badges are reversed (lock/heat)

Dear Openhabians,

after setting up the semantic model I have noticed that some model badges on the cards seem to show the reversed state (or I don’t get the concept).
For example on Yannicks demo page the model card of Corridor:


Here the Lock icon shows unlocked then the Lock is currently on. Also the Heating Icon shows a snowflake when the heating is on.
I can understand that the snowflake is representing a HVAC equipment, but I can’t wrap my head around the lock icon.

Am I just too confused or is it a bug?

I’m also interested to know how to enable the right badge. Also seeing a snowflake when I have heat on as a switch, or heatingmode “heat” as a string.

Okay, looking through the code, it seems like the badge shows “climate on” by using the “climate” openhab icon.

This is why we see the snowflake: Icons | openHAB

badgeConfigs: {
        alarms: { icon: 'f7:exclamationmark_triangle_fill' },
        lights: { icon: 'oh:lightbulb' },
        windows: { icon: 'oh:window', state: 'open' },
        doors: { icon: 'oh:door', state: 'open' },
        garagedoors: { icon: 'oh:garagedoor', state: 'open' },
        blinds: { icon: 'oh:cinemascreen', state: '100' },
        presence: { icon: 'oh:motion', state: 'on' },
        lock: { icon: 'oh:lock', state: 'open', stateOff: 'closed' },
        climate: { icon: 'oh:climate', state: 'on' },
        screens: { icon: 'f7:tv' },
        projectors: { icon: 'f7:videocam_fill' },
        speakers: { icon: 'f7:speaker_2_fill' }
      }

The radiator icon wasn’t looking too good, it was just a big square with a black/white filter applied :confused:

About locks, I don’t have any, but I assumed ON or OPEN meant “unlocked” and OFF or CLOSED meant “locked”. If you think I’m wrong we can flip the icons.

Hi Yannick,

maybe we could use bacon strips as a sign for general ventilation, be it cooling or heating.
The closest I found in f7 is f7:wind but I was thinking about the Oh icon “smoke”:
image

Regarding the lock, CLOSED is locked, I agree. But my gut feeling would be that ON is also locked, but I admit that is a matter of taste, so I can just flip the group logic :slight_smile:

Yes I considered the “smoke” icon, was just concerned some people would interpret it as, well, smoke.
IMHO it’s also OK to depict heating.

There’s also a “hvac” icon in the material set:
https://jossef.github.io/material-design-icons-iconfont/

image

I don’t find it that appealing though.

What Point did you setup your lock in the semantic model?
I have set a group of my dana lock as Lock, but what’s the right “Point” for the lock’s state?
Switch?
OpenState?
Status?

Hello,

is ist possible to change this badgeConfig for the standard “location” cards ? How ?

Thank you

regards

Hmm mine is set to Point->Switch, but I really can’t tell you if that’s right or wrong.

Thank you for your quick response.
I am relieved that I am not the onle one :wink:

Yes, this is true for my dana lock for instance (see below).
I would love to have the icon flipped:

Can I manually edit this config somewhere?
I did not find this in the jsondb directory.

Hi Yannick,

I have seen various users that confirm that “Locked” is “ON” and “Unlocked” is “OFF” for their locks, I am also one of them. I realize that people with devices where this is flipped would not complain on the forum, so I am not 100% sure. If the badge could be configured somewhere this would also be fine.

Some references:

My devices are “Danalock” locks. So I would vote for 'locked" is “ON” :slight_smile:

Thx for your great work on the OH3 UI, I really like its beauty, flexibility and versatility.

My Popp z-wave doorlock also is ON when LOCKED.
Is there a solution as long as @ysc hasn’t changed the code?

Maybe something like

config:
  label: Home Page
locations:
  - component: oh-locations-tab
    config:
      badges:
        lock:
          expression: state === 'OFF'
3 Likes

That worked, thanks.

This is not a solution to the particular problem posted but perhaps related, and in any case something to keep in mind with these location badges. My location badge showed an open lock regardless of whether the lock switch was ON or OFF. I changed the Semantic Class of the lock switch item from “Switch” to “Point”, and thereafter it worked correctly.

Thanks!
Works perfectly! :slight_smile:

Probably something I don’t understand with this hint.
Tried editing my Home page in the top section to match this example but had no effect. Lock badge still reversed. Using 3.2.0
image

Am I editing in the wrong place/file?

Thanks
Brian

I have the config/badges/lock section placed withing the slots/location section:

    slots:
      Corridor:
        - component: oh-location-card
          config:
            badges:
              lock:
                expression: state === 'OFF'

this works for me on 3.2.0 to reverse the lock badge

2 Likes