Open martkopecky opened 8 months ago
the colors of the icon for template-entity-rows have started changing based on the underlying entity state. I've seen yellow/amber for toggle: on and also purple in some cases.
This is normal & expected in Entities card with "state_color: true" defined.
There was some buggy behaviour around this introduced in a recent version of Home Assistant. Work is currently ongoing to determine what is the right behavior, and then to fix it.
not sure if this is the same, but template-entity-row does not follow state_color: true
when doing
type: entities
state_color: true
entities:
- type: custom:template-entity-row
entity: sensor.slaapkamer_hygro_temp_battery
while its more-info does show the correct state_color:
we can set an explicit card_mod on it:
- type: custom:template-entity-row
entity: sensor.slaapkamer_hygro_temp_battery
card_mod: !include /config/dashboard/card_mods/battery_color.yaml
which does:
currently testing with
Core 2024.4.0.dev20240311 Frontend 20240308.0.dev
this is the same, but template-entity-row does not follow
state_color: true
when doing
This was broken in 2024.3.
Seems there is something more:
@chemelli74 yes, same issue
@chemelli74 yes, same issue
Sorry, I may miss something but core itself shows green color (which is correct), while template row not. Isn't it an issue on this custom card code ?
Is there any solution to this problem?
getting back to this, because after testing 2024.7.beta, I now also see that the active options is not set when using below config, nor is the icon properly inherited from the entity, as the documentation explains/instructs:
- type: custom:template-entity-row
entity: device_tracker.private_ble_device_marijn
active: >
{{is_state(config.entity,'home')}}
should light up properly (it did before) and change to the connected icon:
this it the template entity row:
and yes, ive also setstate_color: true
in the containing entities card.
this is the correct more info:
coloring according to the theme colors, and setting the icon according to the device
could it be relatively new Icon translations are not yet supported and we need to explicitly template those now?
Imho active
is not working for some long time.
For instance, in 2024.6.4 it does not work:
thanks for confirming, I wasnt sure.
However, I am sure it did work when I created this card, and that was short after the private Ble were introduced, and a bit later when the state_translated was introduced.
dont believe the template-entity-row has the state_color:
option though? (the bottom example of your post.)
anyways, I really hope this magic card will see an update sometime.
maybe I should open a separate issue for the icon (didnt check yet if there already is one), to keep it as clear and clean as possible to track
dont believe the template-entity-row has the state_color: option though? (the bottom example of your post.)
Added this example just in case.
According to my log, "active" was not working by "06.04.23".
Hi, A workaround to this problem is adding this to the entity:
color: |
{% if is_state('switch.your_switch_here', 'on') %}
var(--state-active-color)
{% elif is_state('switch.your_switch_here', 'off') %}
var(--state-inactive-color)
{% else %}
var(--disabled-color)
{% endif %}
I hope this helps someone!
still an issue as of 2024.10.2; thanks @maximuswallis for the workaround!
Not sure if this is a bug or a feature, but with one of the last plugin versions & update to HA 2024.02, the colors of the icon for template-entity-rows have started changing based on the underlying entity state. I've seen yellow/amber for toggle: on and also purple in some cases.
For now, it can be cured by specifying
color: var(--paper-item-icon-color)
explicitly.I can see no such behavior on the automatically generated dashboard, so I expect that this whole color changing is not something new in the core components just being inherited to the template entity row.
Sorry for the vague description. Here an example of amber icon: