ladaowner
(Ladaowner)
April 1, 2023, 4:09pm
1
- sensors:
door_lock:
friendly_name: "Nuki_test"
value_template: >-
{% if is_state("sensor.Nuki_motor_status", "locked") %}
Locked
{% elif is_state("sensor.Nuki_motor_status", "unlocked") %}
Unlocked
{% else %}
Jammed
{% endif %}
icon_template: >-
{% if is_state("sensor.Nuki_motor_status", "locked") %}
mdi: mdiLock
{% elif is_state("sensor.Nuki_motor_status", "unlocked") %}
mdi: mdiLockOpenAlert
{% else %}
mdi: lock-alert-outline
{% endif %}
what I want is
unlocked = mdi: mdiLockOpenAlert
locked = mdi: mdiLock
elser = mdi: mdilock
pedolsky
(Pedolsky)
April 1, 2023, 6:01pm
2
1 Like
Dzel
April 1, 2023, 6:35pm
4
you mean:
- platform: template
sensors:
voordeur:
friendly_name: "Nuki_test"
value_template: >-
{% if is_state("sensor.Nuki_motor_status", "on") %}
Open
{% elif is_state("sensor.Nuki_motor_status", "off") %}
Locked
{% else %}
Closed
{% endif %}
icon_template: >-
{% if is_state("sensor.Nuki_motor_status", "on") %}
mdi:lock-alert-outline
{% elif is_state("sensor.Nuki_motor_status", "off") %}
mdi:lock
{% else %}
mdi:lock
{% endif %}
I put “on” and ''off" in the state, so be sure of your device’s state, so for me, the door sensor gives open and close, but the states are “on” and “off”.
and for the icon like @pedolsky mentioned go the Material Design Icons - Icon Library - Pictogrammers and search for the icon when you find it press on it put home assistant and copy the icon name
so for this icon it is mdi:lock and the other icon is mdi:lock-alert-outline
1 Like
ladaowner
(Ladaowner)
April 1, 2023, 10:29pm
5
Yes it was the wrong mid: names for the icons
Thanks everyone.
1 Like