diyiot

IoT is of some interest to me. I don’t like how this term Internet of Things gets used by marketing guys.
If those networks of things are only connected but not integrated into the internet then it’s no ‘internet’.
I few years ago I stumbled upon a very lightweight and simple protocol that fascinated me. It’s called MQTT.

my vision

My idea of an Internet of Things takes most the devices’ logic and places it somewhere else. A simple mqtt light switch can’t do much more than turn the light on, off or blindly toggle the state. To get some feedback my simple light switch publishes the new state of the light on an additional topic.
On what conditions the light gets turned on is of no interest to the light whether it be a light sensor, people clapping their hands, a motion sensor triggered by somebody walking by or a click of a button on a website.
The same goes for the temperature sensor which in my little mqtt network doesn’t turn on the heater by himself. That’s the work of some service run elsewhere which is subscribing to the temperature sensor and telling the heater to turn on only when it’s supposed to. I might go holiday and I don’t want to reconfigure all my things hidden all over the place just to turn some thermostat off or adjust the temperature. If the devices are as dumb as possible the network itself is most flexible.

my implementation

In my small Internet of Things, there are even two different network which work together but don’t have to. One broker is running on a raspberry pi in my camper the other is at home running in an virtual machine hidden away in the basement. The two are bridging with each other if they can see each other on the network. Sending all messages the other one hasn’t to each other. If the camper isn’t home the access point can’t join the home network the mqtt network in the camper works on its own. There are things (Arduino Ethernets with sensors and actors) which can be controlled automatically or by hand with a push of a button on a website. The things are in blue. The two brokers are shown in green. In yellow are the services. One is a very simple python thermostat just for the sake of illustration and the other ones are a mqtt connected websites with fancy buttons. All of those things and services are communicating via mqtt topics. Try clicking on the diagram bellow.

It isn’t the most consumer friendly concept of an IoT mostly because you have to draft the language, in which devices and services talk to each other, yourself.
But isn’t that the case for most of the open and nonproprietary networks of things which have to work together.

Following is one small example my API/language I created simple enough not only things but humans can understand and control manually.

vw/temp/1 -1.30
vw/heater toggle
vw/heater/state on
vw/temp/1 -1.20
vw/temp/1 -1.10

vw/temp/1 14.90
vw/temp/1 15.00
vw/heater off
vw/heater/state off

Here is all my mqtt related code, running somewhere, hosted.