Checking if garage door is stuck "in between"

I have noticed that when an obstacle (read: my dog) walks through the safety sensor when we are closing the garage door and the safety kicks in, after that -sometimes- the programming of the endstops (fully open position and fully close position) get messed up, meaning that the door won’t fully open or fully close by a few inches and so I need to reprogram them. I want HA to tell me when the endstops are misaligned. I now have 2 Reed sensors positioned on the right positions and HA tells me when the door is fully closed or fully open. How can I get an alert when the door is neither fully open nor fully closed and excluding of course the many 20 second events when the door is moving ? I found this in the docs :

> automation:
>   trigger:
>     platform: template
>     value_template: "{% if is_state('device_tracker.paulus', 'home') %}true{% endif %}"

I think I can use this to have the automation check on the 2 sensors values, and if both of them show “off” for more than 20 seconds give me an alert. Can someone help me with the proper syntax to combine the logical statements ? Am i thinking about this in the right way ?

Thanks !!

You could check both or just one depending on the last command issued.

  • Close door, check door-closed sensor.
  • Open door, check door-open sensor.

I only have a door-closed sensor. Here’s how the system uses that one sensor:

  • Closing the door starts a timer.
  • The timer’s duration is the time it takes the door to close normally plus an allowance for variability (5 seconds).
  • If the door closes normally, it stops the timer.
  • If the door fails to close normally, the timer runs to expiration.
  • When the timer expires, it sends a notification.

It would be easy to use this technique with two sensors.

Something like this should get you most of the way there - you got to make sure, though, that ‘on’ really means the magnet is close to the Reed switch, i.e. when the door is moving both Reed switches are actually ‘off’:

- alias: 'Garage Door Stuck'
  trigger:
    - platform: state
      entity_id: binary_sensor.garage_door_open
      from: 'on'
      to: 'off'
      for:
        seconds: 20
    - platform: state
      entity_id: binary_sensor.garage_door_closed
      from: 'on'
      to: 'off'
      for:
        seconds: 20
  condition: 
    - condition: state
      entity_id: binary_sensor.garage_door_open
      state: 'off'
    - condition: state
      entity_id: binary_sensor.garage_door_closed
      state: 'off'
  action:
    - service: notify.me
1 Like

Thank you @chairstacker and @123 for your replies ! Both are good methods I did not think about. I copy/pasted the second one with a couple of adjustments and it works beautifully !. Grateful for the help one can get in these forums !

1 Like

Glad to hear that it works - would you mind pasting your final code in here for others to use.

Here you go @chairstacker ! Thanks for your help ! Very minor modifications to your code, naming my entities, adjusting the time to 25 seconds just to be safe that it catches the doors not fully completing the travel as opposed to a normal open/close event and show the notification in HA.

- id: '1555474393599'
  alias: Garage door stuck
  trigger:
  - entity_id: binary_sensor.garage_is_open
    for: 00:00:25
    from: 'on'
    platform: state
    to: 'off'
  - entity_id: binary_sensor.garage_is_closed
    for: 00:00:25
    from: 'on'
    platform: state
    to: 'off'
  condition:
  - condition: state
    entity_id: binary_sensor.garage_is_closed
    state: 'off'
  - condition: state
    entity_id: binary_sensor.garage_is_open
    state: 'off'
  action:
  - data:
      message: the garage door needs to be adjusted
    service: persistent_notification.create