Enhance OPEN state to report position#396
Conversation
8148f49 to
2065cfc
Compare
|
Not sure if the latest commit encroaches on other protocols, but I moved the OPEN position override to the STOP/TOGGLE action handler. |
|
This has been working very well for a few weeks, with two outstanding issues:
Edit: brainstorm on the second issue, we could potentially handle the |
8a3423a to
54f8cf5
Compare
I think this is a good approach, if ever the limit sensors see the door is open or closed it should update the position. |
Yes, subscribing to the Limit Switch's states and handling the external state change as an OPEN/CLOSE would resolve this. |
Use position float instead of 1.0 for open state
54f8cf5 to
9163f5e
Compare
9163f5e to
4eb3649
Compare
For dry contact openers, replace the callback-based stop-then-reverse pattern with a timeout-based approach. Sends STOP, waits 1 second for the pulse to complete and the gate to settle, then re-calls door_open or door_close. This fixes two problems with the original approach: 1. The on_door_state callback waits for STOPPED but PR ratgdo#396 sets OPEN, so the follow-up command was never sent. 2. Even if the callback matched, the follow-up tx_pin pulse would overlap with the still-active STOP pulse (both HIGH within the same 500ms window), resulting in one physical button press instead of two. Also adds stop-first handling to door_open() for dry contact when the gate is currently CLOSING, which was previously missing entirely.
For dry contact openers, replace the callback-based stop-then-reverse pattern with a timeout-based approach. Sends STOP, waits 1 second for the pulse to complete and the gate to settle, then re-calls door_open or door_close. This fixes two problems with the original approach: 1. The on_door_state callback waits for STOPPED but PR ratgdo#396 sets OPEN, so the follow-up command was never sent. 2. Even if the callback matched, the follow-up tx_pin pulse would overlap with the still-active STOP pulse (both HIGH within the same 500ms window), resulting in one physical button press instead of two. Also adds stop-first handling to door_open() for dry contact when the gate is currently CLOSING, which was previously missing entirely. Both functions cancel any pending reverse timeout on entry to prevent stale timeouts from interfering with rapid command changes.
This PR:
Fixes:
Dependencies for Dry Contact firmware:
The other protocols shouldn't require additional changes, testing needs to ensure nothing is regressed. 🤠
TODO:
OPENstate if door is manually stopped partially with wall button/remote (this currently does not time out and staysOPENING|CLOSING)