marthoc / GarHAge

a Home-Automation-friendly ESP8266-based MQTT Garage Door Controller
MIT License
170 stars 42 forks source link

Incorporate limit switches into relay/motor code #20

Open danland6 opened 6 years ago

danland6 commented 6 years ago

just wondering how hard it would be for you to modifiy the main ino code so that

essentially when you send the Open payload

and when sending closed Paylod

Essentially i've built a gate that i am trying to automate for my chicken coup, using an old power window regulator/motor for lift, and a gravity latch that after all the tension is removed from the lift cable locks into a slot on one of the side rails, (which is why it would be good to have a slight overrun on close)

I have it all wired up on the bench with 2 relays (for motor reversal), and the 2 limit switches and have the buttons on my home assistant set up for testing, relay up, relay down, and status via one of the limits works fine as expected (i have used your code for my roller door, and front electric gate, and 2 side doors of my shed working great)

So far from all of my searching and lack of ardunio sketch skills i have not been able to figure out how to make these features work myself yet.

let me know if its something that you'd be keen to do, and if any of my information was not clear enough.

Thanks Dan

marthoc commented 6 years ago

Hmm. I think this could be done fairly easily but it’s not really within the scope of the GarHAge project since I can’t see an application for this in the garage door opener space. Still, I’m interested in helping you to get it to work (I just don’t think that I would incorporate it into the code base of the project even if we get it working).

Tomorrow I was planning to release a new version of the project that has a bunch of new features and moves the codebase forward. Once that’s done, I can turn my thoughts to your project.

So let me get this straight:

  1. When the OPEN command is received, rather than momentarily activating the relay, activate the "open" relay until D5 goes low.
  2. When the CLOSE command is received, rather than momentarily activating the relay, activate the "close" relay until D6 goes low (potentially plus an offset).
danland6 commented 6 years ago

Hey Mark, Thanks for the reply, yep makes sense that mostly everyone will not need this feature for their garage doors!

Awesome that you are keen to help get it working, thanks already, also keen to see what new features you've added to the existing setup.

And yes you've got it straight, i think the slight offset will be needed on the close for sure, i will take a few pictures of my gate and post them up somewhere, unless i can maybe mount one of the magnets to part of the gravity locking mechanism so that it does not need to over run slightly, which "may" be possible,

Thanks Dan

danland6 commented 6 years ago

turns out its as easy as drag and drop, picture quality not amazing due to smashed lens on my phone camera but shows what i'm working with.

20180428_125238 medium 20180428_125246 medium 20180428_125304 medium 20180428_125316 medium 20180428_125323 medium

marthoc commented 6 years ago

Quick question before I go too far: what microcontroller are you using? NodeMCU? Need to know how many GPIO I’m dealing with.

danland6 commented 6 years ago

Hey there, yep I'm Using the nodeMCU Cheers Dan

danland6 commented 6 years ago

Hey, i know its not high on your list but just checking in to see if you had any luck at all? Cheers Dan

PaulHam211 commented 5 years ago

This would be great, just what I am looking for too.