Issues with Sonoff Zigbee bridge and sensors - sensors going offline

Hello all,

I’ve setup my Sonoff Zigbee bridge and sensors as per the official guide - https://zigbee.blakadder.com/Sonoff_ZBBridge.html.

Everything was working fine for a day but it seems like sensors are going offline time to time (sometime it comes back up again) and sometimes I have to restart home assistant service or if that doesn’t fix the issue, I have to remove the sensors and then re-pair them with the bridge.

Some of my sensors are only 2~3 meters away from the bridge so I don’t think it’s a signal issue.

Has anyone experienced the same issue like me? Any idea how to fix this?

Thanks a heap…

I am trying to learn about my ZHA zigbee setup. I wrote some code to monitor my devices and see how they behave, I am still learning. My code is a bit rough, but if you can figure it out it might give you some insights:

Thanks for this. However I’m looking for any clue what could be the reason for devices to go offline time to time? Could it be hardware issue with Sonoff sensors or some firmware issue with Sonoff bridge. With your tool I can see the last online time and RSSI of the current online devices.

I think the answer to your question is yes you can see the most recent RSSI and LQI values for all of your devices. A quick view of the current LQI and RSSI for all your devices in shown in the scrolling display.

The program is doing two things in terms of logging, first just scrolling a display of the most recent status of all of your devices on the screen and second logging the current status to a SQLite database.

The first picture below shows the scrolling display, I have highlighted a device I unplugged last night. It’s online status in the third column is ‘F’ indicating it is offline according to ZHA. You can go to the SQLite database find when ZHA set the device to offline and also when the device was ‘last seen’ by any of the devices on the network. This is interesting, in that ZHA takes a considerable amount of time to declare the device offline, in the case here, the device was last see at 7:38 pm, but did not go offline until 9:40 pm. You get these values from the SQLite database. Shown in the second picture.

The online scrolling display also shows the most recent LQI and RSSI numbers for all the devices, these are columns 6 and 7 in the display. Shown in the first picture.

In the third picture, using the program ‘DB Browser for SQLite’, a simple graph of both RSSI and LQI over time for a Aqara Lumi weather sensor.

I do have a bug in my program ws06.py, which I will work to fix today. I was testing unplugging devices last night and uncovered that I am not properly tracking some off line devices if they did not have a list of ‘neighbors’ when they went off line.

Interested in your feedback if you get it working.