Hello,
I have a Google Wifi sensor, and i want to change the icon if state == Online
I tryed this from my dashboard:
type: entities
entities:
- entity: sensor.google_wifi_status
secondary_info: none
name: Status
icon: |-
{% if is_state('sensor.google_wifi_status', 'Online') %}
mdi:wifi
{% else %}
mdi:cancel
{% endif %}
icon_color: |-
{% if is_state('sensor.google_wifi_status', 'Online') %}
green
{% else %}
red
{% endif %}
But, this don’t work, and i try lot of things templating but i don’t know why i can’t use interpreted code inside this key.
Can you help me please ?