-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The humidity entity status is bad in room card #27
Comments
it looks like it is detecting the also what device is it?, as it does not seem to have a |
Temperature value is correct.
|
hmm, strange can you add the code to your room car, as a test label: >
[[[
var entity = 'sensor.mi_teplomer_3_humidity'
var entity_state = helpers.localize(states[entity], states[entity].state);
return entity_state;
]]] then refresh the dashboard, using the 3 dots in top right of screen. |
thats strange the card is using the same code. here's a copy of the latest dev, just incase. |
can you also try with just using |
Thank you for your interest and patience. |
are you using ZHA or Z2M, I'm using Z2M with no issues here. |
I use Z2M. |
is this the sensor https://www.amazon.co.uk/dp/B09QMDZLF5?_encoding=UTF8&psc=1&linkCode=sl1&tag=smarthomescen-20&linkId=8cf5a0406193c5bbcfe0fe87dabd6ce6&language=en_GB&ref_=as_li_ss_tl ? if so I'll purchase one and see if I can reproduce the bug. |
It is this device: https://www.aliexpress.com/item/1005005601289812.html?spm=a2g0o.order_list.order_list_main.216.2cd31802uS6jjz zigbee variant |
I tried creating a new sensor with device sensor status. When using the new sensor, the display is correct. |
One more note. In devices where there is temperature in the attributes, temperature will be displayed instead of humidity. In devices where there is neither temperature nor humidity in the attributes, humidity will be displayed. It would probably like the value of the humidity attribute to be in the entity_state variable. |
this is the code label: |-
[[[
var spacer = " | ";
function getState(entity) {
var entity_type = "";
var entity_state = "";
if (variables.andyblac_card_room_use_label_icons) {
var entity_type = "| ";
var spacer = " ";
if (states[entity].attributes?.device_class == 'temperature') {
var entity_type = "🌡️";
} else if (states[entity].attributes?.device_class == 'humidity') {
var entity_type = "💧";
} else if (states[entity].attributes?.device_class == 'illuminance') {
var entity_type = "🔆";
}
}
if (states[entity].attributes?.brightness) {
var bri = Math.round(states[entity].attributes?.brightness / 2.55);
var entity_type = "💡";
var entity_state = (bri ? bri : "0") + "%";
} else if (states[entity].state) {
var entity_state = helpers.localize(states[entity], states[entity].state);
}
return entity_type + entity_state;
}
if (variables.sensor_label_1 && variables.sensor_label_2 && variables.sensor_label_3) {
return getState(variables.sensor_label_1) + spacer + getState(variables.sensor_label_2) + spacer + getState(variables.sensor_label_3);
} else if (variables.sensor_label_1 && variables.sensor_label_2) {
return getState(variables.sensor_label_1) + spacer + getState(variables.sensor_label_2);
} else if (variables.sensor_label_1 && variables.sensor_label_3) {
return getState(variables.sensor_label_1) + spacer + getState(variables.sensor_label_3);
} else if (variables.sensor_label_2 && variables.sensor_label_3) {
return getState(variables.sensor_label_2) + spacer + getState(variables.sensor_label_3);
} else if (variables.sensor_label_1) {
return getState(variables.sensor_label_1);
} else if (variables.sensor_label_2) {
return getState(variables.sensor_label_2);
} else if (variables.sensor_label_3) {
return getState(variables.sensor_label_3);
} else if (entity?.entity_id) {
return getState(entity.entity_id);
}
return variables.ulm_translation_state;
]]] |
Yes, but for some unknown reason the value of the temperature attribute is in entity_state and not the value of the entity state. |
hello I use your custom room card. I noticed that the state of the humidity thermometers entity was incorrectly displaying humidity. This only happens with zigbee thermometers. Entity status is OK in HA. In Z2M, the condition is also ok. Only on the dashboard it is incorrect.

The text was updated successfully, but these errors were encountered: