|
Post by papa on Oct 21, 2015 16:52:30 GMT
(Maybe) Complete Instructions for Building a Basic DIY Home Automation Network using Arduinos, RFM69 Transceivers, & OpenHAB Server
These instructions are above in the posts from Oct 8, 6:40pm thru Oct 17, 6:10 pm.
Above at the Oct 16, 2015, 4:30pm post, I even provide an UPDATED Oct. 11, 2016 set of OpenHAB configuration files (openhab-papa4.zip) to work with this project.
Before those posts are other posts with various hints for accomplishing the project. If I alter these posts, I will aim to date the changes, especially significant ones. I often go back & edit posts so before you use a post's info, you might re-check it for changes.
|
|
|
Post by trouserhams on Oct 25, 2015 19:35:22 GMT
Hi Papa, I just wanted to extend my sincere thanks to you for the time you have spent writing your detailed descriptions and guides. I have been following them through for the last few days and am now sitting on the sofa, watching an LED on a DHT node on the other side of the room flick on and off at the slide of a switch in my openHAB interface and I'm ecstatic! The only things I have had issues with, which you may be able to shed some light on are as follows; The 'Nodes' PNG is missing from your images folder - I used this one: NodesIf you watch the following in Terminal via SSH; tail -f /var/log/openhab/openhab.log
Then I'm getting the following error occurring; [ERROR] [o.u.i.items.ItemUIRegistryImp1] - Cannot retrieve item Nodes for widget org.openhab.model.sitemap.Group I have looked at the My.items file and I think the two bits are the Rssi and Voltage of the Node, which aren't coming across to the UI. I tried //'ing them out but the issue is still there. Did this work for you? I will keep playing around with it to see if I can get it working as it is obviously useful information! The degree sign on the Temperature_Node02 line comes up as a question mark. I have copied and pasted the working format from the other temperatures and it still doesn't work - not quite sure what's going on here! The other issue I am having is with my.OpenHAB. It doesn't seem to work, and the instructions are very simple... I'll give it a day or so I case the log in details take a while to process. Fingers crossed! Have you had any of the above issues? Or is it most likely me being a noob and doing something wrong? (I'd very much imagine its me being the latter!)
|
|
kmac
New Member
Posts: 30
|
Post by kmac on Oct 26, 2015 3:06:00 GMT
Looks like that error is pointing to your sitemap file, probably one of the Group items is not the same as in your items file.
|
|
|
Post by trouserhams on Oct 26, 2015 10:16:11 GMT
thank you - I typed: Group Nodes (Nodes) at the top of the My.Items file (after the comments and the group now works!
I'm still having issues with my.OpenHab though and get the following message on the logfile whenever I try to connect;
2015-10-26 10:14:46.084 [WARN ] [o.u.i.items.ItemUIRegistryImpl] - Cannot find page for id 'null'.
I'm guessing this means my UUID/Secret may be wrong or there is something wrong with my login details. I have followed the online instructions through and I cna actually log in to myopenhab.org so I think my details are correct. Frustrating, buit I am slowly working through things thanks to everyones help and understanding!
|
|
|
Post by papa on Oct 26, 2015 20:49:29 GMT
trouserhams, I got a chance today to review the OpenHAB stuff I had posted. I must have been in too much hurry to post the last documentation. I had edited down my config files to what I thought were needed for a minimal Gateway / Node02 network. However, I omitted some necessary things, one of which was the Group Nodes line you & kmac discovered. The rest (so far ?) are images files needed.
Apparently, editing OpenHAB config files with Windows Notepad or Wordpad can create problems, especially when the files are used on a Raspberry Pi. In the download below, I've aimed to correct some errors found & rebuild the files using Notepad++ which is supposed to work better. Let me know how these files work for you.
At the Oct 16, 2015, 4:30pm post, I even provide an UPDATED Oct. 11, 2016 set of OpenHAB configuration files (openhab-papa4.zip) to work with this project.
trouserhams, You might use the latest version of My.items (of course, preserving any other additions you made) Also copy those added images from C:\openhab-papa\webapps. Then refresh your user interface browser tab & see what results you get, including for my.OpenHAB. I'm still learning OpenHAB myself, but it looks like the error message "[WARN ] [o.u.i.items.ItemUIRegistryImpl] - Cannot find page for id 'null'" looks like what I caused with an omission in the top line of My.sitemap. I believe that is fixed now.
Googling your error message, I see you contacted OpenHAB Community about it (good thinking). Again you could try fixing the things I omitted & see what you get.
I appreciate hearing about problems using my above instructions so we can debug & correct them
|
|
|
Post by trouserhams on Oct 26, 2015 21:27:23 GMT
Thank you for the update, Papa. I will try those files now and let you know how I get on. To be honest I haven't been adding a great deal, more understanding the general layout and function of each line that you have written before I start making my own files. Knowing how grateful I am for having your detailed how-to's to go through as a Noob, I am happy to help write a step by step from scratch (installing bits onto the raspberry pi etc through to getting openhab working with your initial files). I think it would be good to put things into an uneditable/uncommentable thread so it can be easy for someone to work through from the start without having to search around to find bits everywhere. I will obviously have to get mine working properly first before telling people how to get into the same mess as I have :/ Another BIG finding for me is that you cant edit the openhab.cfg file in notepad or wordpad on a windows computer, you have to use the designer. see here: linkIt was causing an error for me which was actually stopping the config file opening I think. It's awkward now though as I have my config files on the network via Samba, but I cant point the designer to it, so I have to edit then copy and paste all the time, which leaves it open for mistakes!
|
|
|
Post by papa on Oct 26, 2015 21:41:18 GMT
You're welcome, trouserhams. Your contributions would be welcome. When a newbie, (or near newbie like me) documents what's worked for them, it may include details that other newbies need & the more experienced might take for granted.
I also agree that using OpenHAB Designer to edit is a good idea. However, I have been able (I believe) to edit config files with other text editors. It's good to know that Windows editors might introduce problems & watch out for that.
You're not trying to edit OpenHAB config files WHILE openhab is running, are you? That, esp. with openhab.cfg, can choke things sometimes.
|
|
|
Post by trouserhams on Oct 26, 2015 22:45:04 GMT
I am, but its set not to update in the config file here;
# The refresh interval for the main configuration file. A value of '-1'
# deactivates the scan (optional, defaults to '-1' hence scanning is deactivated)
#mainconfig:refresh= I edit the file, then restart the OpenHab server using;
sudo service openhab restart (you can also use 'stop' or 'start' if you prefer) I have found some issues in your My.Rules file that I corrected last time but forgot to say. you have \\ instead of // in two places here;
rule "refresh Node02 Voltage, RSSI"
when
Time cron "0 0/1 * * * ?"
then
sendCommand(getNode2Voltage, "READ") // examples of �pulling� data from a node
sendCommand(getNode2Rssi, "READ")
end
rule "Compute humidex" // a measure of �weather comfort�
which causes the following error in the log file, and stops the humidex calculating;
java.lang.RuntimeException: The name 'examples' cannot be resolved to an item or type.
at org.openhab.model.script.interpreter.ScriptInterpreter.internalFeatureCallDispatch(ScriptInterpreter.java:67) ~[na:na]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._evaluateAbstractFeatureCall(XbaseInterpreter.java:658) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0]
at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0]
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291) ~[na:na]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:218) ~[na:na]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._evaluateBlockExpression(XbaseInterpreter.java:321) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0]
at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0]
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291) ~[na:na]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:218) ~[na:na]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:204) ~[na:na]
at org.openhab.model.script.internal.engine.ScriptImpl.execute(ScriptImpl.java:59) ~[na:na]
at org.openhab.model.rule.internal.engine.ExecuteRuleJob.execute(ExecuteRuleJob.java:55) ~[na:na]
at org.quartz.core.JobRunShell.run(JobRunShell.java:213) [quartz-all-2.1.7.jar:na]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) [quartz-all-2.1.7.jar:na]
I believe you have edited your openhab.cfg file in notepad or word as it is coming up with the following error on opening.
[WARN ] [o.config.core.ConfigDispatcher] - Cannot parse line '# This is the default configuration file, which comes with every openHAB distribution.' of main configuration file '/etc/openhab/configurations/openhab.cfg'. To get round it I copied and pasted the top 4 lines from the openhab_defaults.cfg to your openhab.cfg file - and no errors in the log!
The My.items file is still not correct. The top of it should read;
// My.items OpenHAB config file (coordinates with My.rules, My.sitemap, & other config files
// A BASIC version for OpenHAB to work with a Gateway & one DHT End Node (Node02) with push button, relay, & DHT sensor
Group Nodes (Nodes)
String getNode2Rssi "get Node2 rssi" {mqtt=">[mosquitto:home/rfm_gw/sb/node02/dev02:command:*:default]"}
Number Node2Rssi "Node2 RSSI [%.3f db]" <network> (Nodes) {mqtt="<[mosquitto:home/rfm_gw/nb/node02/dev02:state:default]"}
String getNode2Voltage "get Node2 Vdd" {mqtt=">[mosquitto:home/rfm_gw/sb/node02/dev04:command:*:default]"}
Number Node2Voltage "Node2Voltage [%.3fVdd]" <battery> (Nodes) {mqtt="<[mosquitto:home/rfm_gw/nb/node02/dev04:state:default]"}
Switch Act_Node02 {mqtt=">[mosquitto:home/rfm_gw/sb/node02/dev16:command:ON:ON],>[mosquitto:home/rfm_gw/sb/node02/dev16:command:OFF:OFF]"}
String Node02_SSR_Toggle {mqtt=">[mosquitto:home/rfm_gw/sb/node02/dev16:command:*:default]"}
Number Temperature_Node02 "Temperature_Node02 [%.1f °C]" <temperature> {mqtt="<[mosquitto:home/rfm_gw/nb/node02/dev48:state:default]"}
Number Humidity_Node02 "Humidity_Node02 [%d %%]" <humidity> {mqtt="<[mosquitto:home/rfm_gw/nb/node02/dev49:state:default]"} I'm actually having a lot of fun going through this and trying to resolve issues, as I'm really not a computer person and I feel I'm starting to learn!
|
|
|
Post by papa on Oct 27, 2015 0:59:23 GMT
Yes, trouserhams, it is fun to understand new things. I'm glad you're having that amid the frustrations. This is not a project for the faint-hearted.
Thanks for putting new eyes on the openhab-papa.zip files. Let me address your comments & corrections:
In My.rules, thanks for catching the two false comment signs
Yes, in My.items, you have "Group Nodes (Nodes)" & I now have "Group Nodes (Network)" (I deleted <nodes> ) (Nodes) is the icon you found. (Network) is an icon I left out before & now have supplied.
Yes, I have used Windows Notepad & Wordpad sometimes in editing OpenHAB config files & they do not seem to cause a problem for me since I run OpenHAB on Windows.
From reading the link & considering the issues you're having with my files in your Raspberry Pi OpenHAB, it looks like the problem happens when Windows edited files (except via Windows OpenHAB Designer & maybe Windows Notepad++) are used on a Raspberry Pi
I'll look into using only Notepad++ or OpenHAB Designer to edit files for openhab-papa.zip
|
|
|
Post by papa on Oct 27, 2015 2:48:00 GMT
Apparently, editing OpenHAB config files with Windows Notepad or Wordpad can create problems, especially when the files are used on a Raspberry Pi. In the download below, I've aimed to correct some errors found & rebuild the files using Notepad++ which is supposed to work better. At the Oct 16, 2015, 4:30pm post, I provide an UPDATED Oct. 11, 2016 set of OpenHAB configuration files (openhab-papa4.zip) to work with this project. Let me know how these files work for you.
|
|
|
Post by computourist on Oct 27, 2015 7:20:53 GMT
The Editor problem is probably due to the way end-of-line is handled differently on Windows and Unix machines. Windows uses a new-line/Carriage-return combination, whereas Unix only uses only the new-line character to represent a new line.
Most editors can be configured to use windows/unix style line ends. (but not notepad...)
|
|
kmccb
New Member
Posts: 10
|
Post by kmccb on Oct 27, 2015 19:52:07 GMT
Launching OpenHAB Server
In the Start button’s search box: type C:\openhab\start.bat [enter] A black background OpenHAB console should open & start displaying OpenHAB's booting & then node data. I encourage you to put a shortcut for the start.bat file in your start menu & Startup folder. The latter will insure that OpenHAB restarts when your computer restarts (like sometimes after Windows updates. [ To stop OpenHAB server, enter exit [enter] [enter] even if data interrupts what you type.]
Getting results with Your Basic OpenHAB Home Automation Network
With the programmed Gateway's Arduino / Ethernet shield connected to your Ethernet network & to your computer via USB, with Arduino IDE serial monitor running at same baud as set in the Gateway sketch (115200), & with the Gateway sketch using debug mode, the serial monitor will show if Gateway is connected to your home network. With all that in this paragraph, plus Mosquitto Broker service (MQTT) running on your computer (see above), you want the serial monitor to show MQTT connection & the Gateway's MQTT LED to light up. With all in the previous paragraph plus the DHT End Node powered & your computer running a rightly configured OpenHAB server (see above), the serial monitor may show "Message sent to node" .... You should also see Node02 temp & humidity data on the serial monitor. You'll have a simple, but working DIY Home Automation Network to build on. Awesome, eh? But it gets better ...
In a browser tab on your computer running OpenHAB, enter this address http://localhost:8080/openhab.app?sitemap=My The OpenHAB user interface should show in the browser tab showing data & virtual controls. In the user interface, you should see a virtual switch for Node02’s relay, & Node02’s temp & humidity. If you click on the Outside Temp (from Yahoo weather for your location), you get more weather info including a representation of comfort level. To return to the main user interface window, at the top, click on My House or the browser back button. At the bottom is date & time info, current to the last 10 minutes. Default was 15 minutes, I’m not sure why. In openhab.cfg, you can change this at ntp:refresh= (divide the number by 1,000 to get how long between refreshes) At the top left of the interface, see a link for Nodes. When clicked, it shows you Node02’s radio signal (RSSI) strength & voltage. This data make take a while to show up. Whatever RSSI is good enough if you get data. I did this but can't get it working.. I copied all the files you provided and I have a "My.sitemap" file in my sitemaps folder.. It's the one you provided and it is empty.. What am I missing? Thanks HTTP ERROR 500 Problem accessing /openhab.app. Reason: Sitemap 'My.sitemap' could not be found
|
|
|
Post by papa on Oct 27, 2015 22:58:01 GMT
Arrrrrrrrrrrrrrrgggggggggggggghhhhhhhhhhhhh! kmccb (& others) I sure have made mistakes with trying to provide a nice openhab config package.
You're right, My.sitemap in the zip file you downloaded was empty.
Thanks for pointing it out & my apologies.
At the Oct 16, 2015, 4:30pm post, I provide an UPDATED Oct. 11, 2016 set of OpenHAB configuration files (openhab-papa4.zip) to work with this project.
As before, let me know how these work for you.
|
|
|
Post by lhw455 on Oct 28, 2015 15:14:03 GMT
Everyone whose had a problem with Notepad or Wordpad, as computourist pointed out, these have problems in Windows handling ends of line - my recommendation is to use either Notepad++ or Notepad2 (get the portable versions) and simply add a "Send to" shortcut on the Windows menu so that you can simple right-click on files and send it to Notepad++ and/or Notepad2.
Notepad++ is more full-featured, and also very handy for .ino sketches as you can use syntax highlighing (C++), while Notepad2 is less full featured, but can still handle end of lines in Windows correctly - in my experience, both correctly detect things without messing with defaults, etc.
|
|
|
Post by papa on Oct 29, 2015 20:23:17 GMT
My diagram of DIY Home Automation using OpenHAB, MQTT, Arduinos, & RFM69 wireless transceivers (Click on the picture to enlarge)To gain local home automation control on the host computer, one must have the wired & wireless connections from the home host computer (running MQTT service & OpenHAB server) to the home router to the gateway (electronics & program) to the end nodes (electronics & programs). To gain home automation control from any computer or mobile device, one adds the internet connection through my.openhab.org. The above documentation aims to achieve this diagram.
|
|
|
Post by papa on Nov 4, 2015 0:23:18 GMT
At the Oct 16, 2015, 4:30pm post, I provide an UPDATED Oct. 11, 2016 set of OpenHAB configuration files (openhab-papa4.zip) to work with the CompuTourist derived Gateway & DHT end node. My thanks to readers who've help correct these files. See that Oct 16, 2015 at 4:30pm post for where to place them.
|
|
|
Post by papa on Nov 10, 2015 2:16:54 GMT
Woo hoo! I just had another success come together: A DHT Light Switch End Node, a DHT end node & Solid State Relay in / at a light switch box. Inside the switch box is a Solid State Relay chip, a Buono Uno switched to 3.3 volts (along one side of the box), a small strip board (mounted behind the switch plate) providing necessary DHT End Node circuitry & wires to connect all. The DHT sensor extends a little above the switch plate. A push button peeks thru the light switch rectangular hole. A flat USB cable descends from the Buono's USB connector & under the switch plate to a USB power adapter that powers the Buono Uno. Now I can toggle the light with the push button, the browser User Interface, the OpenHAB app User Interface, OR a scheduling rule in the OpenHAB config file. The DHT sensor provides OpenHAB with temperature / humidity readings from the room holding the switch box.
Dealing safely with mains power, the limited space & the stiff house wiring was a challenge. I had hoped to have the power adapter also inside the switch box. However, the switch I picked to try first only had the black hot wire & no white neutral wire so I could not power the adapter inside the box. Probably just as well for the first one because the stiff house wiring made it a challenge to fit the other items inside the switch box. Likewise the USB cable hanging out will let me reprogram the Buono.
When I get a chance, I'll document how I made the DHT Light Switch. Now that I have the concept working, I want to refine the design to be more compact.
12/2/2015 Update: I was not thrilled with the strip board on which I built some of this node. Today I discovered that the only aspect working is using the local push button to toggle the light. Wireless communications not currently working. So before documenting, I'll need to troubleshoot, maybe rebuild this one.
1/3/2016 Update: Turns out this node is still working after all. After being away from home for a while, I forgot which node is in the light switch box & addressed it by the wrong name. Oops ! Since I'm running short on time for documenting this & especially since it includes a solid state relay on a chip that is tricky to use safely with mains power, I'll wait on describing this better.
|
|
|
Post by papa on Dec 3, 2015 3:48:29 GMT
I've been doing some research on a battery friendly version of the computourist dht end node. I just started a new thread, Battery-sipping DHT Node (a la Computourist) to collect our conversations about battery nodes & perhaps add some progress. Thanks for your contributions & encouragements toward this.
|
|
ragoth
Junior Member
Posts: 64
|
Post by ragoth on Dec 6, 2015 6:04:38 GMT
Dear Papa, I am 69 years old retired electronic Engineer, I like this wonderful project. I learned lot of new concepts and technologies. You extensive collection and write ups gave me confident to try this useful Home Automation System. It works fine now and I am happy to try further advancements.
|
|
|
Post by papa on Dec 6, 2015 21:15:10 GMT
Greetings, ragoth, thanks for the encouraging feedback. I'm near your age, with a hobbyist (but not engineering) background so, hey, maybe you can teach us older dogs new tricks ;-) & maybe us older dogs can still teach others. ;-0
I'm thrilled you are having successes & are ready to progress to other things.
I really encourage you to document what you add so the rest of us might benefit as you have benefited from what we've posted here so far. That's how I got started contributing here in appreciation for other's work & a desire to encourage others starting out.
|
|
|
Post by papa on Dec 8, 2015 3:19:00 GMT
To my Battery-sipping Node thread, I've added documentation on building the hardware. I've adapted & tweaked Gandalph's Battery Node sketch to be more multi-choice & I believe it's about ready to post for testing. After 134 hours, my assembled Node's battery pack has lost a TOTAL of only .03 volts.
|
|
|
Post by papa on Dec 9, 2015 2:44:10 GMT
To my Battery-sipping Node thread, I've added the program sketch & documentation on customizing the software. Note: This sketch has become a Multi-Choice End Node including the option of a battery-sipping SLEEP mode. Not long ago, I connected two AA's (2.98 volts total on my multimeter) directly to the bare bones Arduino (bypassing the MCP1702 voltage regulator) & so far it seems to read & report temp & humidity. OpenHAB User interface reports 2.95-2.98 volts on the battery. I'll let the node run & see what happens.
|
|
|
Post by papa on Dec 19, 2015 22:19:54 GMT
Maybe recently like some of us, you've tried to compile & upload a sketch that did so fine before & HUH? it stops with an error "[xxxxxxx] was not declared in this scope." What happened? It worked before, didn't it? It's been (generally) true that one must "declare" something with void, int, bool, etc. or get that error. Maybe we did not notice that was apparently not enforced with subroutines (perhaps because of older conventions about putting subroutines near the end of a program). However, apparently at least by the time of the current version of the Arduino IDE, the "declare before use" requirement is more strictly enforced. How to fix this (newly?) enforced error? Find where the variable is declared later in the sketch (the line starts with void, int, bool, long, or etc.). Then move that whole area to BEFORE the use of the variable. In the case of a subroutine, start with the line that may begin like "void [xxxxxxx] { [ more code, even several lines ] } You'll move that whole section starting with void (or similar declarative terms) [variable name] plus following code embraced by the curly brackets { } I found the above out by trial & error. Just now I found a post on the Arduino forum which discusses this. Apparently, having ALL things declared before use is preferred. The post raises the possibility that the problem is not the newer version of the IDE, but rather some vague "add-on" that did not make it with the install. At the end of the post is a work around for the error which is to put a copy of the subroutine's first line somewhere before the variable is used. Then the subroutine can be left where it is, but it encourages that we follow the preferred practice.
|
|
|
Post by papa on Dec 22, 2015 16:50:50 GMT
Again, the Battery-sipping DHT Node (a la Computourist) now documents a Multi-Choice End Node including the option of a battery-sipping SLEEPY mode. In the recent week, I have added an updated sketch that has tweaked the PIR sensor option & have given some test results from versions of a battery-powered node. Update: After seeing how to do it, I just changed the name of the thread to ... Multi-Choice End Node incl Battery-Sipping
|
|
|
Post by papa on Dec 26, 2015 15:34:22 GMT
Using the OpenHAB User Interface on Another Computer in Your Local Network
Here's another good reason to assign a fixed IP address to the computer Hosting the OpenHAB server program (See the Oct 8, 2015 at 6:40pm post above where it was updated on Oct. 19). In your local network, say OpenHAB server is running on a computer with the fixed address 192.168.1.12 & in your equivalent of C:\openhab\configurations\sitemaps folder you have the config file My.sitemap. In a browser address box on another computer in your local network, enter 192.168.1.12:8080/openhab.app?sitemap=My [enter key] Your sitemap user interface should appear within that browser so you can view & control your openHAB network from there. You might put that [192.168... ] address in your bookmarks so you don't need to type it again. Again this works on another computer within your local network where your OpenHAB computer has an ip address. To use a computer in ANOTHER local network, you must work through the internet as described below.
|
|
|
Post by papa on Dec 26, 2015 15:40:47 GMT
Fellow OpenHAB RFM69 DIY Automaters, I've been hitting this project pretty hard for several months now between my own work & trying to assist others. I'm getting into a period where I need to prepare for some other things. Then I'll have my computer files with me, but I won't be hands on with my OpenHAB network for a few months. So fairly soon there will be limits on what I can contribute with real world testing. Though I likely will check in regularly & offer what help & encouragement I can.
However, who knows, if my preparations go well, I may get a chance to add some more stuff in the next couple weeks.
|
|
|
Post by papa on Jan 4, 2016 14:03:37 GMT
A Review of My Results with DIY Home Automation
Again I offer my appreciation to those who contribute to this DIY Home Automation project. Eric Tsai’s Uber Instructable first sparked my imagination. I avidly followed questions & improvements like from Trombly, DemonD, Bouillot, & especially CompuTourist. I add here my appreciation for Felix of lowpowerlab.com for the libraries & code samples that benefit this project. I've also gained much from interacting with you forum participants like lhw455, lewishollow, gandalph, gaute, kmccb, etc. You've help correct my errors & through helping some of you troubleshoot problems, I've learned much (& had a blast). I intend here to update my experience with this DIY Home Automation & features I added. (As noted, how to do much of this is documented in earlier posts.)
Mostly based on CompuTourist’s excellent implementation, I built & have had running a network of the gateway & 9 nodes. Several nodes have been working reliably together since early August 2015. Most use Buono Uno clones switched to 3.3 volts. All use RFM69HW transceivers. The Gateway is built just on a Buono Uno Arduino Compatible (See the posts Oct 8 6:40pm & following.) Most End Nodes have DHT11 temperature & humidity sensors, & a push button. Several have a solid state relay (SSR) (See the posts Oct 10 8:01am & following). One of my additions is a jumper (& an added device) on the gateway to indicate an “ Away Mode,” when one is away from home & wishes lights, etc to toggle on & off (via OpenHAB rules) to simulate activity for security’s sake. Another addition is pulsing a solid state relay to open & close our garage door (See Sep 18 12:55pm post). Another is using a reed switch & magnet for sensing if the garage door is all closed or not. Another is a node with a Infrared LED to turn a TV on & off. I adapted or added code & node devices to handle these features. More recent progress: At first, the garage node reed switch was just the bare glass tube kind that stopped working after a couple months. I replaced that reed switch with one protected in plastic & it's working fine so far for approaching another two months. I built a light switch box node that uses a solid state relay on a chip to control a light via a push button, OpenHAB rules, or the user interface on a computer or phone. (I thought it stopped, but it's still working. ;-) On a double sided circuit board, adapting from Eric Tsai & my previous experiences, I assembled a bare bones Arduino node that is battery powered & has a hacked PIR sensor. It regularly sleeps the microprocessor & radio to stretch battery life. I tweaked the node code & documented how to avoid false motion detection triggers. In the Multi-Choice End Node incl Battery-Sipping thread, I tweaked, expanded & documented a computourist sketch that gandalph-adapted where one can choose what devices / sensors / functions one wants on a node by commenting / uncommenting indicated code lines. Functions available so far include push button, DHT11 temp / humidity sensor, DS18 temp sensor, PIR sensor, Actuator, & a SLEEPY, battery-sipping mode. I also provided schematics for implementing most of the end node functions. I implemented OpenHAB on a Windows 7 laptop (See the posts Oct 16, 2015 8:52am thru Oct 17, 2015, 9:45am) & using OpenHAB Designer, I made a basic User Interface (UI). The UI reports Temperature & Humidity from nodes. It also has switches to toggle the SSRs. I found & used rules to postUpdate those switches if node push buttons toggle the relays. The UI also has contacts to report the state of the garage door, the Away Mode, & the PIR motion detection. Also a Node page of the UI reports some system states (RSSI & voltage) from nodes. I found & used rules to somewhat randomly schedule node SSRs & remote to toggle lights & TV when Away Mode is active. At the Oct 16, 2015, 4:30pm post, I even provide a sample set of OpenHAB configuration files (openhab-papa.zip) to work with this project. At the Dec 22, 2015, 9:32am post of the Multi-Choice End Node incl Battery-Sipping thread is openhab-papaPIR.zip, an updated config file set that includes the PIR sensor. I can view & control the OpenHAB User Interface (UI) using another computer on my local network. (See the Dec 26, 2015 post at 9:34am) I registered with my.openHAB & am able to view & control the UI over the internet including via the OpenHAB app on my iPhone. (See the post Oct 17, 2015 at 6:10pm I learned that an Arduino D9 pin signal could light an SSR’s LED but not close the switch to turn on a main’s powered device. So using a circuit I found, when I send the D9 signal to the base of a BC547 transistor (via a 2.2K ohm resistor), it switches on an SSR whose positive input is connected to the FIVE volt Arduino socket. For during-construction & future fixes & changes, I like to plug together many of each unit’s pieces. My gateway is mostly the Buono Uno with Ethernet Shield on top. LEDs for MQTT connection & Radio signals plug ok into Shield headers. (See the Oct 8, 2015 at 6:40pm post below) Resistor & jumper for the Away Mode plug into a section of added female headers with bottom pins suitably soldered together. I build a Gateway with just an Arduino compatible & plug in parts. (See the post Oct 8, 2015, 6:40pm) I designed a limited function End Node built with just an Arduino compatible & plug in parts. (See the post Oct 17, 2015, 6:10pm) With these 2 minimal assembly units built plus the Mosquitto & OpenHAB installs & configuration, one could have a basic, working OpenHAB network to get a feel for the possibilities. To build a full-function DHT End Node on top an Arduino, I use double-sided proto shields made for 20 pin integrated circuits (IC). Besides the usual Arduino female headers, they have 5 power headers & 5 ground headers. In the middle of the IC area are power & ground strips. For each IC pin is a strip of 3 holes. I solder female headers on some IC pin strips to create plug in connections (like when one connects a node button to a resistor & power). I created a 3.3 volt friendly shield by cutting a trace on the bottom & connecting the power header & a power strip to the shield’s 3v supply header. I usually solder resistors, but otherwise plug RFM69 wires (8), transistor, SSRs, & jumpers into the Arduino headers & my add ons. (See the posts starting with Oct 10, 2015 at 8:01am) I put the gateway on my home's top floor & nodes all over my home’s 3 levels & tested the battery powered node in my yard. Once I worked out shortcomings, it continues to work very reliably. As I get ready to decrease my DIY Home Automation activity for a few months, I still want to implement other things later, but am very happy with what is working so far. I wish you well implementing AND EXPANDING this approach & I hope my documentation might encourage & help you.
|
|
|
Post by papa on Jan 7, 2016 2:36:06 GMT
At the 1/6/2016 post of the Multi-Choice End Node thread, I put a newer "h" version of the sketch. It includes the possibility of selectively powering a DHT11 sensor on & off with an Arduino digital pin to save power on a battery-powered node. I also posted there a schematic to go with the sketch.
|
|
|
Post by papa on Jan 29, 2016 19:16:53 GMT
Like me, do you have an older (originally Windows) laptop or desktop on which you installed Linux & now you want to use it for OpenHAB with Mosquitto? I just finished narrating my journey of installing & troubleshooting that. I also aimed there to document just what is needed for the install. For that documentation, see my Linux Laptop: How to Install OpenHAB-Mosquitto thread
|
|
|
Post by papa on Jan 31, 2016 4:06:06 GMT
Getting Outside Temperature from Yahoo Weather has changed. In the black & white cmd console running OpenHAB, type exit[Enter] [Enter} to stop it. Go to weather.yahoo.com & where it asks "Enter city or postal code." do so. Then look at the end of the internet address above & copy the number there. Using notepad++, open C:\openhab\configurations\openhab.cfg open for a change. In openhab.cfg, just after the line that starts "weather:location.home.longitude," add a new line weather:location.home.woeid=[here without brackets, paste the number you copied from weather.yahoo.com]. Save the changed openhab.cfg file. You also need the latest weather binding addon. Do you have version 1.8.0 or later in C:\openhab\addons? If not, download the .zip of ALL addons from here. Copy only the latest org.openhab.binding.weather-x.x.x.jar to C:\openhab\addons & delete the earlier version. Relaunching OpenHAB: In the Start button’s search box: type C:\openhab\start.bat [enter]
|
|