Just so we are all on the same page, here is a very simplified view of my home network, and how it all ties into the DIY Smart Home concept.
Our house is about 6,000 SqFt in size, so one WiFi AP just does not cut it. Given that we will have IoT sensors both inside and outside, I needed to create a WiFi network that would support a variety of both devices and family members streaming content all at the same time. To that end I am using a number of DD-WRT flashed APs that are all connected together under one SSID….so as devices might be moving about the house, they just transition and connect to the strongest AP.
At the center is a large Cisco switch that has 48 ports, some of which are fiber. My connection from there out to the Internet is 2Gb LACP fibre connection. Connected to the switch is my server farm, all the directly wired Ethernet devices, a NAS, and my own OpenShift Cloud.
Docker Container Server
One PC server is reserved as a Docker Container server. Hopefully you know about Docker and Containers, as explaining them would be several more blog posts! Suffice to say that I’m not running anything fancy, so it should not be difficult to understand.
Here is a list of Containers that I am currently (Jan 2020) running for my DIY Smart Home:
IMAGE COMMAND STATUS NAMES
prologic/mosquitto "/usr/sbin/mosquit…" Up 3 months Mosquitto
homeassistant/home-assistant:stable "/bin/entry.sh pyt…" Up 7 days homeassistant
jdallen/dnssvr:latest "npm start" Up 3 months dnssvr
jdallen/mqttalertgen:latest "npm start" Up 2 weeks mqttalertgen
jdallen/apcups:latest "./startup.sh" Up 2 weeks apcups2
jdallen/xmaslights "npm start" Up 2 weeks outsidexmas
jdallen/xmaslights "npm start" Up 2 weeks xmaslights
jdallen/apcups:latest "./startup.sh" Up 2 weeks apcups1
jdallen/mobileapp:latest "npm start" Up 3 months mobileapp
jdallen/mqtttplinkbridge "npm start" Up 2 weeks mqtttplinkbridge
jdallen/mqttalerter:latest "npm start" Up 2 weeks mqttalerter
jdallen/mqttapi:latest "npm start" Up 3 months mqttapi
jdallen/radreporter:latest "npm start" Up 3 months RadReporter
httpd:alpine "httpd-foreground" Up 3 months httpd
portainer/portainer "/portainer" Up 3 months portainer
nodered/node-red-docker:latest "npm start -- --us…" Up 3 months node-red
Here is a brief summary of what each one does, and a link to the blog post (if written) that goes into more detail:
Mosquitto — this is the MQTT Broker. All my sensors publish their data to this, and it in turn sends out the data to all other nodes/programs that have subscribed to that topic. I only have non-SSL port (1883) enabled on this container, and I don’t have userid/passwords enabled either….so running naked! If security is a concern on your home network, you might want to use SSL and userid/passwords. I did this initially, but kept running out of memory on my sensors when including the SSL modules….not to mention that it adds complexity to your builds. Since my DIY Smart Home is more for fun than business, I elected to remove any MQTT security. Quite frankly, if I have hackers running around my home network, I have bigger issues than the hackers knowing the temperature outside!
homeassistant — This is Home Assistant as described here: https://www.home-assistant.io/ I use it on one of my work desk screens to display a lot of my sensor data.
dnssvr — This is a custom designed DNS server I wrote that has a REST API for managing the Smart Home Zone. I would be too embarrassed to put this code up on GitHub, so I haven’t. If/when I get it to a more acceptable state, I may do that and blog about it then.
mqttalertgen — This is a container that generates ‘alert/’ MQTT messages based on what my sensors are sending out. For example, if my Pool Temp Sensor batteries get too low, it will send out an alert….if my Radiation Detector detects an unusually high reading, it will send out an alert. This container also sends out an MQTT ‘Daylight’ status message (IE> is it Night or Day?) for my lighting control containers to use. It is highly customized for my particular Smart Home setup, but you might be able to get some ideals from the code.
apcups — Reads the output from the apcupsd program and sends out MQTT messages with that info.
xmaslights — If my wife had her way, we would have a Christmas tree up year round. As a compromise, we have a number of Christmas light strings up around the house to provide room lighting, in the place of lamps. These containers do nothing more than wait for night, and then send out an MQTT message to other controllers/containers to turn them on.
mobileapp — This container is a backend for a webpage running on a mobile devide to control things in the Smart Home.
matttplinkbridge — Most of our Christmas lights are controlled by TP-link Smart Plugs, and this container is a bridge between MQTT commands and TP-Link commands
mqttalerter — Watches for ‘alert/’ MQTT messages and sends them out to notification services like Facebook Messenger or SMS via IFTTT.
mqttapi — Collects all the MQTT messages that it sees and makes them available via a REST API. I use this from Javascript running on my display web pages to show current sensor readings.
radreporter — Takes the radiation reading from my radiation monitor MQTT data packets and pushes them out to the AT&T M2X IoT Platform to create pretty graphs that I can link to from my other blogs.
This is done using their “Personal Account” option where you can send them data from up to ten different sensors and create graphs like this, among other thing.
Let the Fun Begin
So I have lots to write about here, and more stuff coming as I add to my DIY Smart Home! Some of the code for the above containers may already be out on my GitHub page: https://github.com/john2exonets?tab=repositories