Closed snowy-18 closed 5 months ago
What is the state in the developer tools of HA?
The state is "off", as displayed on the room card. According to the HA documentation, the Device Class influences how the entity is represented in the dashboard.
Thats excepted behavior. You need to pass which attribute you want to show if you dont want to see the state there
``attribute: ``` in config
Thanks for your help. Btw, great card!! Really the only one that I'm using on my main dashboard and probably the main reason why the whole family startet using HA 👍
So I tried adding:
attribute: device_class
As I'd expect, then the label reads "moisture", and not "dry":
I feel like I'm not getting how to use the attribute here?
In a normal entity card, the state is "dry" and not "off", just as it is configured in the entity's settings:
You need to use the flood entity apparently. State should give the wanted result with that entity
Take a look at the entities in developer tools. There you can see all the attributes
Gave this another try on a fresh dashboard, where I added the same entity on different cards. The stock HA Entity
, Entities
and Glance
cards, as well as custom Room
, Bubble
and Mushroom
cards.
- title: Test
path: test
cards:
- type: custom:room-card
title: Room-card
rows:
- entities:
- entity: binary_sensor.waschkuche_wassersensor_flood
show_state: true
- type: entity
entity: binary_sensor.waschkuche_wassersensor_flood
- type: entities
entities:
- entity: binary_sensor.waschkuche_wassersensor_flood
- type: glance
show_name: true
show_icon: true
show_state: true
entities:
- entity: binary_sensor.waschkuche_wassersensor_flood
- type: custom:mushroom-entity-card
entity: binary_sensor.waschkuche_wassersensor_flood
- type: custom:bubble-card
card_type: button
button_type: state
entity: binary_sensor.waschkuche_wassersensor_flood
The room-card
is the only one which displays the state as off
instead of dry
:
Here are the entity's state
and attributes
in the developer tools:
So yes, technically the state is off
and not dry
, but the entity
is configured as the device_class: moisture
/ Show as: Moisture.
If I change the device_class
to anything else, e.g. Show as: Smoke, all cards on the dashboard above will show the state as Clear
, or Show as: Safety, all cards on the dashboard above will show the state as Save
...
... but the Room-card
will remain as Off
.
I might be wrong but don't think this is an issue with the attribute of the entity, rather how the Room-card
handles the device_class
.
Thoughts?
I don't know how to explain haha. But you are doing it wrong xD
Which version of Room Card? 1.08.04 but has always been like this
Describe the bug The device_class of a sensor is being ignored when showing the state of a sensor on the room card. In my example, a binary flood sensor has the state "dry" in the general Home Assistant UI, but on the Room Card it is shown as "off". That's technically correct, but ignored the global settings applied to the entity.
To Reproduce Take any sensor and modify its device_class in the entity's customize section: https://www.home-assistant.io/integrations/sensor/
Expected behavior The state shown on the room card should be the same as in the entity's settings.
Screenshots
Desktop (please complete the following information): Mac, Windows, Web
Smartphone (please complete the following information): iOS
Additional context Maybe related to #249? The state on the room card remains "off", even if I change the UI to another language than English.
YAML