Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto detect obstruction sensors #298

Merged
merged 4 commits into from
Jul 3, 2024
Merged

Auto detect obstruction sensors #298

merged 4 commits into from
Jul 3, 2024

Conversation

PaulWieland
Copy link
Contributor

When no obstruction sensors are installed, sec+ 2 doors ignore the discrete close command (see #146). The MQTT firmware does not have this problem because it only uses toggle commands. The toggle command is skipped if the door is already in the desired state, which has the same end result as using discrete commands.

Since the toggle command is always accepted by the door, this PR is designed to detect a low pulse on the obstruction sensor input, and if one is found, assume that the sensor is present. If the sensor is present, use the discrete close command, and if not, use the toggle command instead.

It also will report the obstruction status from the status packet if no sensor is detected.

Much testing required before merge.

use toggle action instead of close if no sensors detected
@agoode
Copy link

agoode commented Jul 2, 2024

Is there any way to continue to read the obstruction from the status packet even with obstruction sensors connected? I prefer to report obstruction that way so that I have a clear idea of what the door opener thinks. (This was useful when I had a bad sensor that was triggering a door re-open but not being detected with the ratgdo obstruction input.)

In my yaml I currently have this to enable obstruction-from-status:

ratgdo:
  input_obst_pin: none

@PaulWieland
Copy link
Contributor Author

Not really. The obstruction from status is really slow which is why I designed ratgdo to detect from the hardware sensors directly. It needs to be one or the other or you will get conflicting messages as the status update lags behind the actual sensor state.

@agoode
Copy link

agoode commented Jul 2, 2024

Seems reasonable. It might be nice to (optionally) expose both obstruction sensors. But I'll assume for now it's one or the other.

components/ratgdo/ratgdo.cpp Outdated Show resolved Hide resolved
@PaulWieland PaulWieland merged commit b148105 into main Jul 3, 2024
16 checks passed
@PaulWieland PaulWieland deleted the optional_obst_sensors branch July 3, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants