I have a garage door I can control via zigbee2mqtt but I am having some issues to make it work smoothly.
TLDR after a button press I need to prevent any further button press while the door is moving, I can only use a timer after a button press to know if it’s moving.
Best option would actually be while the door is moving, toggling the lock entity should trigger the push button twice with 1sec interval, first will stop the movement second will reverse the movement.
I did see the Lock Template entity and using it without the optimistic setting I do have a reliable on/off status, but still, any attempt to mistakenly open it twice results in the garage door stopping.
I’m not fixed on one or the other, but for me stopping the garage door mid-way is useless, so I would really like to either prevent any press of the button while the door is moving, or double any press with 0.5 sec interval inbetween to allow the motor to stop then reverse…
My garage exposes a single contact as a binary sensor (closed is closed, but “open” might be opening or fully open) as well as a trigger exposed as a switch, but this switch is let’s say… complex in it’s behaviour, it remains on or of and depending on what the door is doing it triggers either a stop or a close or an open of the door.
I found a reliable way to sue the switch regardless of it’s position on or off : doing 2 toggles in quick sucession will always make the door register an action, and it will either ropen or close or stop depending on the position.
So what I’m now trying to achieve is to prevent stopping the door mid-way…
I tried relying on the on/off state of the trigger button but no luck here, I’m still able to stop the door in the middle…
I’m imagining many ways of doing this, with mqtt I could create a fake position, and automations to increment/decrement the position, I could create a simple input_boolean “door is moving” instead and try to set/unset it in the template lock/unlock actions and in automations with complex conditions depending on the actual contact of the door and when the movement has started and such…
I see many complicated solution but I can’t wrap my head around anything simple that would make the actual lock entity just “work” with no stopping in the middle…
I thought it’s not so hard :
- any action on the door means switch.toggle+wait0.5s+switch.toggle again
- if door is in movement, the first action will only stop the door, so double the action.
This is because on the template lock entity if it directly manipulates the switch entity, you can end up, by mistake, with the door stuck in the middle while given the number of lock/unlock I thought the door should be closing…
As of today my only solution is to have my CCTV camera pointed at my garage door on the same dashboard as the lock button, this way I can see that I’m waiting for something to happen while the door is simply stopped in the middle unmoving… This happens to me regularly… Trying to solve that frustration, I saw many people offering many templates and stuff none of them would seem to solve my current gripe.
I’m also taking other advices f you have, I mean if buying a vibration sensor to stick on my garage motor is the best way to get a “door is moving” thing that I can actually rely upon then this is what I’d do…