Open filikun opened 2 years ago
I also ran into this issue and had a quick look today.
I think I have found the problem, both the card_binary_sensor
and card_binary_sensor_alert
are missing their label:
definitions.
I modified the card_binary_sensor
template located here:
/config/custom_components/ui_lovelace_minimalist/__ui_minimalist__/ulm_templates/card_templates/cards/card_binary_sensor.yaml
To the following:
ulm_language_variables
to the template list---
### Card Binary Sensor ###
card_binary_sensor:
template:
- "icon_info_bg"
- "ulm_language_variables"
- "blue"
name: "[[[ return entity.attributes.friendly_name != '' ? entity.attributes.friendly_name : entity.entity_id ]]]"
show_last_changed: true
label: >
[[[
var unit = entity.attributes.unit_of_measurement != null ? " " + entity.attributes.unit_of_measurement : ""
if (entity.state == "on") {
return variables.ulm_on;
} else if (entity.state == "off") {
return variables.ulm_off;
} else if (entity.state == "unavailable") {
return variables.ulm_unavailable;
} else if (entity.state == "idle") {
return variables.ulm_idle;
} else if (entity.state == "open") {
return variables.ulm_open;
} else if (entity.state == "closed") {
return variables.ulm_closed;
} else {
return entity.state + unit;
}
]]]
With those changes the state now shows up correctly:
Describe the bug The main issue is that if you set
show_last_changed: false
the card does not show any state in the label field. Also The documentation is wrong as if you are on the card_binary_sensor_alert page page it shows you the config forcard_binary_sensor
and vice versa.EDIT: It seems card_binary_sensor has the same problem.
Tested config
How it looks
Expected look