Devices acting as Router, deleting and re-adding devices

I have just migrated from a Sonoff Dongle-P to Dongle-E, it is plugged into a rasp pi 5 via a USB Extension cable.

I had 4 devices all working fine on the P, but now on th E - 2 devices are ‘unavailable’.

Several times I have removed batteries on the unavailable devices, let them sit, deleted the devices, re-added and paired them, rebooted, but still they are ‘unavailable’.
I have not touched the ‘available’ devices.

In topology it appears one of the unavailable devices is using another (the available device) as a router.

I suspect some configuration is not refreshing properly since I migrated, is there a way to reset everything, I am just at experimental stage, so setting up again is not a big deal. If you delete the ZHA integration and devices from ZA settings, will that clear all DB’s.

I have a related post running:

Thoughts appreciated.

Hello,

have you factory resetted the device according to manufacturer instruction before adding it again?

Yes thanks, I think that may have helped, I found by holding the pair/reset button on the devices for 10 seconds directly after ‘Deleting’ the device within HA has sorted this, I understand the devices need to be ‘woken’ when deleting within HA.

I deleted all devices apart from the Sonoff TRV, and unplugged the Dongle for several hours.

This deleted and removed the ‘router’ device (a SNZB-06P human presence), then I added the battery powered devices to see if they would connect directly to the coordinator, which they did.

The SNZB-02P Temp and Hum. sensors measurements were way off when I first repaired it, but over the last hour or so these measurements have come down and are slightly more accurate.

Is there any need for an update the Firmware on the Sonoff Dongle-E V2, it has Sonoff Firmware: 10.3.0 build 297, I have just bought the device, yet this version is dated 2022-06-30, so few revisions behind - the latest version is 7.4.4.

Hello,

I don’t have an opinion about the need for updating the firmware.
Happy you could get all paired.
The zigbee network usually resides in the dongle memory itself.

Thanks, I’ve not thought to ask Sonoff direct, which I will do regarding the FW upgrade.

I have now moved all the equipment to another address, all the sensors are working, apart from the SNZB-02P Temp and Humidity Sensor again, it is just showing the same measurement data on a flat line, in topology it shows it as connected with a good signal.

In developer tools/statistics the 3 entities for the devices had a button ‘fix issue’, which when pressed stated, ‘entity has no state’ and comments about something being orphaned, anyway have pressed ‘fix issue’ and will see if that helps.

I will repeat some of my above actions, ie wake device, delete it in HA, reset it and repair it.

Regarding resetting the device, in the official manual:

Page 14, it states:
Reset the device to factory settings by “Delete device” in the eWeLink App.

I’m not using the eWeLink App, I note this post:

I will also ask Sonoff to give an official line on how to reset the device - if not using the eWeLink.

OK Have sent query to Sonoff tech.

I have deleted the device, but it still appears in the default ‘Overview’ dashboard as:
‘entity not available - sensor.ewelink_snzb-02p_humidity’
and
'‘entity not available - sensor.ewelink_snzb-02p_temperature’
the dashboard should autoupdate it has up until now - with other devices removed and re-added.
I read about HAOS needing a ‘flush entities’ or ‘cleanup’ feature, i also read how one can look in ‘.storage’ and see if anything lingers in:
‘core_ device_registry’ and ‘core_entity_registry’

I cannot see the ‘.storage’ folder in File Editor, and am unsure what to look for and delete in the above files.

Any pointers to help one have a go at this … Thanks.

UPDATE - despite several restarts, and waiting good half hour, the ‘unavailable’ devices have just disappeared from the default ‘Overview’ dashboard … why did that take such a long time ???
I removed the battery after waking the device and deleting it, does HAOS then have a longish ‘refresh’ interval for its default ‘Overview’ dashboard.
I have re-added the device, which indeed had a delay in it appearing in the default dashboard.
I wish I’d known the server did this, would have saved a bit of consternation.

UPDATE: Just found under File Editor’s configuration ‘Enforce Base Path’, which allows you to navigate outside of the Home Assistant directory, but still can’t find ‘.storage’, its inside /config, but cannot find that either, is the ‘.storage’ folder hidden ?

Hey, you are mixing up different topics. I don’t follow you much.

But I have same Sonoff RH sensors and for a while I wanted to trash them, then looking very carefully at zigbee network made them steady, no failure.

I have no interferences, first house is more than 500 m away nothing around me.
My wifi network, that could interfere was set to a very “away” channel from the zigbee channel, but still I was experiencing failures.
I have routers device (mains powered), more than end devices (battery powered) and the Sonoff sensors were maximum 4 m from the routers.
Still having failures.
My dongle was connected via USB hub externally powered.
Still having failures.

Then I let the ZHA integration to choice automatically the best channel, from that day I did not have any failures on zigbee network for the last 6 months, before I had it at least once a month.
Look for zigbee network optimization on home assistant website and patiently follow it, that is my suggestion.

About the default dashboard, I don’t use it, can’t say if it fast or slow

Thanks, yes I should write more concisely !

Thanks for your advice, comment regarding the ZHAs choice of channel I have noted.

Seems there is ‘lag’ (delay) in how HAs dashboard, and I suspect the devices themselves update and give you feedback through HA, and I understand that is partly just how zigbee networks work (for the devices), a minimum amount of chatter, its just a bit difficult trying to set it up unless your aware of it, devices get stranded, or half work, until you clear them and re-pair them, then they seem happy.

Hi,
Just look for devices in the devices and entities list under the setting menu, it is easier.

This is the most fragile kind of Zigbee network, since there is only one path between coordinator and each end device, making it very vulnerable. To create a robust mesh you should have a lot of routers, so there are many different routes for messages to take. The routes used change all the time in response to traffic and conditions.

Yes, it is. Files in it are also json, so you can view them but not edit them.

The delay is probably because of the way Zigbee works. The coordinator doesn’t poll sensors, it waits for them to report. Sensors do this when something changes, but otherwise only check in at set intervals. In a motion sensor, for example, you might also have sensors for temperature, light level and battery level. In an unoccupied room, temperature and light may report every few minutes; battery only a couple of times a day.

When you restart HA battery-powered devices will all show as “unknown” to start with while the coordinator waits for one of the associated sensors to report - and it may take half an hour or so for every device to check in.

Once a battery-powered device has been contacted, if no further messages are received ZHA will wait for six hours before before reporting it as “unavailable”. During this time the states it is reporting will not change.

You may be making things unnecessarily complicated. Zigbee is designed to be a bit of a black box and monitoring can be a rabbit hole as the network configuration changes all the time. Get some more routers.

Several hours reading here, but all very useful. :laughing:

The Home Assistant Cookbook - Index

Thanks for your comments, and Cook Book link, appreciated … Yes I intend to get some ‘router’ sensors installed to help the mesh.

Taken a few days of ‘mystery’ (‘black box’ as you say) but think I have a handle on how these work, interesting to have some rough idea of delay times given for polling between devices and server, I did do a lot of reading, but this fact either did not jump out of the page, or I didn’t come across the information.

All is currently working fine, which is good news.