I'm devloping Zigbee devices using the Espressif Arduino libarary . This means I have to repeatedly join and remove devices as I develop and debug code. It seems that HA "remembers" these devices when I rejoin them. I'd like to be able to clear all prior knowledge to make sure I have clean new HA host each time I join a test device. Using ZHA
#Is it possible to clear ALL prior knowledge of a Zigbee device removed from HA?
1 messages · Page 1 of 1 (latest)
Can’t help but I’m curious about your project. Are you looking at powering these off batteries? I’d love to look at a DIY Zigbee sensor but unless it’s battery powered, with life time measured in months it feels a bit… pointless next to plain old wifi.
There are number of Zigbee enabled ESP32-C6 and H2 dev boards that are supported by the Espressif Arduino ESP32 libraries with examples. Good battery life, using Zigbee or WiFi, will require the you create code that deep sleeps and wakes up peridocally to read sensors and report
What kind of battery are you using?
One of my projects is an epaper display. ESPHome, wakes once an hour etc. I get about 3 months out of a charge with a small lipo. But for a Zigbee based sensor I’d want updates at least once every 5 mins and months out of a CR2032, which is how my off the shelf stuff does.
I use a 2500 mAh lipo and expect it to last at least 18 months. I wake up every three minutes but only transmit if the sensor reading vs previous reading exceeds a defined delta or the time since last transmit exceeds a defined delta. NB. The H2 deep sleeps at 9 uA and the C6 deep sleeps at 19 uA unless the board is a leaky design. H2 also uses less power to TX than the C6. Good C6, Adafruit. Good H2, Olimex. I have charged Lipos and swap them in as needed. I don't think the Espressif chips are as power efficient as the Zigbee chips used commercially but haven't found any devboards using other chips with Arduino support. I tried using ESPHome with Wi-Fi but but couldn't keep the connectime low, and coudn't make the YAML do exactly what I wanted vs using Arduino and MQTT. That once-an-hour epaper battery should last years. You should get one of these to see what's actually happening
https://www.nordicsemi.com/Products/Development-hardware/Power-Profiler-Kit-2
This is the power profile of a C6 based Zigbee sensor that sends 8 analog values to Home Assistant that I'm stress testing sending about every 35 seconds
I might use the PP2 to power to one of my commercial Zigbee sensors for comparison
i think you have to use an external tool like mqtt explorer to do that
In terms of super low power you’d be forced to use one of the 8 bit TI parts, a CC2530. I actually have a dev board for one but didn’t get anywhere with it. The tooling is horrific. Was very excited when I saw the ESP32s have Zigbee now but unless you can run them off a couple of AA batteries or I’ll stick to WiFi.
Yeah I’m sure my epaper display can tuned to reduce power further. I wanted to revisit that one actually and look at switching to a bigger 4 colour screen. They are fantastic; I love my little screen showing the weather forecast, upcoming calendar appointments and house temp info. I wish Nabu Casa would make one all wrapped up with a nice config UI. It’d be cool.
The OP is using ZHA. But for testing a Z2M setup might be more flexible.
oh i didn't even realize they were different protocols. i guess that's why they're two options, though, makes sense. I've only used Z2mqtt
ZHA is the built in Zigbee stack. Doesn’t use MQTT. Haven’t played with z2m as much as ZHA but certainly found ZHA a lot simpler to get going with. 100 devices now, all off a Conbee dongle. Though of course Z2M has its fans just as ZHA does. The beauty of choice. 🙂
Removing the device from HA via the device page should clear all the data from the zigpy database. If you re-join it afterwards, it should be "fresh".
This is an area we need to improve though. We should have something like a "re-interview" button to basically do this automatically.
Nope ...even though the Zigbee database is free of the removed device, it is I checked, HA remembers history , name, entities, etc. this can be handy but there should be an option to clear it all.
You might have seen it, but incase you haven’t: https://community.home-assistant.io/t/delete-history-of-one-sensor/87203/9
Home Assistant Community
In my case I wanted to clear some graphs I needed to use sqlite3: sqlite3 home-assistant_v2.db and then I selected specific timeframe from states: sqlite> select * from states where entity_id='sensor.dust_particle_sensor' and last_updated < '2019-05-26 13:18:09.864454+00:00'; and deleted sqlite> delete from states where entity_id='sensor.d...
I've thought about doing that but didn't want to take a chance corrupting the database