Anyone interested in discussing building DIY Home Automation software and hardware?

Yes, ESP8266 is the cheapest (but not necessarily the easiest - yet) way to connect sensors to the internet via WiFi. There is a strong community working on improving a SDK for access to the micro on the ESP8266. But note WiFi is a strong draw on the battery of the sensor and range isn't as good as other radio solutions (as WiFi optimizes for speed which isn't relevant for sensors) but with the ubiquity of WiFi these limitations aren't showstoppers.
 
For MQTT with local automation support, there are libraries available that you can use to integrate MQTT into your local HA hub if you are a developer. I use a node.js library from github and as my hub software is message based using topics very similar to the MQTT format it was easy to add MQTT as another protocol the hub supports. Another alternative is to add MQTT support on your hub via a MQTT gateway to act as a bridge between the MQTT sensor and a MQTT broker which would be better if it is difficult to implement MQTT broker functionality into your hub (but would require a MQTT broker like Mosquito to switch messages).
 
My Oh My. I can't help noticing the energy some of your houses are using.  My house typical usage in the pic.
 
My peak, everything on, cooking, TV's, lights, etc is at about    1000 w
 
Just sayin.....
 

Attachments

  • 2015-07-01_19-34-37.png
    2015-07-01_19-34-37.png
    12.1 KB · Views: 11
@NeverDie
 
I don't really have any documentation, this was just an effort for myself. And it's an effort that is ongoing for long periods of time with long breaks in between. I expect it's the same for a lot of things everyone is doing on here. ^_^
 
Matt
 
deandob said:
But note WiFi is a strong draw on the battery of the sensor and range isn't as good as other radio solutions....
 
.
Which radio solutions do you prefer?  I just received some NRF24L01+'s to try out, mainly because they're easy to use  and they're reputed to be low energy.
 
Big house, too many lights, 3 kids and lots of stuff left on including 24x7 automation server, media server and C-bus. Having solar lessens the $ impact. Automation helps eg have a rule if kids turn on the light during the day the hub switches it off.

Regarding updating the automation system, too many ideas and not enough time. Have swapped some TV time for coding/electronics time - a better use of tome...
 
NRF24L01's are great. Cheap and easy to use. Reasonable range and good power use. Needs a higher level protocol though.
 
deandob said:
NRF24L01's are great. Cheap and easy to use. Reasonable range and good power use. Needs a higher level protocol though.
I couldn't get mine to work, and without a pre-existing link to leverage, it's proving hard to narrow down the source of the problem.  So, I just now ordered a couple of "RF Toys" that I'm hoping will establish a working link that I can then troubleshoot additional nodes against:
IMG_0419.jpg

http://rayshobby.net/rftoy/
 
Seems like it could be a nice tool.  Hopefully it's not a dud as well!
 
I had no issues with the NRF's but note you do need a protocol to run on top of them as they just a serial connection over radio. I also found the range to be good, better than Bluetooth LE but one module I got from Aliexpress with a smaller PCB didn't work so well (as expected). Also lots of info on the 'net for them. And a little cheaper than the WiFi ESP modules but at a couple of $$ for either who cares.
 
I have a microchip library I wrote for the OLED display you have in that picture (to display alphabet and digits) but I see your module is Arduino - ATmega chip instead (I use it for my water tank monitor which communicates over Ethernet/IP).
 
deandob said:
Yes, ESP8266 is the cheapest (but not necessarily the easiest - yet) way to connect sensors to the internet via WiFi. There is a strong community working on improving a SDK for access to the micro on the ESP8266. But note WiFi is a strong draw on the battery of the sensor and range isn't as good as other radio solutions (as WiFi optimizes for speed which isn't relevant for sensors) but with the ubiquity of WiFi these limitations aren't showstoppers.
 
For MQTT with local automation support, there are libraries available that you can use to integrate MQTT into your local HA hub if you are a developer. I use a node.js library from github and as my hub software is message based using topics very similar to the MQTT format it was easy to add MQTT as another protocol the hub supports. Another alternative is to add MQTT support on your hub via a MQTT gateway to act as a bridge between the MQTT sensor and a MQTT broker which would be better if it is difficult to implement MQTT broker functionality into your hub (but would require a MQTT broker like Mosquito to switch messages).
 
So what is the cheapest AND easiest way to add a sensor wirelessly regardless of the hub/OS? My primary issue with sensors is not the connectivity, but the accuracy of measurements. I would also question the usefulness of some "cloud-connected" sensors such as reed switches, that require low processing latencies. However it would be nice to have a universal way to add a sensor wirelessly, if needed.
 
