My Home Control System
- collect information about power consumption
- remote control appliances
- have security devices around the house
What I learned during my investigation is that it is all about IoT and everything is in the Cloud. That is great when you have a reliable internet connection and an ISP that keeps you connected all the time. But what if you live in a 3rd world country (like me) and your ISP disconnects you very often without informing you and without any reason. Yesterday night my connection was down for 1 hour, last week it was 3 hours and beginning of this month we were cut off for 24 hours. Then IoT is useless and your devices are clueless what’s going on and cannot be controlled anymore.
So I put together my own requirements how MY home automation should work. None of the above listed systems fulfilled all requirements I thought about. What I disliked most is that they all rely on a server (in-house like a Raspberry Pi or external like a VPS) and they rely on a working internet connection. And they would stop working once the connection to the server or to the internet is interrupted. Then there is no more IoT and no more cloud!
For me it was very important that as much as functionality is secured even if your ISP decides to cut you off for maintenance (or whatever reason they come up with). Specially security functions should still be working even if your local WiFi network stops working.
So I came up with my own list of requirements:
- partially functional without internet connection
- mostly functional if server goes down
- security devices working without local WiFi connection
- devices should be able to talk to each other without needing a central server (e.g. a motion sensor can activate a light by sending the request directly to the device that controls the light)
- status information and control options available on any phone/tablet connected to the local WiFi network
Check out these posts how I achieved these requirements.
- Communication between devices that doesn’t require a server
So each device sends out it’s status once a minute as an UDP broadcast. Any other device can listen to these broadcasts and if the data is relevant, use the information.
Any device can send commands over TCP to any other device to initiate actions.
Now this means that each device is not only a simple sensor or actuator, but that each device has its own state-machines and intelligence to decide what to do if a certain event happens or certain data is coming in from another device.
to learn how I programmed them. I will write about my other devices in the next days and weeks.
Of course I still wanted to have information and control over my system when I am not at home. So when IoT and the Cloud is available, there should be a central unit to collect data and send to a server over MQTT (coming soon)