|
Post by bubembo on Oct 17, 2016 11:33:35 GMT
Hello everyone, First of all what a great job it has been done here. So I intend to fully automate my house so I stumbled with this cheap solution which I intend to deploy.
However I have some noobie questions since I am entirely new to this whole home automation.
1 - I've seen that the architecture might have been changed right now it is better to use which gateway?
2 - I am not able to find the buono uno r3 to ship to my country (Portugal) are there any other alternatives that do not impact with the work done?
3 - Can I use rasperry pi 3 for this deployment?
4 - Is it better to use ESP8266 nodes or the suggested nodes in the original tutorial?
5 - Is it enough to have a unique gateway for a 122 sq meter apartment?
6 - Odd question, what is the main difference of this architecture and the mysensors one are there any advantages of one or the other?
Hope you can help me i am looking forward to get your feedback.
|
|
|
Post by papa on Oct 17, 2016 15:56:05 GMT
Welcome, bubembo, to the DIY Home Automation party & thanks for the compliment. This project has many details to cover so be patient with yourself. It's also really a thrill & satisfying when it works so enjoy those moments. I will give my answers to your questions. Particularly for questions 4 & 6 others will need to supplement what I've written. 1) In my observation & experience, the computourist-derived gateway (Ethernet shield connected to an Arduino Compatible) has been the best option so far. Hardware & Software wise, the Uber Home Automation approach used two Arduinos for the gateway & communication with nodes went only one direction. Having OpenHAB, Mosquitto, AND Gateway all on a Raspberry Pi has been appealing, but seems problematic so far. Currently some forum members are working on that last option so if they succeed AND document how they succeed, that could become the best option. 2) What's important is 3.3 volt operation including from the digital input / output pins. Forum members (including computourist) have said that this 3.3 volt Adafruit hack on a regular Uno has worked fine. 3) Yes, you can use a Pi for OpenHAB & MQTT for now. Maybe in the future it can also hold the Gateway. Caution: Apparently improper shutdown or frequent persistence writes can corrupt the Pi's SD card (OS & OpenHAB /MQTT). 4) Since I only use the RFM69 radio approach, I don't know. computourist & others seem fine, even enthusiastic, with that approach. 5) Probably. The RFM69 radios will communicate a good distance. As I find works well for Wi-FI routers, I put my gateway on the highest floor of my dwelling. From what computourist has said, one gateway's sufficiency depends on the amount of communication it must handle (number of nodes, frequency & amount of node communication, etc). With no problems I've had up to a dozen nodes communicating 2 or 3 functions as often as 30 second per node. One can have more than one gateway. I successfully created & documented a network with two gateways. 6) I don't know. I've looked at the mysensor stuff, but not compared the two approaches much. My impression is you may find more complete & detailed documentation on this forum, but that may be my prejudice. Speaking of documentation, I hope you see the forum threads I provided on a Raspberry Pi install & on building a Gateway & some nodes. In the Oct 8, 2015 at 6:40pm post of the second thread, I give the link for the 3.3 volt hack of a regular Uno. I have other threads on the forum documenting node hardware & software & OpenHAB programming. I try to write documentation with beginners in mind. The Aug 4, 2015 at 2:59pm post on this page has a diagram of possible DIY Home Automation connections. The Success ... thread also contains an openhab-papa4.zip collection (see the Oct 16, 2015 at 4:30pm post) of sample OpenHAB configuration files to go along with the builds & implementations I have documented. Best wishes & success & again, have fun !
|
|
|
Post by bubembo on Oct 17, 2016 17:18:46 GMT
Thank you so much for sharing this information with me, for sure I will follow the information you shared in order to achieve what I am looking for. I've been loosing all day to try to find one thing that most likely you already know or have done before: electronics.stackexchange.com/questions/82499/control-the-lights-both-with-wall-switch-and-arduinoWhat I was searching for was basically a way to keep my current wall light switches and make it work in parallel with openhab, do you know if this is even possible? The problem is even if i use the sonoff approach on for the ceiling lights, once the manual switch is off, I will have no possibility to turn it on again through openhab. Did anyone did such a project? I was thinking of adding something behind the wall switch but honestly after checking I did not cross with anything interesting as of now except the link I've shared with you. THank you so much!
|
|
|
Post by papa on Oct 17, 2016 19:35:33 GMT
To get helpful experience with this project, I recommend you start with build a working Gateway & DHT End node & installing OpenHAB & MQTT. ( Again my documentation mentioned near the end of my first reply above might help you with that.) Then you can move on to a much more difficult project like the wall switch. I have (sort of) accomplished "controlling lights with wall switch & OpenHAB," but I've not been satisfied with the results. That plus the dangers of mains voltages is why I've not posted much on this. My concept for the wall switch node was another version of the DHT End node controlling a solid state relay. If that node has a constant power supply, its pushbutton signals for the relay to toggle power for the light. IF the wall switch box has both hot & neutral wires, the node can have constant power supply in there. If the wall switch only completes or breaks the hot wire (as in one of my boxes), one must plug the Arduino's power supply into a nearby outlet or perhaps (discretely) run a neutral wire connection from a nearby outlet to the Arduino power adapter at or near the wall switch box. The really tough part is using small enough parts & the right arrangement to fit inside a wall switch box (a TIGHT fit). That's even with using a small Arduino compatible like a Moteino or Miniwireless & a solid state relay on a chip & the most compact 5 volt power supply you can find. You wrote, "I was thinking of adding something behind the wall switch." Yes, if you could put at least some parts in the wall outside of the switch box, that could help with the space problem. Update, 9/18/2017: This may violate electrical codes because of the possible dangers.Another problem I had was a wall switch box which had a light switch AND an exhaust fan switch. ( See this thread.) On the good side, it had both hot & neutral wires. On the bad side, when the exhaust fan was switched off, it flashed the lights with power & usually disabled the Arduino until I entered the box & reset it. I'm afraid that much of that would damage the Arduino. Here is a commercial product that is supposed to do what you want. Though, if I remember right, it needs both hot & neutral wires at the wall switch box. Also it uses similar but different programming that what we use on this forum. However, one should be able to reprogram it to be compatible. Again, I recommend you might start with build a working Gateway & DHT End node & installing OpenHAB & MQTT. Get that working then we can get more specific about parts & approaches that might work for a wall switch. Best wishes & if you succeed with the wall switch box, please document what you did on this forum. I will do the same if I work out a better approach.
|
|
|
Post by bubembo on Oct 17, 2016 22:20:14 GMT
My idea with the wall switch was actually different I was thinking of using the wall switch i currently have and add overthere some sort of 3 way switch with a controler in between, this way it would be way easier to implement, am i having a noob idea? I will start with the basics, however i think if we could sort this out by using the physical keys along with the openhab intelligence would turn out to be one of the best projects even if we have to drill a hole next to every switch in the house.
|
|
|
Post by papa on Oct 17, 2016 23:16:34 GMT
My idea with the wall switch was actually different I was thinking of using the wall switch i currently have and add overthere some sort of 3 way switch with a controler in between, this way it would be way easier to implement, am i having a noob idea? I will start with the basics, however i think if we could sort this out by using the physical keys along with the openhab intelligence would turn out to be one of the best projects even if we have to drill a hole next to every switch in the house. That might work. Sounds like you would have 4 "devices" on this node: 3 to read the state of the 3 wall switches & 1 for the state of whether the relay to the light is on or off. If the 3 wall switches are push buttons that momentarily close then open the switch circuit, you might use the push button logic in the DHT End Node program sketch. If the 3 wall switches are ones you flip on or off, look at my adapted sketch in this thread & select another switch logic & the Arduino connections that match. Also see documentation in this earlier thread, especially posts May 4, 2016 at 2:23pm & May 4, 2016 at 4:23pm Caution: The more things for the Arduino to power (including reading switches' states, the more likely one bumps against the Arduino current limits & gets unreliable results.
|
|
|
Post by computourist on Oct 18, 2016 10:17:31 GMT
Hi papa / bubembo , Some remarks on Bubembo's list: item 2: Arduino. I use Arduino pro mini. Make sure you get the 3.3 Volt type. If you start out with the esp8266 or Sonoff node you won't need any Arduinos ;-) item 4: ESP nodes Since the ESP8266 node is an MQTT client in itself, no gateway is needed to operate such a node. The gateway has always been the component that has generated most problems for beginners. Leaving it out will increase your chances for success. Starting with a setup where an ESP8266 node is combined with a Raspi running Mosquitto & Openhab is the minimal configuration needed to get started. item 5: coverage: If you have a single-floor apartment a single gateway should be sufficient. I have a 2-story house that is being served by a single gateway in the hallway.
|
|
|
Post by bubembo on Oct 19, 2016 0:42:29 GMT
Hello again!! After searching for my WIFI switch to integrate in wall I came up with this solution. forum.pimatic.org/topic/1257/wifi-switch-to-integrate-in-wallI guess this would be as well possible with a Sonoff. What do you think guys? Am I seeing all wrong? Hope you can help me with this dream of having smart wall switches
|
|
|
Post by papa on Oct 20, 2016 1:48:43 GMT
bubembo, since I have not worked with wi-fi units so far, I can't offer any input on this.
|
|
|
Post by jimkernsjr on Oct 20, 2016 20:08:33 GMT
bubembo...
I have the original setup with the arduino gateway and just recently started adding esp8266 and sonoff.
I'll be honest with you...with such a great job comoutourist did with the esp and sonoff sensor nodes, I wouldn't anymore fool with the arduino. UNLESS: -you want to learn that -you need the range...it's slightly better than wifi. Some make it go amazingly far but i have no such luck.
Esp13's are cheap..under $2usd and the sonoff under $10. Upload the code and the only thing else you need is openhab and a Mqtt server. I use VMware with a virtual Ubuntu machine...no pi at all. It just worked out of the box with only a few code changes. I have it even customized to drive a stepper motor to roll up and down Window shades!
I wish you good luck. You came to the right place. Everyone here participates and are knowledgeabke and of the utmost help.
Best regards, Jim
|
|
|
Post by bubembo on Oct 20, 2016 22:37:00 GMT
Hello, I've found something that might allow the Sonoff to work as a actual smart switch. For this we would use the following as presented on the image below: s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/11004326943/original/20160504_183747.jpg?1462360441The blue terminal will connect to the wall switch and the MAINS would pass through sonoff only. This way whenever the switch was "up" we will get 1 on GPIO and we could control smartly the switch. What do you experts think about this? I am not sure if the wall switch would work by being fed only with 3.3v but at least the circuit would be closed once the switch is up, so in my humble opinion it might be enough for the Sonoff to know that the button is pressed, am i right?
|
|
|
Post by papa on Sept 18, 2017 15:34:49 GMT
I recently looked at this thread & saw that we did not respond to bubembo's last questions about making a smart wall switch. bubembo was moving toward using ESP8266 / Sonoff devices & I had no experience with them at the time. Since then, I do have ESP8266 experience & in fact, created a separate board on this forum for ESP8266-related threads. Moreover, like computourist & jimkernsjr, I now recommend that beginners start DIY home automation with ESP82xx WiFi devices, especially (like here) to control AC appliances. See this thread for more. I cannot tell much from the Amazon image that bubembo posted above. However, if he meant adding it to a Sonoff (made by Itead), that Amazon addition should not be necessary. The Amazon image may picture another Itead-like device that includes switching via a RF signal. That might work, but not better than a regular Sonoff. Below, more thoughts about using a Sonoff for a Smart Wall Switch
|
|
|
Post by papa on Sept 18, 2017 15:43:16 GMT
From my experience, what is needed to use a Sonoff as a smart wall switch?
1) The switch box must contain both the mains' power hot wire AND a true neutral wire (not just a hot wire which the switch closes & opens). Why? The Sonoff electronics needs constant power in order to detect the wall switch change in state & to close the open Sonoff relay.
If the switch box only has wires on the 3 switch terminals (In/Out/GND, as in older homes), it probably does not have a true neutral wire. I believe a true neutral wire will typically be separate from the wall switch & may be in a bundle of 2 or more wires (with white insulation?). ---------------------- 2) One must be able (safely) to fit the Sonoff & the wall switch into the original switch box (impossible?) or somehow package the Sonoff & wall switch in another safe, code-obedient protective box.
Needs 1) & 2) would be easiest to address in new construction.
|
|
|
Post by papa on Sept 18, 2017 15:45:28 GMT
bubembo: "I am not sure if the wall switch would work by being fed only with 3.3v but at least the circuit would be closed once the switch is up, so in my humble opinion it might be enough for the Sonoff to know that the button is pressed, am i right?" Yes, IF 1) & 2) above are addressed, THEN 3) a standard wall switch could be used with a Sonoff. One wall switch terminal would connect to the GND connection on the Sonoff's 5 hole programming strip. ( See this image.) The other wall switch terminal would connect to GPIO14, hole 5 (counting from the Sonoff push button). The Sonoff programming would need to pull GPIO14 high. Closing the wall switch would connect GPIO4 to GND, pulling it low. The Sonoff would need to detect GPIO14's state & toggle the Sonoff relay accordingly. Below: Possible alternate ways to get some of what bubembo seemed to want.
|
|
|
Post by papa on Sept 18, 2017 15:58:06 GMT
Possible alternate ways to get some of what bubembo seemed to want.
I've used an Itead Slampher smart light bulb socket to accomplish some of what bubembo seemed to want with a smart wall switch. It only requires reprogramming the Slampher, not changing the wall switch circuitry. The wall switch turns the bulb on & off. Limitations: One can only remotely turn the bulb on & off IF the wall switch is on (to power the Slampher electronics). Also my Slampher only worked with old-style incandescent bulbs, not CFL or LED bulbs (at least not the standard, cheaper kind). See this thread for the details. A manufactured possibility ?? ... Currently for $15 USD, Itead sells a smart wall switch called a Sonoff Touch. As mentioned above, this would still require the wall switch box to contain both mains' hot wire AND a true neutral wire. For good or ill, it switches via touch rather than a physical switch. It should fit inside a regular wall switch box. I do not have a Sonoff Touch. From what I've seen online, Itead makes this one (like its other products), friendly for reprogramming. So it should be possible to reprogram this product with software like we use on this forum. See this search, including the first listing, to show you how to connect the product's circuit board for reprogramming. See other threads in this forum's ESP8266 board for this forum's programming code, especially this thread. In another thread, I'll give more details about reprogramming a Sonoff Touch to use the home automation software of this forum.
|
|
|
Post by agecrabahaykubo on Feb 8, 2018 2:06:59 GMT
I am also interested in making this, it is more affordable. From what I viewed from youtube, you need to flash a firmware and make some changes to the setting then you will be able to integrate it in Openhab.
|
|
|
Post by papa on Feb 8, 2018 2:33:29 GMT
|
|