Currently most of my sensors are hard-wired to some processing board, like HAI controller or webcontrol, which in turn are connected to HA server. Webcontrol is a networked board that supports multiple digital and analog inputs and cost $50. I once tried to add a wireless soil moisture sensor using arduino board, but it was 1) costly 2) not easy because of the sensor's non-linearity and 3) it was difficult to waterproof. So I ended up running an irrigation wire from the sensor to my Stargate board, and it's working like a charm.  Anyway I look at it, the best solution for sensor based automation need to be hybrid, using the best method for the required functionality.
 
picta said:
So what is the cheapest AND easiest way to add a sensor wirelessly regardless of the hub/OS? 
+1. I want to know the same thing.
 
There are some fringe products like the Moteino (http://lowpowerlab.com/moteino/) or the RF u-328 ( http://shop.ciseco.co.uk/rf-328-arduino-atmega-328-compatible-radio-transceiver-rfu-328/) which seem like they should be popular, and yet I never read about anyone using them.  The RF u-328 allegedly consumes only 4.7uA when sleeping (powerdown + WDT wake).  For low effort, not bad!
 
For adding wireless to a regular arduino, I can vouch that the SRF shield is easy to use (http://shop.ciseco.co.uk/srf-shield-wireless-transciever-for-all-arduino-type-boards/): a four line "hello world" sketch is silkscreen printed onto the PCB itself and it takes all of 10 seconds to snap on to an Arduino.
 
[Edit: I've since powered up the NRF24L01 modules again to do some screen captures on the node information, and out of the blue they're now communicating perfectly with each other at 1MBPS.   :) Not sure why now and not yesterday when I first tried, but I'm glad for it.    ]
 
So, given that, the real question is: is there an equally small PCB that integrates an arduino with an NRF24L01, and does it support OTA bootloading?  In retrospect, I should have started out with this question, because without it, one of the other two above will win the bake-off.
 
So far, the closest I've found is this:  http://www.mysensors.org/hardware/micro
which isn't a great deployment form factor, and, AFAIK, there is no easy OTA booloader for it.
 
So, unless it wins big on power consumption (which I don't yet know) or has much better range or something, it's effectively a non-starter--at least today, as those things will probably be developed eventually.
 
Hi Freedom, interesting project, thanks for the links. Your approach and architecture look quite similar to mine (message bus, plugins). I'm interested to see how you have implemented the web UI but I can't get your demo links to work (I just get a blank screen at http://demo.freedomotic.com:9000) and also do you have more info on how you implemented security?
 
picta, you typically need both the sensor and the communication platform to build an IoT sensor. A sensor might be a temperature sensor or reed switch, the communication platform would handle communication with the sensor and the hub (eg. i2C to the sensor, IP/WifI to the hub). So the accuracy of the sensor isn't really determined by the communication platform but by the sensor you choose. Agree cloud based connected sensors don't make a lot of sense (but seems to be the trend right now), communicating to a local hub is better as it will be low latency, reliable, secure and under your control. Most hubs will be able to listen to your sensor data (eg. ESP based sensors could use REST, or ZigBee mesh radios etc.). There are many ways of integrating a sensor into a HA solution (wired, wireless, protocol choice) and the best way depends on the application.
 
Neverdie, I don't know the best solution for NRF and Arduino with OTA bootloader - but certainly would expect there are several solutions available as both are popular platforms.
 
I tried out the Ciseco.  
RFu_Complete_New__93092.1424957459.1280.1280.jpg

The good news is that the indoor range seems very good.  I sent 20,000 packets from one corner of my house to the diagonal corner.  It lost an average of 1 packet out of every 1,000, but for the other 999 packets, none of the packet data was corrupted. I measured that by having a slave transceiver echo back all the packets it received from a master transceiver.  The bad news is that the roundtrip time for that ping-pong was 230ms, which for anything battery operated is a long time to be awake.  The datarate was set at 250kbps, and the baud rate for the arduino-to-ciseco was set at 115,200bps.  Both were the highest speeds possible.  Also, the XRF (similar form factor to the RF u-328 pictured in this post) has a 2.0mm pin pitch, so it doesn't fit into the more common 2.54mm pitch commonly found with arduinos or arduino breadboards.
 
I'll try the same experiment with NRF24L01+'s, and if anyone has interest I'll post the results.
 
Back
Top