I’m trying to group my garage cover sensor and a binary motion sensor for lighting automation. In order to do this, I’m trying to create a binary sensor that is operated by the garage door cover. It seems easy but I just can’t get it to work. Here’s what I have:
template:
- binary_sensor:
- name: BigGarageDoorBinarySensor
state: >
{% if is_state('cover.house_big_door', 'opened') %}
on
{% else %}
off
{% endif %}
I did something similar, except for door locks. I went about it slightly differently, but I think the major issue you have is the extra spaces that could be showing up in your output. Here’s how I went about it:
Thanks for the suggestions! Come to find out that my state data label was incorrect. The HASS UI for the MyQ shows “Opened” for the status. When I looked at the state information in the developer area, the data in the state label was “open” instead of “Opened”.
I appreciate the added info about splitting the template file out of the configuration file. I totally missed that and was setting myself up to have a very messy coding experience.