Please Help - What´s wrong

  • 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 %}

it´s not show in sensor

Does it show any errors in your log?

And please show the correct format code, as intendations are very important.
</> in the reply window

  - 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 

Your spacing is off here

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 %} 

I’m stupid that i didn’t saw that :grimacing:. Spacing is a pain in the ass that keeps ******* me up.

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

Help out on the forums more with crap you’re uncomfortable with. It’ll speed up the learning process.

2 Likes

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.

value_template: >-
        
          Bewegung
        
      icon_template: >
        
          mdi:door-open

Thank You - All - It´s running