Sensor Visualization - getting the data from IoT

So far, this blog has spoken about infrastructure monitoring. I'll get back to that, because I've just done something exciting with Telegraf, but my house doesn't just have IT systems - it also contains many sensors.

I have a SmartThings hub. I have a Xiaomi hub. I have a Hue hub. I have a Tradfri hub. I have a Hive hub. I have a CC2531 Zigbee sniffer. I have a Ring doorbell. I have 4 Nest smoke alarms. I have a Xiaomi camera. I have BT Whole Home Wifi. I have a Broadlink hub. I want to get data from these, where appropriate, so I can act on the collected data and so I can visualise what's happening.

Firstly, they are all consumer devices, like almost all the components in my house. This means that everything is constructed to a price rather than being made to the best quality. Therefore I expect a little unreliability, and I'm resigned to occasionally having to reconfigure or power cycle devices.

So, how am I going to get data out of these platforms? They mostly compete against each other, and we're getting into the areas in my introduction where I claimed that companies want to monetise home automation rather than provide the best service. Ring is a great example of this, because you have to purchase a cloud subscription to store captured video. But I want to limit my data leaking onto anonymous servers on the Internet as much as possible, and I want to keep control of my spending, so I try to minimise what's escaping from my LAN.

So, what can I do? I can investigate to see whether any of these platforms are able to integrate with my preferred infrastructure. I've already mentioned about using Apache ActiveMQ as my ESB (MQTT broker), so this seems like the logical place to start.

SmartThings

When Samsung acquired SmartThings, there was concern as to what facilities would be sunsetted, but so far Samsung seems to have tried to augment the platform rather than replace it. The Samsung mobile app doesn't quite do everything that the original SmartThings app does, and they are currently providing updates to each one.

SmartThings has a great technical integration platform, permitting JSON configurations and Javascript snippets to be programmed into a web application, to be downloaded and run from your local hub. This is great for supporting devices from multiple vendors, and it gives clever people a way to get data from the platform.

One of the ways to get data out of the platform was written by some folks who use Home Assistant. I'll talk about software like that in a future post, but suffice for now to say that a happy union between the SmartThings platform and IoT software is MQTT. They came up with the SmartThings-MQTT-Bridge.

Xiaomi

Xiaomi make some of their own hardware and they are also an umbrella company for many small Chinese manufacturers. One of the smaller manufacturers, who share technology with Xiaomi, are Aqara. Therefore Aqara and Xiaomi hardware tends to work together.
The Xiaomi Mi hub has the ability to expose its UDP API to the LAN. The Aqara hub apparently has this functionality disabled, but I have the Xiaomi Mi hub along with a bunch of Aqara sensors, so this works for me. Again, some clever people worked out how to integrate the Xiaomi hub with MQTT, in a project called xiaomi-mqtt. Xiaomi software is mostly compatible with Zigbee, but it's designed to work in the Xiaomi infrastructure, so it's not always straightforward to integrate their sensors with other people's Zigbee platforms.

Tradfri

IKEA took a slightly different approach to other smart home vendors. They appear to have embraced the cost-cutting mantra of IKEA, and so some of their configuration is particularly tricky. However, Tradfri devices presumably have more QA in the Tradfri platform than with other platforms, and firmware updates for their devices might be available at some point, so it's worth the investigation. Tradfri-MQTT is a project to integrate the Tradfri platform with MQTT.

Hue

Philips Hue is an expensive choice. Philips is doing its best to make the open Zigbee ZLL platform to be closed, but there's an integration with SmartThings to permit interoperability. When Hue data is provided to SmartThings, the SmartThings-MQTT-Bridge is able to grab it and send it to MQTT.

Zigbee2MQTT

Zigbee2MQTT is an open source project designed to work with the TI CC2531 Zigbee sniffer, offering a custom firmware for becoming a hub. Because of its name, it's clear that it's designed to integrate directly with MQTT.

Hive

Hive is the British Gas offering to enable the smart home. When I asked, they said that they weren't planning on making any of their APIs public, so this platform would be specifically designed to lock customers in and make money from them.

Nest

We'll need to wait and see what Google do with the Nest platform. Nest uses Thread (low-power IPv6) as a communication mechanism, so it doesn't require a hub.

Xiaomi camera

If you install a SD card into this device, it enables local storage. Local storage includes the ability to save videos across the LAN, not just to the local card.

BT Whole Home Wifi

BT are another company who would rather not permit their customers to monitor and manage their platform. Having said that, I queried my Whole Home dishes, and I discovered that they each run a local MQTT server.

Broadlink

Broadlink deals with RF devices, rather than Zigbee devices. RF has a longer range than Zigbee, but it's only a one-way protocol, so it's automation but NOT IoT, to be used with devices that don't need to send a response to their calling platform.

So I have some platforms which will write to MQTT, and some that won't. I'll need to use some home automation software to bring everything together. I've already mentioned Home Assistant above. There's also OpenHAB and Domoticz. I don't use any of them. I use Node-Red instead, but that's for a further blog post.

Comments

Popular Posts