Sonoff Zigbee devices constantly going offline

Then you can simple disable the ZHA integration and try zigbee2tasmota instead.

https://tasmota.github.io/docs/Zigbee/

Sonoff ZbBridge (75) is set as the default module. If you’re switching back to Zigbee2Tasmota from ZHA make sure module is configured back to 75.

Just to clarify some of the background to this issue…my understanding is that there are problems with Zigbee devices co-existing with wifi networks (which surprises me, given how prevalent wifi has become in homes these days). But anyway…
(How) would zigbee2tasmota help with these problems?

That is not the main problem (the coexistence is easily solved by having your wifi channel(s) on one side of the 2.4 spectrum, and your zigbee channel on the other side). The reason for that is EZSP (EmberZNet Serial Protocol) is not a robust protocol in the way that it appears not to be designed to handle the type of packet loss that can often occur on home WiFi networks.

With ZHA you have
zigbee device ->(zigbee) → zbbridge → (serial over wifi) → zha interpreting the zigbee messages → HA

With zigbee2tasmota you have
zigbee device → (zigbee) ) → zbbridge (tasmota interpreting thezigbee messages) → (mqtt over wifi) → mqtt → HA

The zigbee messages are no longer transported over (serial over ) wifi, but read on the zbbridge themselves.

Another way to cut down on the conversions and hops would be to use a USB Zigbee controller in the device running HA. I use the HUSBZB and have been very satisfied with my growing network of Zigbee devices.

I did think about a USB controller, but my setup is complicated by the fact that (a) I’m running HA in a guest VM on an ESXi host and (b) in a Docker container.
I had problems a couple of years ago connecting a USB device to one of the guest OS’s and never revisited the idea.

Well, there are other options to continue using ZHA and not having an USB stick :

and probably more.

1 Like

Thanks for those recommendations. I’m based in the UK - do you happen to know if the Zig-star ships to the UK? (it’s out of stock at the moment, but the price is quoted in Euros, which suggests it’s not exclusively for US customers). I can’t find any indication on the website re. where the supplier is based.
Does anyone have any experience of configuring a Zig-star for use with HA? e.g. does it require any specific hardware, and is it relatively straightforward for a non-expert to do?
I’ll give zigbee2tasmota a try in the meantime. I’ve just repositioned my Sonoff hub to place it further away from the wifi access point, to see if it helps, but from what you’ve said it probably won’t.

1 Like

Better ask @mercenaruss

Hi @itm1960 ,yeah we ship to UK or any another part of the world.
Now of course we are out of stock,will be back soon as possible. Working hard on it.
I send preflashed and tested,it’s very simple configuration,just one line in your Z2M config or ZHA.

I’ve been checking out zigbee2tasmota in the meantime, and have configured the Sonoff Zigbee Bridge module to ZbBridge(75 ). I’ve tried pairing each sensor using the ZbPermitJoin command, and they appear on the Tasmota map - see below.
For some reason 2 of the sensors aren’t connected to the Coordinator - I have no idea why. I also don’t see any new devices in my HA Developer Tools console. Do I need to manually add entries to configuration.yaml for each of my sensors?

Yes you do.

I’ve had a stab at the yaml required to define my PIR sensor, but can’t work out what to use for payload_on. This is what I have so far:

binary_sensor:
  - platform: mqtt
    name: "PIR Sensor"
    state_topic: "tele/zigbee-bridge/SENSOR"
    device_class: motion
    qos: 1
	payload_on: ???

This is the MQTT message that I get when I trigger the motion sensor:

    "ZbReceived": {
        "0xD6EA": {
            "Device": "0xD6EA",
            "0500<00": "010000010000",
            "ZoneStatusChange": 1,
            "ZoneStatusChangeZone": 1,
            "Occupancy": 1,
            "Endpoint": 1,
            "LinkQuality": 84
        }
    }
}

What do I need to specify for payload_on, and do I need to add anything else?

Try :

binary_sensor:
  - platform: mqtt
    name: "PIR Sensor"
    state_topic: "tele/zigbee-bridge/0xD6EA/ZoneStatusChange"
    device_class: motion
    qos: 1
    payload_off: '0'
    payload_on: '1'

Thanks - I’ve defined my sensor as per your YAML, but I’m not seeing any MQTT messages for that state_topic when I trigger the PIR (tele/zigbee-bridge/0xD6EA/ZoneStatusChange).
I have the Topic defined in the Tasmota config (on the Sonoff Zigbee Bridge) as “zigbee-bridge” - it doesn’t contain the Device Id anywhere.
Should I be including a device variable somewhere in the topic for that state_topic to be usable?

To get around this issue I’ve been exploring ways of sending sensor values to separated MQTT topics…
Using info from Zigbee - Tasmota I created this rule on the Tasmota console:

Rule1
  on zbreceived#0x3AB1#ZoneStatusChange do publish tele/zigbee-bridge/door/SENSOR %value% endon
  on zbreceived#0x3D32#ZoneStatusChange do publish tele/zigbee-bridge/pir-study/SENSOR %value% endon
  on zbreceived#0x520C#ZoneStatusChange do publish tele/zigbee-bridge/pir-hall/SENSOR %value% endon
  on zbreceived#0xD6EA#ZoneStatusChange do publish tele/zigbee-bridge/pir-lounge/SENSOR %value% endon

Rule1 1

Now whenever I trigger a sensor I get MQTT message on a topic specific to the sensor. For example:

23:16:36.820 MQT: tele/zigbee-bridge/pir-study/SENSOR = 0

The problem is that I don’t know how to interpret this value in my HA config. If I listen for the tele/zigbee-bridge/pir-study/SENSOR topic, for example, I simply get a value of “1” when the sensor is triggered.
The config below does not pick this up:

  - platform: mqtt
    name: "PIR hall"
    state_topic: "tele/zigbee-bridge/pir-hall/SENSOR"
    device_class: motion
    qos: 1
    payload_off: '0'
    payload_on: '1'

Any idea how I can monitor for the value of “1” which is now being returned from each MQTT topic?

OK it looks like HA is actually setting my binary sensors to “on” or “off” based on these new topics.
The only thing I can’t get is battery levels from the sensors, which I could get from the ZHA solution. Is that something that I will have to live without if I use zigbee2tasmota?

I had the same setup as you and the same issues. Moved to a Conbee II about a month ago (bought from amazon under £40) and I think i’ve had one device drop off since then (and I think it was because somebody was messing with the light switch).

Does your Conbee solution report battery levels for your sensors? Both ZHA and the Tasmota interface report battery levels, but I can’t get them reported in HA using zigbee2tasmota - there’s a suggested solution using a Rule at the link posted by francisp above (thanks Francis!), but I couldn’t get it to work in my config.

The ConBee reports battery level for all my devices, however I don’t use any of the sonoff sensors.
But I can tell you that for most devices the battery level is more or less useless (except for Philips). I had some sensors reporting 100% over 3 years and then suddenly from one day to the next they went offline due to an empty battery.