Blog IndexPosts by TagHome

Going a bit crazy with Home Assistant and Zigbee

Posted <2022-01-09 Sun 21:05> by Aaron S. Jackson.

Over the past couple of months, I've been playing around with Home Assistant - a self hosted, privacy first, open source home automation package. One of the main appeals of this was the availability of very cheap (£10/each or so) temperature and humidity sensors which run on a small coin cell and are completely wireless. When we first moved into this house, I attempted something similar with a 1-wire bus and three temperature sensors, connected to a Raspberry Pi. Generally they worked quite well, but 1-wire busses can be quite fussy at times and I had quite a few issues which I never got to the bottom of.

Home Assistant support for different technologies has been quite impressive and seems to be able to interface with WiFi, Z-Wave, BLE and Zigbee devices. The appeal of Zigbee over WiFi in particular is the separation offered from the rest of the home network. They do not need IP addresses, and definitely do not need to talk to the outside world over the internet.

Flashing the Zigbee Dongle

Generally, people use some kind of "Zigbee Hub" which links up to devices. Manufacturers of these try to market them as being unique to their line of devices, suggesting their devices will only work with their hub, etc. I decided to use a USB dongle directly from the machine running Home Assistant. I don't really remember what I did but I installed some firmware onto it, blindly following a tutorial :-).

Sensors and Stuff

- name: "Total Consumption"
  unit_of_measurement: "kWh"
  state: "{{ (states('sensor.electricity_meter_smartenergy_metering_summation_delivered') | float * 1000/3200 | float / 1000) | round(2) }}"
  state_class: total_increasing
  device_class: energy

One of the nice things about energy monitoring in Home Assistant is the ability to pull in information about CO2 emissions. We pay for "green electricity" but of course it all comes from the same place, so it's good to keep an eye on this and run larger appliances when carbon neutral production is up. At some point I'd really like to get another one of these and strap it to the front of my gas meter.

- name: "Rain"
  unit_of_measurement: "mL"
  state: "{{ (states('counter.raindrops') | float * 4) }"
  state_class: total_increasing

Along with two actions. The first is triggered by the sensor, and increments the raindrop counter by one. This is multiplied by four by the sensor template since on average the bucket tips ever 4mL. The second action resets the counter at the beginning of ever hour.

The End :-)

I'm not sure what else I'd like to add, but for some reason I do enjoy collecting data pointlessly, so perhaps a few more interesting sensors. Indoor CO2 is something I'd like to keep track of in our office/lounge since we spend a lot of time in their working and can find ourselves feeling a bit drowsy at times. I also got a pair of Ikea zigbee sockets, but I don't know what to do with them yet.

Wanting to leave a comment?

Comments and feedback are welcome by email (

Related posts:

Tags: computing

Blog IndexPosts by TagHome

Copyright 2007-2022 Aaron S. Jackson (compiled: Sun 9 Jan 21:31:05 GMT 2022)