"Zigbee Home" DIY firmware project aim to provide similar functionality to ESPHome

It is still in very early development and only have some basic functionality, but FYI, “Zigbee Home” (also refered to as “zigbee_home”) is a new open-source DIY Zigbee firmware project by @ffenix113 that aims to (eventually) provide similar ease-of-use and customizability features to ESPHome to allow users to use its CLI application for generating custom firmware their own DIY Zigbee devices (based on nRF52840):

https://ffenix113.github.io/zigbee_home/

https://github.com/ffenix113/zigbee_home

If you can program code in Go programming language (or in C) then suggest check if can help out:

The initial goal of the project is to support nRF52840 microcontroller SoC based devices (with expansion to nRF53 series) and currently has basic support for some inexpensive development boards:

Other than following the ESPHome concept it also seems to take inspiration from PVTO (Zigbee Switch Configurable Firmware) which also allows users to make DIY Zigbee devices but is closed source:

https://ptvo.info/zigbee-switch-configurable-firmware-router-199/

PS: ffenix113 has also upstreamed patches to the Zigbee2MQTT project so it can support devices that can change features dynamically:

PPS: ZHA integration might need something similar if want to use custom clusters and attributes, see:

1 Like

Hello Hedda,
I am the creator of this project, hank you for noticing it! I was not expecting it to get traction so soon, but I welcome new people and ideas that they bring.

If you want to ask or propose anything - I would be glad to answer!

Fun fact: this project started because I wanted to measure CO2 level in our apartment :slightly_smiling_face:

3 Likes

Tip! Check out these for more inspiration from DIY device projects also using custom Zigbee firmware:

https://databyte.ch/project/

Thank you for great examples. It is always a pleasure to see such custom projects, software and hardware alike!

I also appreciate that they all try to help with something, and I hope that my project would help someone as well.

1 Like

Hi, could this be used with for battery powered devices?
Or is that still a work in progress

Hi, could this be used with for battery powered devices?

Hello ferbulous,
It is a work in progress, but operating on batteries is one of the main ideas for this project as well.

And yes, it is already possible to power the device with batteries(already did that myself), though I have not power profiled it yet.

2 Likes

Yes, battery operated ”sleepy end devices” is one of the major benefit with Zigbee (as well as Z-Wave and Thread) over WiFi, however note that it is not always suited to try to make a battery powered devices for every scenarios/purpose as they are not meant to recieve command messages and reply directly on demand, because their radio ”sleep” so only wake up when they need to send an message and it is only then that they can also recieve a message back (which should just be for things like command to change Zigbee channel or perform OTA firmware upgrade).

Sleepy battery powered Zigbee end devices (Rx is off when idle) are great for sensors that only report in when there is a state change (like for example a door/window sensor or remote) and decices that just report in on a timed intervall (like for example a temperature sensor that simply report in once every 5 minutes).

Tip when making such devices is that it is generally a good idea two use either several lithium batteries or larger high-capacity types lithium batteries. So instead of just a single CR2032 button cell you can either stack multiple of such batteries or use larger ones, so at least use CR2450 or CR2477 (instead of the more common CR2032 which has very low capacity), or batter yet if there is room enough in the device then use CR2 (CR-2/3AZ) or CR123A, all of which are still commonly available. Alternativly stack alkaline batteries like LR14 if there is more room. If making a rechargable device then of course try to go with replacable 18650 batteries.

Newer sleepy Zigbee end devices based on modern radio chip (like nRF52840 or newer) and properly configured power profile do normally only need their batteries replaced every other year or so depending how often they need to wake up and report state updates.

Remeber that also need to add battery reporting, which is something that can be extremly tricky to trim in with lithium batteries because of their battery drain profile.

PS: I personally hate replacing batteries so prefer mains-powered devices, but when it have to to be a battery powered device then I think the batteries must last two years or more before needing replacement, otherwise it is a pain when uou have more than a few battery powered devices.

Very nice project. Would be awesome to be able to build zigbee devices with the same ease ESPHome offers.

I’m building my own rotary dimmer switch and used a TI chip with firmware based on their SKD for the first version (GitHub - dagroe/zigbee-rotary-dimmer-switch: a rotary dimmer switch). Now since there is the ESP C6 available I am looking into that but it seems I should also check out the nRF52840 based on this project.

@ffenix113 have you followed the discussion over at ESPHome regarding the C6 chip?

2 Likes

I might have to rephrase my question
Would i get an extended battery life by just flashing the firmware on the zigbee chip or would it require extra components on the pcb to achieve that?

This is great, so basically i could just bind the dimmer to the zigbee lights if it’s supported?

Not extra hardware, just opimized usage and power code for sleepy devices.

1 Like

Don’t want to hijack this thread, so I created on here: DIY Zigbee rotary wall dimmer

yes, you could bind it directly to a light (if you are fine with the commands being sent) or use and customize it with deconz, ZHA, or zigbee2mqtt.

Hello dagroe,
No, I don’t think that I saw it. Though in discussions of my project @Hedda also asked about ESP support. To sum it up: for now I am focusing on making project good enough for use based on nrf52840 devices, and in the future support for other platforms might be discussed as well.

Would i get an extended battery life by just flashing the firmware on the zigbee chip or would it require extra components on the pcb to achieve that?

It would depend on the previous firmware. The board configuration would define absolute minimum power consumption, while firmware would define ability of the device to achieve that lowest power consumption.

My project will be in lowest power consumption state all the time, except when polling the sensors, which is made possible by Zephyr. For router device this might be different, but routers are not battery powered, so it is not applicable here.

Not directly to other Zigbee devices, but maybe with the help of Zigbee2Mqtt it could be configured to control another device directly.

@dagroe FYI, I asked the same question in an open discussion here → Espressif ESP32-C6 and ESP32-H2 radio SoC support via ESP-Zigbee-SDK? · ffenix113/zigbee_home · Discussion #7 · GitHub

@ffenix113 FYI, dagroe is referring to this specific ESPHome feature request discussion here that is requesting native Zigbee (and Thread) support inside the ESPHome firmware on ESP32-C6 and ESP32-H2 based SoCs → Zigbee/Thread support on the new upcoming ESP32-H2 variant? · Issue #1397 · esphome/feature-requests · GitHub

1 Like

FYI, ffenix113 now added ADC (Analog To Digital Sensor) + support for required soil moisture sensors:

https://github.com/ffenix113/zigbee_home/discussions/5

That should as an example allow one to make a DIY Zigbee flower and plant sensors for soil moisture with configurations can in theory be more easily customized and tweaked via the YAML configuration:

1 Like