Garage Door Error in condition evaluation: in state: In state

Using the following I am getting an “unknow sensor state” and non-functioning button. This code has worked well until a recent core update and restart. I can use the Shelly integration control to open the door and I can see that the reed switch (open or closed) is working so something in the code is changed. Have tried adding unique id: but no change any help for a nube welcome. Mark

  - sensor:
      - name: "Open Sesame"
        unique id: 38b3cc96-f308-458f-84e3-324562b90a87
        state: >
          {% if is_state('binary_sensor.open_sesame_sensor', 'off') and is_state('switch.open_sesame', 'on') %}
            opening
          {% elif is_state('binary_sensor.open_sesame_sensor', 'off') and is_state('switch.open_sesame', 'on') %}
            closing
          {% elif is_state('binary_sensor.open_sesame_sensor', 'on') %}
            open
          {% else %}
            closed
          {% endif %}
cover:
  - platform: template
    covers:
      garage_door:
        device_class: garage
        friendly_name: "Garage Door"
        value_template: "{{ states('sensor.open_sesame') }}"
        open_cover:
          - condition: state
            entity_id: sensor.open_sesame
            state: "closed"
          - service: switch.toggle
            target:
              entity_id: switch.open_sesame
        close_cover:
          - condition: state
            entity_id: sensor.open_sesame
            state: "open"
          - service: switch.toggle
            target:
              entity_id: switch.open_sesame
        stop_cover:
          service: switch.toggle
          target:
            entity_id: switch.open_sesame
        icon_template: >-
          {% if is_state('cover.garage_door', 'opening') or is_state('cover.garage_door', 'closing') %}
            mdi:garage-alert
          {% elif is_state('cover.garage_door', 'open') %}
            mdi:garage-open
          {% else %}
            mdi:garage
          {% endif %}

please use code tags around your code, it will make it more readable and preserve indentation. I’ve added them for you now :slight_smile:

Thank you for your guiding hand, I am not sure what a code tag should look like, but cutting and pasting the code you were kind enough to modify for me, which I have reinstalled in my yamal config file gets me the same error as before
image Apologies I cant work out what I am looking for on this isssue

I would check the deveoper tools to see if the open sesame sensor is indeed the one you refer to with sensor.open_sesame. If somehow the unique id got changed or something, the template you have might be sensor.open_sesame_2 or something.

I didn’t change anything yet, just formatted your YAML properly :slight_smile:

Thanks, yes I did takea look and all seems good. I can also see the state change when I drive the shelly switch from its native app. So ???