|
Post by papa on May 5, 2016 15:53:03 GMT
This thread's methods can be used to monitor the status of doors & windows.
First, Two Garage End Nodes: 1) Garage Door Opener 2) Temp/Humidity Sensor, Reed Switch(es) Detect if the Garage's Vehicle Door opened or closed, & another switch detects if a People Entrance door is dead-bolted or not Updated, Feb. 26, 2019
Via OpenHAB Classic UI on a browser or smart phone app,
One node can open or close the garage vehicle door Another node can report temp, humidity, & status of the two garage doors (vehicle & people). Each using an RFM69Hx radio, these nodes communicate wirelessly with a computourist Gateway node, which then passes data on to a computer running OpenHAB & Mosquitto (MQTT). These nodes work with computourist Gateway versions 2.4 -2.5.2. These nodes use the sketch originally featured in my thread One Sketch Generates Many Node Functions & serve as examples of using the current version of that sketch. You may download the choose_nodes sketch here & achieve initial customization. << This link points to the latest sketch version.See below for ADDED customizing of that sketch. Important: Be sure your computer's Arduino IDE has the additional code libraries that the Gateway AND End Node sketch programs need & in the right locations. See this post about downloading, editing, & installing libraries. In the choose_nodes sketch, near the line that includes each library, is a link for obtaining the library.
|
|
|
Post by papa on May 5, 2016 16:26:42 GMT
Garage's Vehicle Door Opener Node (Hardware)
This node has only one function, opening & closing the door. Its assembly is comparitively limited, not requiring a shield besides the Arduino compatible. Frankly, using an Arduino digital pin to trigger the solid state relay (SSR) seemed to cause glitches in other functions I tried on the node (current limitations?). I've since used another method to trigger an SSR, but have not tried it on this node to try adding other functions. Important assembly notes to supplement the schematic below: You must use an Arduino compatible that can use 3.3 volts throughout most of it, including the digital pins. (On eBay, I buy Buono Uno Arduino compatibles which can be switched to 3.3 volt mode.) Five volts can damage the RFM69 radio you'll be using. This node also uses a DC to DC solid state relay (not the more common DC to AC unit). Similar to the garage door's wall button, triggering the relay closed allows 12 volts DC to pulse the garage door opener control board for opening, closing, or stopping door movement (depending on what it did last). << Simplified Schematic, Garage's Vehicle Door Opener Node ^^ Click on pic for larger view For building & programming a Gateway node, follow this thread. << Link updated Dec. 6, 2018. Hints: Remember that on a Gateway Node, the RFM69's NSS goes to Arduino D8, but on an end node, RFM69's NSS goes to Arduino D10. Via a multi-meter, continuity test your soldered connections to make sure you achieved the right connections (schematic) & avoided the wrong connections.
|
|
|
Post by papa on May 5, 2016 18:10:25 GMT
Garage's Vehicle Door Opener Node (Software) Updated Dec. 8, 2018
& (Using the Arduino IDE...) follow the basic sketch customization soon after where the download is provided. In addition to the basic sketch customization ...
UNcomment one line so it reads #define GOPENER (delete any // at the start of the line) With Arduino IDE running on a computer & the Garage Door Opener Node connected via USB, upload the sketch program to the node. Then with the node still on USB, the Gateway successfully running connected to your Ethernet network & the IDE serial monitor running at 115200 baud, the serial monitor (in DEBUG mode) will display connection & data info about the node.
|
|
|
Post by papa on May 5, 2016 18:42:38 GMT
For ALL end nodes to work, you need OpenHAB, a MQTT Binding, & a MQTT message broker running on a computer connected to your local Ethernet Network
Updated March 6, 2019
See also my thread on installing OpenHAB 2.5.0.M1, the MQTT Binding 2.xx, & the embedded MQTT message broker.
|
|
|
Post by papa on May 5, 2016 18:57:33 GMT
OpenHAB configurations needed for the Garage Door Opener Node (updated Feb. 28, 2019):
OpenHAB uses entries in PaperUI & in config files (items, rules, & sitemap) & icon files to communicate with & display data from end nodes. (Presupposes NODEID is 98. In the following, replace 98 with any other NODEID you assign.)
In PaperUI, Configure a Generic MQTT Thing using the following fields: Name Node98 << This is the RFM69 Node to be accessed. Thing ID [ randomly generated ?? ] Location Garage [Thing's location on which tab of PaperUI\Control ] Bridge Selection MQTT Broker - mqtt:systemBroker:embedded-mqtt-broker ----------------------------
Go to PaperUI\Configuration\Things\Node98 To Add a Channel, Click on the "+" in a blue disc beside "Channels"
In the Add Channel Window, fill the fields: Channel type On/Off switch < choose type according to the item data type we want Channel id Node98Channel16 < arbitrary ? as long as we match in a linked item later Label Node98_Switch < arbitrary ? MQTT State Topic home/rfm_gw/nb/node98/dev16 Command Topic home/rfm_gw/sb/node98/dev16
Add another Channel, fill the fields: Channel type Text Value < choose type according to the item data type we want Channel id Node98Channel02 < arbitrary ? as long as we match in a linked item later Label Node98_RSSI < arbitrary ? MQTT State Topic home/rfm_gw/nb/node98/dev02
.items file entries (2 so far): Switch Act_Node98 <PushBtn> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node98Channel16" } String Node98Rssi "Grg_Open_98_RSSI (db)[%s]" <network> (Nodes) { channel="mqtt:embedded-mqtt-broker:topic:mything:Node98Channel02" }
Note: String Node98Rssi... gets the radio signal strength between this node & the Gateway.
Important: At PaperUI\Configuration\Things\Node98, link the two above channels to the two above items.
icon files (to display on UI): PushBtn.svg (5.3 KB) << Save as PushBtn.svg to the C:\openHAB2\conf\icons\classic folder
sitemap file entries (3 so far): sitemap My label="My House" [If you have a similar line, keep it.] Group item=Nodes label="__Node Health__" icon="nodes"
Switch item=Act_Node98 label="Gdoor98_Opener" OR use Switch item=Act_Node98 label="Gdoor98_Opener" mappings=[ON="Click"]
Note: On a browser-shown Classic UI, sitemap entries display the items info. The first switch item option displays a toggle switch that is automatically cleared to off. The second switch item option displays "CLICK" which can be clicked to activate the garage door opener node's relay. rules file entries (none for this node)
|
|
|
Post by papa on May 5, 2016 20:11:52 GMT
Second Garage Node (Hardware): Temp/Humidity Sensor, Reed Switch Detects if the Garage's Vehicle Door opened or closed. Another switch detects if Garage's People Entrance is dead-bolted or not
(As with the first garage node above,) important assembly note to supplement the schematic below: You must use an Arduino compatible that can use 3.3 volts throughout most of it, including the digital pins. << Schematic for Garage Node 2, updated 3/31/2017 ^^ Click on pic for larger view. More key assembly notes: since this node requires multiple connections to digital pins and 3.3 volts, I recommend that on top the Arduino compatible, you insert a shield hacked for this purpose. To build the shield, see this Sep 19, 2015 post about building a 3.3 volt friendly Arduino shield. You can get more help for building this node with Oct 10-16 posts, starting here. Except for this node, omit the steps about the push button AND omit the solid state relay powered by the transistor. On the adapted shield, just install the DHT11 sensor & the RFM69 radio. Also omit any resistors connected to the switches or DHT sensor. Sketch software provides those pull-ups. As a schematic note says, just wire the switches you need starting with D5. The following assumes that switch connected to D6 will monitor a people door's deadbolt AND a D6 D5 (reed) switch will monitor if the garage car door is closed or open. I.E. at this point, you don't need the D7 switch. ( Later posts will describe monitoring the garage car door with a D6 reed switch AND D7 reed switch). ( D6 D5 corrected on Nov. 25, 2018. ) Hint: Via a multimeter, continuity test your soldered connections to make sure you achieved the right connections (schematic) & avoided the wrong connections. Insert the completed shield on top the Arduino compatible. Match the shield's analog pins with the Arduino compatible's analog sockets & digital pins with digital sockets.
|
|
|
Post by papa on May 5, 2016 21:51:46 GMT
Second Garage Node (Hardware, part 2): Installing the Deadbolt Sensor & the Car Door Reed Switch
This method senses when a garage's vehicle door is TOTALLY closed or (even partly) open & when a people door's deadbolt is closed or open. For installing the switch sensors, besides the schematic above, see the following diagram & picture: << click on pic for larger view, updated 3/31/2017 << click on pic for larger view, updated 3/31/2017 ^^ Looking into the dead bolt receiving hole Sensing the status of the vehicle entrance door. When the vehicle entrance door is closed, a strong disc magnet is on a cable pin near the bottom. Mounted on the door frame directly across from the magnet is a (normally open) reed switch (near, but not touching the magnet). A magnet near the reed switch closes the switch, connecting Arduino D6 to GND D5 to 3.3 volts, making the pin HIGH LOW & helps signal OpenHAB that the door is totally closed. When the magnet & door bottom are away from the reed switch, the 10K ohm resistor holds Arduino D5 LOW an Arduino software pull-up holds Arduino D6 HIGH, indicating the door is at least partly open. << updated & simplified, 3/31/2017.Sensing the status of the people entrance door. My people door dead bolt is metal. With steel wool, I polished the end for best conductivity. Across the bottom of the dead bolt receiving hole, I installed two bared ends of 24 gauge insulated wire so the bottom of the hole was divided into horizontal (unequal) thirds. Using a 16 finishing nail as a drill bit, I drilled two holes that went about level from the drywall right next to the door frame to the inside edge of the end of the dead bolt hole. Level & opposite to the first two holes, I made two more tiny holes to hold tightly the end of the bared wires. The insulated part of each wire goes through from the dead bolt hole to the side of the door frame & to its Arduino connection. The bared part of each wire (with separation between wires) goes across the (padded?) bottom of the dead bolt hole & is anchored in its tight hole. As I did, you may have to put folded cardboard (or other insulating material) under both bared wires so a fully extended dead bolt touches them. Thread the longer insulated parts of the wires through the side of the dead bolt hole toward the Arduino. There one bared end goes to Arduino GND & the other bared end to Arduino d6 D5. As necessary, conceal the wires next to or beneath door trim pieces. When the people door is NOT dead bolted, the 10K resistor (also connected to GND) holds Arduino D6 LOW an Arduino software pull-up holds D5 HIGH. When the dead bolt fully extends & touches the two bare wires, it functionally closes a switch, connecting D6 to 3.3 volts & making it HIGH connecting D5 to GND & making it LOW. The node sends this data to OpenHAB via the Gateway. << updated & simplified, 3/31/2017.
|
|
|
Post by papa on May 5, 2016 22:46:21 GMT
Second Garage Node (Software) Updated Feb. 28, 2019
Added customizing:
If you want to use the optional DHT11 (humidity & temperature sensor ... find & UNcomment the line with #define HT ... (no "//" at its start) AND also UNcomment either FAHR or CELS for the temperature scale. Find & make sure #define GOPENER is commented (// at start of line) UNcomment #define SWITCH1UNcomment #define SWITCH2#define NODEID 05 << change 05 to a unique number in your RFM69 network (For this node, I suggest you use NODEID 99 as I will below.)
#define DEBUG << make sure this line is UNcommented (no // at the start)
With Arduino IDE running on a computer & the Second Garage Node connected via USB, upload the sketch program to the node. Then with the node still on USB, the Gateway successfully running connected to your Ethernet network & the IDE serial monitor running at 115200 baud, the serial monitor (in DEBUG mode) should display connection & data info about the node.
|
|
|
Post by papa on May 5, 2016 22:54:54 GMT
OpenHAB config files needed for the Garage Node Sensing Doors' Status: Feb. 26 & Dec. 24 & Dec 27, 2019, Updated for OpenHAB 2.5.0.M1 & MQTT Binding 2.xx
(Presupposes NODEID is 99. In the following, replace 99 with the NODEID you assign) In PaperUI, Configure a Generic MQTT Thing using the following fields: Name Node99 << This is the RFM69 Node to be accessed. Thing ID [ randomly generated ?? ] Location Garage [Thing's location on which tab of PaperUI\Control ] Bridge Selection MQTT Broker - mqtt:systemBroker:embedded-mqtt-broker ----------------------------
IF using a DHT11 sensor, to Add Channels to the Node99 Thing, fill the fields: Channel type Text Value < choose type according to the item data type we want Channel id Node99Channel48 < arbitrary ? as long as we match in a linked item later Label Node99_DHTtemp < arbitrary, but useful to us MQTT State Topic home/rfm_gw/nb/node99/dev48
Channel type Text Value < choose type according to the item data type we want Channel id Node99Channel49 < arbitrary ? as long as we match in a linked item later Label Node99_DHThumidity < arbitrary, but useful to us MQTT State Topic home/rfm_gw/nb/node99/dev49
// IF using the DHT11 sensor, add two items (OpenHAB 2's \conf\items folder)
Number Temperature_Node99 "Temp_Grg99 [%.1f °F]" <temperature> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node99Channel48" } Number Humidity_Node99 "Humidity_Grg99 [%d %%]" <humidity> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node99Channel49" } ------------------------------
Add Node99 Channel for RSSI (Radio Signal Strength): Channel type Text Value < choose type according to the item data type we want Channel id Node99Channel02 < arbitrary ? as long as we match in a linked item later Label Node99_RSSI < arbitrary, but useful to us MQTT State Topic home/rfm_gw/nb/node99/dev02 ---------------------------------
Add Channels for States of the Doors:
Channel type Open/Close contact < choose type according to the item data type we want Channel type Text Value [ using contact type did not work with openHAB 2.5, item updated below ]
Channel id Node99Channel43 < arbitrary ? as long as we match in a linked item later Label Node99_GpplDr < arbitrary, but useful to us MQTT State Topic home/rfm_gw/nb/node99/dev43 updated Dec. 27, 2019:
When figuring this channel, click "Show More" & at Transform values/Incoming value transformations, enter MAP:door.map
Channel type Open/Close contact < choose type according to the item data type we want
Channel type Text Value [ using contact type did not work with openHAB 2.5, item updated below ]
Channel id Node99Channel44 < arbitrary ? as long as we match in a linked item later Label Node99_GcarDr < arbitrary, but useful to us MQTT State Topic home/rfm_gw/nb/node99/dev44 at Transform values/Incoming value transformations, enter MAP:door.map
--------------------------------------------------
In openHAB's \conf\transform\ folder create a door.map file with the contents: ON=CLOSED OFF=OPEN
---------------------------------------------------
Add to items file entries in OpenHAB 2's \conf\items folder: String Node99Rssi "Gdoor_99 RSSI (db) [%s]" <network> (Nodes) { channel="mqtt:embedded-mqtt-broker:topic:mything:Node99Channel02" }
Contact gPplDr99 "gPpl Dr_99 [%s]" <lock> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node99Channel43" } String gPplDr99 "gPpl Dr_99 [%s]" <lock> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node99Channel43" }
Contact gCarDr99 "gCarDr_99 [%s]" <gdoor> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node99Channel44" }
String gCarDr99 "gCarDr_99 [%s]" <gdoor> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node99Channel44" }
Note: The above two contact Text/String items will gather the status of the Vehicle Door & the People Door & via an icon & "OPEN" or "CLOSED, report it on the Classic UI (user interface) displayed on a browser.
// Add to sitemap file entries in OpenHAB 2's \conf\sitemaps folder: Text item=gPplDr99 Text item=gCarDr99
// Add two lines to sitemap file IF using the DHT11 sensor Text item=Temperature_Node99 Text item=Humidity_Node99 --------------------------------------------
Important: Using PaperUI, link each channel to its matching item.
--------------------------------------------
// Add nothing to rules file entries
// In OpenHAB 2's C:\openHAB2\conf\icons\classic folder,
add to icon files (save them each twice using the two names under each icon)
Warning: In some versions of OpenHAB 2, custom icons like these ^^ may take a long time to display reliably on a user interface. Icons that install with OpenHAB2 seem to display sooner. See this site for possibilities. Hover over the images to see the file names represented. At that site, under "Things" you can see an image labelled "garagedoor" Hover the mouse pointer over that image & see a list of related files, including garagedoor-open & garagedoor-closed. To use the installed icon, edit the gCarDr99 item above: Change <gdoor> to <garagedoor>.
Update, Feb. 26, 2019: custom icons seem to work better with OpenHAB 2.5.0.M1 than with earlier versions.
|
|
|
Post by papa on May 6, 2016 18:41:27 GMT
Update, 3/31/2017: Performance issues: A bare reed switch (glass bulb with wire leads) is fragile & tends to fail early due to installation trauma. A plastic encased reed switch mostly held closed with a magnet worked perfectly for 15 months. Then on some days it would report the garage door open for several hours (when the door was closed) before reverting to the correct closed status. I assume for window security, a normally open reed switch is held closed by a magnet until the window is opened. This is similar to how I'm using the reed switch. However, my magnet is probably much stronger than what is used for a window. Update 4/11/2017: On 3/31, I was at a different location & could not see what was happening. When I arrived at the garage door's location, I discovered the magnet was lost. I replaced the magnet & glued it in place. So far this sensor is now working reliably. Below, starting in this post, I document "Two Normally Open Reed Switches Monitor a Garage Door." Since that method will only briefly close the reed switches as a magnet passes them, it provides an alternative to the magnet holding the reed switch mostly closed. ======================================== The original May 6, 2016 post: I called these "Garage Nodes." However, the second "Garage" Node with the reed & other switch could be used in other locations. At other doors or windows, the reed could sense when something is closed & the other switch could detect when a dead bolt is locked or not. I've used the dead bolt sensing node at other locations in my home. The following posts document those.
|
|
|
Post by papa on May 12, 2016 21:16:54 GMT
A Simplified Construction Node for Sensing a Door's Dead Bolt Status (Hardware) Updated 3/31/2017
This node will only detect if a door's dead bolt is locked or not. Important assembly notes to supplement the schematic below: You must use an Arduino compatible that can use 3.3 volts throughout most of it, including the digital pins. (On eBay, I buy Buono Uno Arduino compatibles which can be switched to 3.3 volt mode.) Five volts can damage the RFM69 radio you'll be using. You also need two lengths of wire that can reach across the bottom of the dead bolt hole to the Arduino & have enough you can place the wire out of sight as much as possible. << Schematic (click on pic for larger view), updated 3/31/2017Like the schematic in this May 5, 2016 post above, this post's schematic follows the somewhat simplified approach. Each of the 3 switches can be a dead bolt switch/sensor OR a magnet-closing reed switch. Start with SWITCH1 on D5 for one dead bolt senor or reed switch. In this Oct 10, 2015 post, the section Prepare a RFM69 Wireless transceiver... might help. Hint: Via a multimeter, continuity test your soldered connections to make sure you achieve the right connections (schematic) & avoid the wrong connections. If you use the optional DHT11 sensor & more than one switch, you'll need a 3.3 volt friendly shield on top the Arduino. As pictured below, if you omit the optional DHT11 sensor & use only one switch (on D5), you can simply construct this node on a 3.3 volt Arduino without a shield. The Arduino has enough sockets to receive the RFM69 connections plus a d5 socket & a spare GND socket to receive the wire for SWITCH1 (reed switch or bare ends of the wires "closed" by the dead bolt). Switch1's pull up resistor is software-implemented in the Arduino sketch program. << Click the pic for larger view ^^ Assembled Dead Bolt Sensing Node. The gray loop of wire across the right side from Arduino D5 to GND represents the completed circuit when the dead bolt touches both bared wires that lead to those Arduino connections & closes the "switch."
|
|
|
Post by papa on May 12, 2016 21:47:42 GMT
Dead Bolt Sensing Node (Hardware, part 2): Installing the SWITCH1 sensor Updated 3/31/2017
I want to sense when a people entrance door is dead-bolted or not. For installing the SWITCH1 sensor (D5), besides the schematic above, see the following diagram: << click on pic for larger view, updated 3/31/2017 << click on pic for larger view, updated 3/31/2017 ^^ Looking into the dead bolt receiving hole Sensing the status of the people entrance door: My door's dead bolt is metal. With a file & steel wool, I polish the end for best conductivity. Across the bottom of the dead bolt receiving hole, I installed two bared ends of 24 gauge insulated wire so the bottom of the hole was divided into horizontal or vertical (unequal) thirds. As I did, you may have to put folded cardboard (or other insulating material, like a piece of synthetic wine bottle cork) under both bared wires so a fully extended dead bolt touches them. I anchor the cut wire ends in something, like small holes drilled on one side of the dead bolt bottom hole or one side of the wine bottle cork. The bared part of each wire (with separation between wires) goes across the (padded?) bottom of the dead bolt hole. Thread the longer insulated parts of the wires through the side of the dead bolt hole toward the Arduino. There one bared end goes to Arduino GND & the other bared end to Arduino d6. As necessary, conceal the wires next to or beneath door trim pieces. When the people door is NOT dead bolted, the internal Arduino pull-up resistor holds Arduino D6 D5 HIGH. When the dead bolt fully extends & touches the two bare wires, it functionally closes a switch, connecting D6 D5 to GND & making it LOW. The node sends this data to OpenHAB via the Gateway. Continued below is the necessary customization of the Arduino sketch program & the needed OpenHAB config files entries.
|
|
|
Post by papa on May 13, 2016 20:10:16 GMT
Dead Bolt Sensing Node (Software), updated Feb. 26, 2019
To the node, upload the latest choose_nodes sketch with different customizing: If you want to use the optional DHT11 (humidity & temperature sensor ... make sure you UNcomment one line so it reads #define HT ... (no "//") AND also UNcomment either FAHR or CELS for the temperature scale. Make sure another line is commented out, i.e. as // #define GOPENER UNcomment #define SWITCH1 Use a NODEID unique to your system. I'll assume 89 in the following. At #define ENCRYPTKEY, change "xxxx..." to YOUR 16 character key used on ALL your nodes (& Gateway). UNcomment one line with #define FREQUENCY according to the frequency of your RFM69 radio. Comment the other two lines. UNcomment #define IS_RFM69HW ONLY IF your RFM69 radio has "H" (high power) in its part #. Note: If you UNcomment #define DEBUG, the Arduino serial monitor can use 115200 baud (#define SERIAL_BAUD ) to display node debugging output. With Arduino IDE running on a computer & the Dead Bolt Sensing Node connected via USB, upload the sketch program to the node. Then with the node still on USB, the Gateway successfully running connected to your Ethernet network & the IDE serial monitor running at 115200 baud, the serial monitor (in DEBUG mode) should display connection & data info about the node.
|
|
|
Post by papa on May 13, 2016 20:21:55 GMT
OpenHAB config files needed for the Dead Bolt Sensing Node: (Updated Feb. 26 & Dec. 27 & Dec. 28, 2019 for OpenHAB 2.5.0.M1 & MQTT Binding 2.xx)
(Presupposes NODEID is 89. In the following, replace 89 with the NODEID you assign)
Add to items file entries: String Node99Rssi "Door_89_RSSI (db) [%s]" <network> (Nodes) { channel="mqtt:embedded-mqtt-broker:topic:mything:Node89Channel02" }
Contact Door89 "gPpl Dr_89 [%s]" <lock> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node89Channel43" }
String Door89 "gPpl Dr_89 [%s]" <lock> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node89Channel43" }
Important: Using PaperUI, link each channel to its matching item.
Add to sitemap file entries: Text item=Door89 Add nothing to rules file entries Add nothing to the icon files (openHAB installation includes lock icons)
Note: The above contact Text/String item AND the transformation applied in Channel43 will gather the status of the People Door. Via a lock icon & "OPEN" or "CLOSED", the door status will be reported on a user interface displayed on a browser.
|
|
|
Post by papa on May 13, 2016 20:28:56 GMT
Once nodes & OpenHAB (& its configuration files) are working, have your browser display the Classic UI by entering the address http://localhost:8080/openhab.app?sitemap=My# Or view / control your DIY home automation network via your smart phone: See this Oct 17, 2015 post.
|
|
|
Post by papa on May 14, 2016 12:36:57 GMT
Two Normally Open Reed Switches Monitor a Garage Door (this post recycled on March 31, 2017) << Garage Node connections, one dead bolt sensor, two reed switches to indicate garage door status << Garage Node connections, Schematic To build this node (especially if you install the optional DHT11 sensor), you'll need a 3.3 volt friendly shield on top the Arduino. On the shield, you'll need one or two of its extra GND sockets & one or two of its extra 3.3 volt sockets. To build this 3.3 volt friendly shield adapt the instructions coordinated by this post. Once the shield is built, you'll follow the schematic just above to connect D5, D6, & D7 rather than D8 & D9 in the other post's schematic.
Added, Aug. 28, 2018: On each side of my garage door near the bottom is a steel 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.
|
|
|
Post by papa on May 31, 2016 19:25:39 GMT
Two Normally Open Reed Switches Monitor a Garage Door Software (this post updated on Aug. 28 & Aug. 29, 2018 & Feb. 26, 2019)
again adding different customizing: UNcomment the correct line so it reads #define SWITCH1 (no starting //) UNcomment a line so it reads #define GDOOR (no starting //)
Make sure the other options (FAHR, etc) are commented out (start them with //)
At #define NODEID use a node number unique to your system. I'll assume 99 in the following. 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. With Arduino IDE running on a computer & the Two Reed Garage Node connected via USB, upload the sketch program to the node. Then with the node still on USB, the Gateway successfully running connected to your Ethernet network & the IDE serial monitor running at 115200 baud, the serial monitor (in DEBUG mode) should display connection & data info about the node.
Preparing to use this node with OpenHAB 2, download these added icons & save them into OpenHAB 2's \conf\icons\classic folder:
|
|
|
Post by papa on Apr 1, 2017 20:30:21 GMT
Two Normally Open Reed Switches Monitor a Garage Door OpenHAB Entries Mostly updated for OpenHAB2.5.0.M1 & MQTT 2.xx Binding on Feb. 26, 2019. (Completes a Node Version Begun in This Post.)
As in this post, have a Node99 Thing with a Channel43. Updated Dec. 24, 2019 Add a Channel68 (GdoorStatus)
Edit your config files to include these entries (you may have some from before). // .items file Updated Dec. 24, 2019Contact gPplDr99 "gPpl Dr_99 [%s]" <lock> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node99Channel43" }
String gPplDr99 "gPpl Dr_99 [%s]" <lock> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node99Channel43" }
Number gReeds_99 "Gdoor99 Status [SCALE(GdoorLvl.scale):%s]" <gdoor> { channel="mqtt:embedded-mqtt-broker:topic:mything:Node99Channel68" }
Important: Using PaperUI, link each channel to its matching item.
// My.sitemap file: Text item=gPplDr99 Text item=gReeds_99 // Add nothing to My.rules file // icons // Download jimkernsjr's zip file of icons & unzip them to OpenHAB 2's \conf\icons\classic folder:
// Download these added icons & save them into OpenHAB 2's \conf\icons\classic folder: // Download these added icons in the post just above: Gdoor-11.svg Gdoor-22.svg In OpenHAB2's \conf\transform folder: ( updated for OpenHAB2 on Aug. 28, 2018) create a file named GdoorLvl.scale whose contents are: [0..0]=Initial [1..1]=Initial [11..11]=OPENING [12..12]=OPEN [22..22]=CLOSING [21..21]=CLOSED See this post about displaying the User Interface on your browser or smart phone. Via dynamic icons ( when 2 need icons are updated), the User Interface shows the garage door progressively opening & closing. For more about using Dynamic Icons, see this thread.
|
|
|
Post by papa on Apr 11, 2017 19:40:37 GMT
Update 4/11/2017 on using only one reed switch to sense a garage door's status: On March 31, 2017, when I reported performance issues in this post, I was at a different location & could only see the User Interface & not what was happening on site. When I arrived at the garage door's location, I discovered the magnet was lost. I replaced the magnet & glued it in place. So far this one reed switch sensor is now working reliably.
As of Jan. 6, 2019, this reed switch sensor continued to work reliably.
|
|
|
Post by papa on Nov 8, 2018 21:17:33 GMT
Garage Vehicle Door Opener Node Updated AboveIn responding to some issues & a tip that ngy had, I just updated the Garage's Vehicle Door Opener Node posts that start here. Updates include: the latest multi-choice end node sketch which better clears a User Interface toggle switch, a better OpenHAB switch item, an alternate sitemap entry that provides a clickable button, & an .svg icon for OpenHAB 2 purposes.
|
|
|
Post by papa on Nov 21, 2018 19:24:12 GMT
Garage Vehicle Door Opener Node Updated AgainIn responding to more issues that ngy had, I just updated this post above. The main update provides the .svg icons that OpenHAB 2 uses by default as opposed to the . png icons used by OpenHAB 1.xx. Other updates provide the locations of OpenHAB 2 folders that hold configuration files.
|
|
|
Post by papa on Feb 26, 2019 21:13:41 GMT
On Feb. 26 & Feb. 28, 2019,
the above thread was UPDATED for OpenHAB 2.5.0.M1,
the embedded MQTT broker,
& the MQTT 2.xx Binding.
|
|
ngy
Junior Member
Posts: 58
|
Post by ngy on Dec 24, 2019 17:43:19 GMT
Hi papa,
After upgrading to OpenHAB 2.5, and following your steps, I've run into the following issue:
Command 'ON' not supported by type 'OpenCloseValue': No enum constant org.eclipse.smarthome.core.library.types.OpenClosedType.ON
The garage door status in BasicUI displays a blank, and nothing is reported. When I change the contact definition in the items file to a string, BasicUI displays displays 'ON'.
Thanks for your help in advance, and Merry Christmas!
|
|
|
Post by papa on Dec 24, 2019 19:36:30 GMT
Needed Changes in openHAB Configurations
Greetings & thanks, ngy, for drawing attention to this. An Open/Close contact channel & a contact item had worked with earlier N openHAB version, but did not seem to adapt well for openHAB 2.5.0. I had discovered the problem earlier & applied a fix using a Text value channel type, but I neglected to document that until now. My apology.
With those changes, these nodes continue to work just fine with a recent version of openHAB.
|
|
ngy
Junior Member
Posts: 58
|
Post by ngy on Dec 25, 2019 1:59:25 GMT
Needed Changes in openHAB Configurations
Greetings & thanks, ngy, for drawing attention to this. An Open/Close contact channel & a contact item had worked with earlier N openHAB version, but did not seem to adapt well for openHAB 2.5.0. I had discovered the problem earlier & applied a fix using a Text value channel type, but I neglected to document that until now. My apology.
With those changes, these nodes continue to work just fine with a recent version of openHAB.
thanks. one more question, the garage door status now displays 'ON' and 'OFF' as opposed to 'OPEN' and 'CLOSED' now. Is there a way to change that? Thanks!
|
|
|
Post by papa on Dec 28, 2019 1:00:38 GMT
Thanks, ngy, for persisting with this. I needed to add more in this post related to transforming ON/OFF to CLOSED/OPEN. Try the latest additions to that post. There may be a better way to do this, but at least it worked for me. Again, my apology. It's been several months since I worked this out.
|
|
|
Post by papa on Sept 7, 2022 13:55:06 GMT
Some TroubleshootingMy RFM69 nodes tend to run for years without trouble. (Other than soldering lead wires to RFM69 radios) I tend to plug wires into Arduino sockets. These connections (especially in damp situations) can tarnish & become unreliable. Recently one node monitoring a door's dead bolt lock (nestled among transpiring plants) stopped working & needed troubleshooting. (Above, see this post & this post.) I plugged the node into my Arduino IDE computer & watched the serial monitor output. The RFM69 radio was not connecting & the lock's opening & closing was not reporting reliably. To un-tarnish the RFM69 connections & lock connections to Arduino pins, I started slightly unplugging & re-plugging wires into Arduino sockets. I also cleaned the RFM69 connections with steel wool. I plugged the cleaned RFM69 radio into my receiving test RFM69 Arduino ( see this thread). The radio works & acknowledges my sending test RFM69 Arduino. I reinstalled the radio on the door lock node, but the node was still not reliable. I programmed another Buono Uno Arduino compatible & installed the RFM69 radio & lock connections. Now the node connects & reports lock status to openHAB via its gateway.
|
|