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

Adding dry contact control #253

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Adding dry contact control #253

wants to merge 10 commits into from

Conversation

tlhagan
Copy link

@tlhagan tlhagan commented Nov 24, 2024

No description provided.

@tlhagan
Copy link
Author

tlhagan commented Nov 26, 2024

@dkerr64 Thanks for the help with rebasing.

As an update, the current version compiles and flashes properly and allows for switching to dry contact protocol via the settings page (using a value of 3). The next test I performed was to wire up an open/closed limit switch. I am using just one switch with 3 terminals (ground, NC, and NO) to act as both switches (hopefully this shouldn't affect things). When I 'close the door' (bring close limit switch closed, open limit switch open) for the first time, HomeKit and the logs show a proper update to closed. But after that opening or closing the switches does not result in any more updates. This probably has to do with the OneButton functions I implemented, so I'll take a look at those next.

@PaulWieland
Copy link
Contributor

I haven’t reviewed the code yet, but just fyi - There needs to be logic to update HomeKit to opening and closing as well as open and closed.

door opening and door closing is whenever both limit switches are open.

To know which of the two you have to keep track of the last state of both switches. If open limit was closed and is now open, the door is closing, and vice versa.

This will be impossible to mimic with an no/nc switch unless you can somehow hold the switch between states so that both no and nc are open.

@tlhagan
Copy link
Author

tlhagan commented Nov 26, 2024

That's a good point. The logic should be there in the dryContactLoop function to capture the opening/closing states, but I should test it. I do have two limit switches, I was just planning to wire one for convenience in my actual garage setup. I will go ahead and connect both of them for testing to see if opening/closing are properly captured.

@PaulWieland On a related note I did have a question for you. I took the dryContactLoop function from the mqtt code and it is currently basically unchanged in ratgdo.cpp here. I was confused about the logic where it is taking actions if the control protocol is not dry contact. Could you help me understand what is the purpose of those actions (print message, call open/close door function, set dryContactDoorOpen/Close to false)? It seems like I might be able to remove them here.

@PaulWieland
Copy link
Contributor

The dry contact loop handles the inputs on the control board for dry contact control over the door opener. There are inputs that let you trigger the door to open or close, or toggle the light on/off.

@PaulWieland
Copy link
Contributor

I guess to add further clarification… those inputs are re-purposed when you have a dry contact controlled door to read the limit switches. If you have a dry contact control door, you would never need dry contact controls.

@dkerr64
Copy link
Collaborator

dkerr64 commented Nov 27, 2024

FYI that #254 wants to use dry contact support to control a gate rather than garage door... and requests that we have option to remove the light service from the accessory.

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