Talking to devices

Reading Time: 4 minutes

This is where it starts to get a little more technical and a little more interesting. There are several different ways you can talk to your devices.

First, let’s look at cloud based solutions. Alexa is a good common example that most people will get. You say “Alexa. Lounge light on”. A second later, the lounge light comes on. This, in very simple terms, is what happens…

Cloud based automation

The same is true if you’re using an app like the Alexa app or SmartThings. The command ends up on Amazon’s servers somewhere in the world before it gets bounced back to your router and on to the light bulb. I say Amazon’s but it could be anyone if you’re using some WiFi bulb you got from Aliexpress that you control through one of the generic apps that you can integrate with Alexa using an Alexa skill.

Now compare this with local control where you have a Raspberry Pi with a Zigbee controller plugged into a USB port.

Local automation

The journey is a little bit simpler. But the most important thing is that the command never leaves your home. And if your Raspberry Pi is connected via a cable rather than WiFi then it’s even better.

Now let’s make things a bit more complicated…

Cloud automation with 3 devices

With this one, you can see you now have 3 bulbs. In each case, the distance from your router is slightly more or less. This has an impact on the quality of your services. These bulbs are selfish. They are only interested in their own signal back to your router. You also now have 3 devices connected over WiFi to your router. 3 devices is fine. Add a bulb for each room in the house, a few sensors and some smart plugs and you’re going to approach a point where you hit problems with the number of connected devices on your router.

And this time with a local system…

Local automation with 3 devices

In this example, you can see multiple lines. The bulb furthest from your Raspberry Pi doesn’t care how far it is. It’ll use its closest neighbour as a repeater. If that device fails for some reason then it’ll find the next closest. These bulbs are selfLESS. They help each other connect back to the coordinator.

In a big network of mains powered Zigbee devices it’s like a spider’s web. At every point where one thread crosses another thread is a device. If one strand between those points where they cross breaks, there will be multiple routes that will allow the device to find a way back to the Raspberry Pi.

A quick word about Zigbee

Zigbee is a well defined technical specification that allows low powered devices to talk to a coordinator (the USB adapter plugged into your Pi) over short distances. It works on the same frequency as your 2.4Ghz WiFi but on different channels. You can get interference but you just change channels until it’s fixed.

Zigbee is a great way to add small, battery powered devices to your system. How robust your system is will depend on having a fair mix of battery and mains devices. Battery devices won’t act as repeaters. Mains devices (usually) will. Your whole network is as strong as the number of devices. In reality, you’ll probably cover the house if you have one bulb and one sensor in the room furthest away from your Pi as long as your house isn’t massive. So you don’t have to think that you need to start with 20 devices to get it working.

Just to make a point, this is what my Zigbee network looks like.

Zigbee Network

The grey boxes are all my devices. The lines are the connections between devices. In there somewhere is my coordinator. Looking at this, it would have had to have been a pretty rubbish spider. More like a plate of spaghetti!