My Home Control System

I was always fascinated by automated homes. For me it is interesting to

  • collect information about power consumption
  • remote control appliances
  • have security devices around the house

When we bought our new (very old) house in 2014, I started looking into systems like OpenmoticsopenHAB, home-assistant or Open Source Automation (this list can be extended endless).

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.

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.

Read Devices, tasks and communication about how the devices are linked to each other, what status messages the different devices are sending and what commands they can accept


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)