Diagnosing Sonoff Zigbee Contact Sensors Failures

Hello,

I've got a very simple Zigbee setup with two sensors that remind our house to keep the doors closed (we have a cat who we don't want to get out). Right now I have two Sonoff SNZB-04 ZigBee contact sensors, but they have repeatedly gotten into a bad state.

The mode of failure is that sometime after setup updates stop getting detected - i.e. the sensor will get 'stuck' in one state (open or closed). I've tried factory resetting them (~5s long push on the button) and replacing their batteries with fresh batteries. I see what I expect to see (The hubitat finds a sensor that it already knew about), and I will temporarily see events from the sensor, but very quickly (~1 - 12h) it goes back to being stuck on one state.

My setup is quite simple - all the sensors and zigbee hardware are roughly in a line. The furthest sensor is ~30ft from the hubitat, then ~20 feet from the hubitat is a zigbee repeater, then ~10 feet from the hubitat is the other sensor.

How can I narrow down where the problem is? I can't tell which link in the chain is going wrong. The sensor that is closer to the Hubitat tends to work for longer - so I suspect that the mesh it messed up somehow? I might be getting overlap with 2,4ghz wifi (channel 9) and zigbee (channel 20).

Are they the only two of those sensors you have?

Are they too far away from the hub, and too far away from repeaters? (If you moved one 10ft from the hub, in the same room, will it stay connected "forever"?)

The symptoms you describe sound a lot like a mesh issue, which is why I ask those questions. :slight_smile:

Distance, caused by physical interference: metal door/window frames, HVAC duct work in the wall, mirrors and so on are more likely to be an interference issue than channel the way you have it set. I'm guessing that you've got something between the hub (in the walls) and the device(s) that decrease the expected distance.

1 Like

One is 10ft from the hub!

S2         R          S1         H
|---10ft---|---10ft---|---10ft---|

Where:
S1 / S2: sensor 1 and 2
R: Repeater
H: Hubitat

They are the only sensors we have.

There's a wall between S2 and The hub, which is why I put in the repeater (there is no wall between S2 and the repeater). S1 and the hub are line-of-sight.

Well that puts a big dent in my hypothesis, doesn't it? :smiley:

Take a look at the route info and see if there are any repeaters the problem lights are associated with that could be your problem:

http://<yourHubIP>/hub/zigbee/getChildAndRouteInfo

Then see if this helps with interpreting it:

1 Like

So, initially, there was nothing:

Parent child parameters
EzspGetParentChildParametersResponse [childCount=0, parentEui64=0000000000000000, parentNodeId=65535]

Child Data

Route Table Entry
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused

After re-pairing everything this looks better:

Parent child parameters
EzspGetParentChildParametersResponse [childCount=0, parentEui64=0000000000000000, parentNodeId=65535]

Child Data

Neighbor Table Entry
[Kitchen Repeater, 79FE], LQI:254, age:3, inCost:1, outCost:1

Route Table Entry
status:Active, age:64, routeRecordState:0, concentratorType:None, [Front Door, C37A] via [Kitchen Repeater, 79FE]
status:Active, age:64, routeRecordState:0, concentratorType:None, [Kitchen Door, EB98] via [Kitchen Repeater, 79FE]
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused

At this point we're back to a good state - but for how long? I will update tonight if I can still see updates from the sensors. Thanks for the zigbee mesh url! It was very helpful!

FYI - your repeater density is really low. And it is a fallacy to measure a radio path in linear feet. For example, the table you posted indicates that both your sensors (Front Door, Kitchen Door) communicate with the hub via the single repeater in your mesh (Kitchen Repeater).

If anything happens to that repeater (even momentarily), both those sensors will drop off the network. There is no alternative path for them to communicate with the hub.

My recommendation would be to:

  1. Place the hub more centrally, or
  2. Have more repeaters.
2 Likes

That makes a lot of sense, and I am aware that radio signals do not penetrate all things equally well, but I really want to emphasize how close these things are.

The hubitat is circled in green, the corner of the door with the contact sensor in red.

The repeater that the contact sensor is apparently using is around the corner in the kitchen (though it is closer in linear space, there are ~2 walls between them).

Placing the hub more centrally is difficult - it does not have wifi and I only have routers with wired plugs on either side.

I could place another repeater, but...I do not know where I would place it? I could put one ~7 feet from the hubitat instead of ~10...but I'm not sure how much that would help given it already seems like a very favorable signal situation? Like - I'm reluctant to spend more money without a theory about how to correct the signal propagation.

Edit: 6 hours on, it appears to be working.

I have 6 of those Sonoff sensors and I had to put a small piece of folded thick paper over the battery to keep it connected. Otherwise the battery would lose contact. Or you could get a couple Linkind sensors on sale on Amazon right now for $12.99 (for two). They’re made much better than the Sonoff ones.

3 Likes

In the photo it looks like there is a Wifi router near the HE hub. When wifi and Zigbee antennas are in close proximity (within a meter or so), side lobe interference (apart from the data subcarriers of otherwise non-overlapping channels) is sometimes strong enough to cause issues. If you're still having problems you might try moving them farther apart.

3 Likes

Nice catch!

@drex - one possible solution to this is to relocate your hub. There is built-in support for some TP-Link USB WiFi dongles. There are others who use a wireless ethernet bridge for their hub. Even a really old 10Mbps wireless ethernet bridge is more than adequate for the hub's needs. I've seen some on eBay for as low as $5-10.

3 Likes

Thank you everyone!

@Ken_Fraleigh Thank you for the tip, I've noticed they are dodgy. The Linkind tip seems great - I just got these because I found an old topic with people saying they were using them.

@Tony and @aaiyar you're absolutely correct! The hubitat has a short ethernet cable and a relatively short usb cable and the router was the most convenient source of both. I hadn't thought at all about proximity but that makes snese. I'll relocate it further away.

2 Likes

FWIW, I have a WiFi access point, and two zigbee coordinators all within 3 feet of each other.

I just use WiFi channel 2, and zigbee channels 20 and 25 for the zigbee hubs, in ~2 years, there’s been no significant interference.

However, I do have a very large number of repeaters for both zigbee networks. Perhaps that mitigates some interference issues.

1 Like

I've gotten away with locating my hub closer to my router than recommended also. I think antenna orientation may come into play (as well as channel selection)... but as they say if it ain't broke don't fix it so I haven't worried about it (I've got plenty of strong repeaters nearby as well). Could be that some of the 'weakness' I attribute to my C-3's Zigbee radio is actually caused by the non-optimal placement I'm using.

I did however happen to see this 'fix' actually work first hand when helping a friend troubleshoot his ST setup. Zigbee devices in an adjacent room became flaky when he did some equipment rearrangement; moving his wifi router just a foot further away from his ST hub away immediately fixed the issues.

2 Likes

Well, I moved my hub to be ~7 feet away from the wifi router (and also changed the 2.4ghz channel to 2 - I am using zigbee channel 20). Unfortunately, unplugging and re-plugging the hub dropped both of the sensors off the Route Table...but I am still getting updates from them?

Parent child parameters
EzspGetParentChildParametersResponse [childCount=0, parentEui64=0000000000000000, parentNodeId=65535]

Child Data

Neighbor Table Entry
[Kitchen Repeater, 79FE], LQI:255, age:3, inCost:1, outCost:1

Route Table Entry
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused

For now it seems like the system is in a good state and I have a much better idea about how to diagnose what is going wrong and ideas for future improvements (different sensors, a wifi dongle, etc).

Thank you everyone! Happy Holidays / Merry Xmas!

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.