Please help with how to

configure my garage door sensors.

I have a binary sensor on the garage door for when it is shut (A) and another binary sensor for when it is open(B).

Therefore:
if A is closed and B is open => garage door is closed
if B is closed and A is open => garage door is open
if A and B are both open => garage door is mid way
if A and B are both closed = > we have a problem!

Can I please have help with the best way to configure this to simply show (in Lovelace) if the Garage door is open, closed, mid way or problem.

I am using Hassio.

You will need to use a template sensor.

sensor:
  - platform: template
    sensors:
      garage_door_position:
        friendly_name:  Garage Door Position
        value_template: >
          {% if is_state('binary_sensor.a', 'on') and is_state('binary_sensor.b', 'off') %}
            Closed
          {% elif is_state('binary_sensor.a', 'off') and is_state('binary_sensor.b', 'on') %}
            Open
          {% elif is_state('binary_sensor.a', 'off') and is_state('binary_sensor.b', 'off') %}
            Mid Way
          {% elif is_state('binary_sensor.a', 'on') and is_state('binary_sensor.b', 'on') %}
            Problem
          {% else %}
            Unknown
          {% endif %}

Then in Lovelace just put ‘sensor.garage_door_position’ in your config.

1 Like

Thank you so much. I hadn’t considered learning how to use templates, so you have saved me so much time!

All works perfectly.

I was pretty intimidated by templates for a long time, too, when I first started.

Once you start getting into them it starts to get easier.

Glad I could help.