Joshua
Junior Member
Posts: 75
|
Post by Joshua on Aug 28, 2018 14:06:27 GMT
Garage Node:Are there notes on this node? I understand the concept, but there seems to be a problem. The readout of the pin is nonstop and publishes persistently when the reed switches are closed. i.e. "11" will publish nonstop as long as d6 is grounded. Should there be 2 GDOOR actions? One starting at line 2337 and the other starting at line 2756
// #define GDOOR // reeds on d6 & d7, connected to 3.3v via arduino pull up, closed = gnded, LOW, ON
Here's my assumption on how this is configured: REED 1 (d6) = reed located in closed position REED 2 (d7) = reed located in open position | open = pullup closed = grounded |
I'm missing the published integer
Status | Reed Switch
| Published Integer
| Garage closed
| REED 1 = closed REED 2 = open
| ??
|
Status | Reed Switch
| Published Integer
| Garage opening (previously closed)
| REED 1 = open REED 2 = open
| ??
|
Status | Reed Switch
| Published Integer
| Garage Open
| REED 1 = open REED 2 = closed
| ??
|
Status | Reed Switch
| Published Integer
| Garage closing (previously open)
| REED 1 = open REED 2 = open
| ??
|
|
|
|
Post by papa on Aug 28, 2018 17:32:31 GMT
Joshua, you were right to post on brump's thread to get more about the dimmer. He's the expert on that.
This post gives links to several of the possible builds. (Some build threads have more information than others & some are more up to date than others)
As the index of possible builds indicates, the Garage nodes are contained in this thread.
Within that Garage node thread, this post begins my notes on the garage door monitor that uses two reed switches.
|
|
Joshua
Junior Member
Posts: 75
|
Post by Joshua on Aug 28, 2018 17:40:47 GMT
What's going on with the repeating status of GDOOR? Is there an error in the code or a reason to keep publishing the status?
|
|
|
Post by papa on Aug 28, 2018 17:47:07 GMT
Give me some time to look at this & think about it after a long time away from it. I use the other approach to monitoring the garage: one reed switch at the bottom that signals that the door is totally closed or otherwise open. In the meantime, read my notes starting with this post. >> homeautomation.proboards.com/post/1444/thread
|
|
Joshua
Junior Member
Posts: 75
|
Post by Joshua on Aug 28, 2018 17:51:15 GMT
Ok. I'll record a video of what's happening as well.
|
|
|
Post by papa on Aug 28, 2018 20:51:59 GMT
Why does the GDOOR status continually repeat (on the Serial Monitor)? Probably because you are leaving one or both of the reed switches (or a substitute) closed (that's when a status update is sent). On each side of my garage door near the bottom is a pin that anchors the cable which lifts the door. On one of those pins, I put a strong magnet. (Somehow find a way to install a strong magnet near the bottom outside edge of your garage door.) Mount the reed switches near, but just off of the side of the garage door that has the magnet. Mount one reed switch (attached to D6) a little above where the magnet will be when the door is at the very bottom. Mount the D7 reed switch a little above when the magnet will be when the door is at the very top. Mount the reed switches as the magnet passes near enough to close the switch, but not so near that the magnet rubs or bumps the reed switch.
If you just want to simulate the node ... wire the reed switches to D6 & GND & to D7 & GND. Briefly move a magnet past each reed switch, perhaps D6 then D7 & D7 then D6.
As I said in the Garage Node thread, How this works & a possible tweak: Find several lines that start with #ifdef GDOOR if(digitalRead(REED1) == LOW) { They monitor status of reed switches attached to D6 & D7. They create a two digit code where "1" stands for D6's reed switch & "2" stands for D7's reed switch. In the code, the unit's digit is the most recent reed switch closed & the ten's digit is the reed closed just before that. The code "12" means "passed '1' then '2' " or "OPEN." In that section, two instances of delay(100) may need tweaking to match better the timing of when your garage door passes the two reed switches. The code tracks the order of when each reed switch closes as the magnet passes. Each reed switch should only close briefly as the magnet passes.
|
|
Joshua
Junior Member
Posts: 75
|
Post by Joshua on Aug 29, 2018 13:39:11 GMT
Thanks Papa..
I settled for
#define SWITCH2 // switch (reed?) on d6 connected to 3.3v via arduino pull up, closed = gnded, LOW, ON #define SWITCH3 // switch on d7 connected to 3.3v via arduino pull up, closed = gnded, LOW, ON
by scoping some rules on the readout
SWITCH2 = ON = Closed SWITCH2 = OFF = Opening
SWITCH3 = ON = Open SWITCH3 = OFF = Closing
I'll provide the sketch detail in my build post. After the build post, I'll share my conversion from openhab to Node Red. I have quite a bit of cool rules from openhab to share with the forum.
I need to get better at reading the posts and saving your time with answers to my questions. Thanks again.
|
|
|
Post by papa on Aug 29, 2018 16:25:04 GMT
Glad your gaining some helpful understanding & results, Joshua.
Joshua: "I settled for #define SWITCH2 // switch (reed?) on d6 connected to 3.3v via arduino pull up, closed = gnded, LOW, ON #define SWITCH3 // switch on d7 connected to 3.3v via arduino pull up, closed = gnded, LOW, ON "
papa: Yes, the #define GDOOR is meant to include defining SWITCH2 & SWITCH3 AND create a combined status to track current status of both switches & the next to last status of both switches. This combined status helps to indicate where the garage door would be on its travel.
Joshua: "by scoping some rules on the readout" papa: Do you mean you wrote some rules to translate the data sent or do you mean "by scoping some patterns on the Serial Monitor readout" OR ...?
Joshua: "SWITCH2 = ON = Closed SWITCH2 = OFF = Opening SWITCH3 = ON = Open SWITCH3 = OFF = Closing"
papa: Hmmm, ^^ I believe this interpretation of switch results depends on some things: 1) Via the sketch code, SWITCH2 & SWITCH3 have pullup resistors. So ... when the switches are open, they read ON or 1 or HIGH or true. When closed (& connecting to GND), they read OFF or 0 or LOW or false. This is admittedly counter intuitive & confusing, but it saves having to put a physical resistor on D6 & D7 to give them a stable reading. 2) Locations of the magnet & the reed switches also affect results. As I tried to describe these locations, I only wanted the magnet to pass the reed switches & only accidentally stop at a switch (& close it to 0).
Joshua: "I'll provide the sketch detail in my build post. After the build post, I'll share my conversion from openhab to Node Red. I have quite a bit of cool rules from openhab to share with the forum. " papa: I look forward to more of your contributions.
|
|