Core 2026.2.0 - Template Sensor for Garage Door not working anymore

Dear fellow enthusiasts,

I use a template binary sensor for controlling my garage door and checking its state. The template draws the data from a Shelly 1 with sensor add-on. Two days ago the template stopped working properly. While I’m still able to open and close the garage door, the state however isn’t shown anymore.

I think it’s something with the latest Core update. This is my binary sensor template, that I have in my template.yaml:

  - name: Garagentor
    device_class: garage
    position: "{{ is_state('binary_sensor.garagentor_input_100', 'on') }}"
    open_cover:
      - condition: state
        entity_id: binary_sensor.garagentor_input_100
        state: 'off'
      - action: switch.turn_on
        target:
          entity_id: switch.garagentor
    close_cover:
      - condition: state
        entity_id: binary_sensor.garagentor_input_100
        state: 'on'
      - action: switch.turn_on
        target:
          entity_id: switch.garagentor
    stop_cover:
        action: switch.turn_on
        target:
          entity_id: switch.garagentor
    icon: >-
        {% if states('binary_sensor.garagentor_input_100', 'on') %}
          mdi:garage-open
        {% else %}
          mdi:garage
        {% endif %}

The entities are all correct, the Shelly is working fine. It’s just that HA isn’t registering/showing the state anymore and correspondingly doesn’t pass it through correctly to Apple HomeKit with HomeBridge.

Anyone knows a fix for this? Thx!

That’s not a binary sensor, that’s a cover.

What’s not working? Are there errors in your logs?

Sorry for the false wording. I corrected the post. That’s the only error I’ve found in the logs regarding the garage door:

Logger: homeassistant.components.template.validators
Quelle: components/template/validators.py:39
Integration: Template (Dokumentation, Probleme)
Erstmals aufgetreten: 20:00:40 (1 Vorkommnis)
Zuletzt protokolliert: 20:00:40

Received invalid cover position: False for entity cover.garagentor, expected a number between 0.0 and 100.0

Can this be a problem with the template being legacy and not working anymore under 2026.2.0?

position should be a number 0-100, not true/false. I saw the error later, but it says the same thing. The template does not look like legacy to me, and legacy still works for a couple of months. But this should never have worked.

1 Like

The last release started validating templates, ensuring that each template produces the correct result for the attribute/state. What @Edwin_D is saying is correct. Ultimately this got by in the past erroneously. Even though your template worked, it really didn’t work.

Change the word position: in your YAML to state: and your template entity will work again.

State of the sensor was always on or off (“an” or “aus” in German).

That was the fix, thank you very much!

Yes, and the is_state() function that you used to test it returns true or false based on wether it was on or off. Neither true nor false are valid to use as a number for the position. The state does allow for it, and translates it to open or closed. That is why petro’s fix helps. You either supply a numerical position for the slider or a state.

1 Like