Need help with template sensor

Trying to get my two garage doors into Alarmo and need to turn them into binary sensors. I know I need to do it via a template sensor. I even tested the template and it appears to work. But when I restart HA, I don’t get a sensor and I’m not sure why. Hoping someone here can find the (very likely simple) reason why because I’m going crazy trying to figure it out!

template:
  - binary_sensor:
    - name: Right Garage Door
      state: >-
        {% if is_state('cover.right_garage_door', 'open') %}
          on
        {% else %}
          off
        {% endif %}
      device_class: door

Assuming I(as you wrote) that the sensor is correct and throws ‘open’ as a state… try a bit simpler, it only needs to return ‘true’ to switch it

template:
  - binary_sensor:
    - name: Right Garage Door
      state: "{{ is_state('cover.right_garage_door', 'open') }}"
      device_class: door
1 Like

I found this version (either on here or on Reddit, I can’t remember anymore) and tried it. I have the same problem: it passes the config check but never creates the sensor after a restart. I also had to put a space between state: and the template to get it to pass the config check. I also made sure to deconflict the names so it didn’t overlap with another device. Nothing seems to work to get the binary sensor to show up.

Very odd, I tried this very same setup (with a random sensor I have) in my instance templates.yaml, used the load templates (not restart needed) and shows nicely.
Recently I read about a similar issue with caching of browser, can you refresh your screen maybe?

- binary_sensor:
    - name: Right Garage Door
      state: "{{ is_state('automation.taba_motion_screen','off') }}"
      device_class: door 

Ok I split the templates out into their own .yaml file and now my binary sensors are working. However, I could only get the “long” version working and not the shorter version. Not sure if I had some weird conflict that I wasn’t seeing or whatever, but pulling the template sensors out into their own .yaml seems to have fixed my issue. Thanks for your help!