Does it show any errors in your log?
And please show the correct format code, as intendations are very important.
</> in the reply window
terra2000
(terra2000)
August 1, 2019, 10:42am
4
- platform: template
sensors:
motion_kuche:
value_template: >-
{% if states.sensor.aeon_labs_zw100_multisensor_6_burglar.state == '8' %}
Bewegung
{% elif states.sensor.aeon_labs_zw100_multisensor_6_burglar.state == '0' %}
Ruhig
{% else %}
n/a
{% endif %}
icon_template: >
{% if states.sensor.aeon_labs_zw100_multisensor_6_burglar.state == '8' %}
mdi:door-open
{% elif states.sensor.aeon_labs_zw100_multisensor_6_burglar.state == '0' %}
mdi:door-closed
{% else %}
mdi:help
{% endif %}
What does your sensor show in the entity/states section?.
If its an attribute you should use a other statement. Something like
{% if is_state_attr('sensor.aeon_labs_zw100_multisensor_6_burglar.state', '#something' ,8) %}
Bewegung
petro
(Petro)
August 1, 2019, 12:09pm
6
Your spacing is off here
terra2000:
sensors:
motion_kuche:
it should be
sensors:
motion_kuche:
which will end up with:
- platform: template
sensors:
motion_kuche:
value_template: >-
{% if states.sensor.aeon_labs_zw100_multisensor_6_burglar.state == '8' %}
Bewegung
{% elif states.sensor.aeon_labs_zw100_multisensor_6_burglar.state == '0' %}
Ruhig
{% else %}
n/a
{% endif %}
icon_template: >
{% if states.sensor.aeon_labs_zw100_multisensor_6_burglar.state == '8' %}
mdi:door-open
{% elif states.sensor.aeon_labs_zw100_multisensor_6_burglar.state == '0' %}
mdi:door-closed
{% else %}
mdi:help
{% endif %}
petro:
Your spacing is off here
I’m stupid that i didn’t saw that . Spacing is a pain in the ass that keeps ******* me up.
petro
(Petro)
August 1, 2019, 12:18pm
8
You just joined not to long ago, over time it’ll become natural to you if you spend a lot of time staring at yaml. Took me a few months when I first started.
2 Likes
I agree with you there.
Whenever i make a new automation, the first thing i check is spacing. But yeah, sometimes it just keeps slipping trough
petro
(Petro)
August 1, 2019, 12:23pm
10
Help out on the forums more with crap you’re uncomfortable with. It’ll speed up the learning process.
2 Likes
123
(Taras)
August 1, 2019, 12:46pm
11
FYI
The first parameter passed to the is_state_attr
function should be the entity_id . In your example, it’s passing the entity_id’s state .
You’re absolutely right, forgot to remove the “state”
My apologies.
terra2000
(terra2000)
August 1, 2019, 7:05pm
13
value_template: >-
Bewegung
icon_template: >
mdi:door-open
terra2000
(terra2000)
August 1, 2019, 7:22pm
14
Thank You - All - It´s running