erikor
(Eric)
May 26, 2022, 4:08am
1
The template docs give examples that suggest the trigger based sensor below should update the icon when the state changes. The state changes as expected, but the icon in my entity or glance cards does not change. Is there a way to get the icon to update along with the state?
- trigger:
platform: event
event_type: call_service
event_data:
domain: blink
service: trigger_camera
binary_sensor:
name: blink_updating
icon: >
{% if is_state("binary_sensor.blink_updating", "on") %}
mdi:timer-sand
{% else %}
mdi:check-outline
{% endif %}
state: 'on'
auto_off:
seconds: 7
According to the documentation here it is not icon but picture.
picture template (optional)
Defines a template for the entity picture of the sensor.
erikor
(Eric)
May 26, 2022, 6:17pm
3
@Olivier1974 further down on that page it also lists icon as something that can be specified by template.
Just tried it on my setup, this works
template:
- binary_sensor:
- name: master_bedroom
state: >
{{ is_state("light.master_bedroom", "on") }}
icon: >-
{% if is_state("binary_sensor.master_bedroom", "on") %}
mdi:weather-sunset-up
{% else %}
mdi:weather-sunset-down
{% endif %}
But when using the trigger mechanism, it doesn’t.
I invite you to create an issue on github for that.
erikor
(Eric)
May 27, 2022, 12:19pm
6
Ok. I will do a little more testing and create an issue! Thank you for investigating.