XHS2-UE Contact Sensor

https://www.zigbee2mqtt.io/devices/XHS2-UE.html

Is anyone using these Contact Sensors with Zigbee2Mqtt? They seem to pair just fine and when they are connected, they work really well. However, I have two issues with them:

  1. They seem to drop connection to the router in which I have them paired and attempt to reconnect to the coordinator, eventually losing connection all together. Is there any way to make them ‘sticky’ so they don’t go rogue and try to re-path themselves? I currently have several Sonoff Zigbee outlets in strategic positions throughout the house to strengthen my network but they don’t seem to be helping. I’m considering replacing them with the Ikea Outlets which I’ve read good reviews for repeating signals. Any other thoughts?

  2. The battery reporting on these devices is really strange. When I first add them to the network or replace a battery they report @ 100%. But within a day or so drop to 42% and slowly depreciate from there. Has anyone found a fix for this?

Oh, and my Zigbee Coordinator is a Sonoff USB 3.0 dongle with the latest firmware.

1 Like

Update…Switching over from the Sonoff Outlets to the Ikea Outlets to act as repeaters has made a HUGE difference in performance for these XHS2’s. Now if I could just figure out the battery reporting on these sensors!

1 Like

Maybe this issue → Sonoff S26R2ZB Smart Plug Zigbee Router devices by ITead disconnect from network after a day or two - Firmware bug or? · Issue #10282 · Koenkk/zigbee2mqtt · GitHub

If anyone has found a way get these XHS2-UE to stay working, PLEASE let me know. I’ve tried different routers (Conbee, Sonoff), I’ve tried ZHA, Zigbee2MQTT. I’ve tried changing repeaters multiple times. I’ve tried replacing batteries. Nothing I do works, they still go offline. They all have a firmware from 2016.

Thank you!

1 Like

I’ve been fighting with these things for almost 6 months now and I think I finally got them stable. I have about 25 of these scattered throughout my 2 story house and the only consistent thing about them for a while was the fact they loved to drop off the mesh. I added a couple sonoff plugs to play as repeaters and that really didn’t help at all…So I scrapped the Sonoff outlets and added 4 ikea zigbee outlets (I read they are very good repeaters) and that seemed to make an improvement but still had issues from time to time. The last thing I tried was changing my Zigbee channel to 25 in Z2M and moved my router channel for 2.4g to channel 1. After repairing all the plugs and forcing a couple to talk to repeaters closer to them then the ones they originally tried to pair with…all seems to be very stable.

Now if I could only get these damn things to properly report a battery status I would be happy! I put a brand new battery in and within 24 hours they show 40% charge?! I guess nothing is perfect.

Hopefully you can get these working for you!

1 Like

+1 about the battery reporting. I just added one of these to my HA. Love that they also have a temperature sensor in them. For me, the battery status remains stuck at unknown. Maybe it’ll show up over time? Hopefully I can get that sorted, because you cant beat the price on these things.

The battery should update within 24 hours. They are slow to report. If not try repairing it and wait another 24 hours. But don’t get to excited, as I mentioned in the post above, the battery seems to report in weird increments going from 100% / 40% / 27% / 16% / 8% / Dead. It drops to 40% really quickly and usually hovers in the 27/16 zone for the most part before another quick decline. Hopefully someone figures out how a better integration for these down the road, as they do work fairly well for the price point.

Thanks for the reply, I’ll let it bake a day or two and see if it reports in. Bummer that the accuracy is kind of garbage, but I suppose at the end of the day, if those wonky increments on the lower end actually infer the battery life, it’s good enough to give us a “low battery” when it gets into the lower range. Xfinity claims in their docs the average battery lifetime is ~5 years. Is that remotely accurate, or laughably optimistic?

5 years?! No…I average about 6 months with some bulk coin batteries I buy off Amazon. I suppose some good duracell’s might last a little longer in theses, but I can’t imagine even a brand name battery would last 12 months. Maybe the Xfinity system poll’ed them a lot less than Home Assistant? No idea, but don’t expect to get more than 7/8 months out of the batteries in these.

1 Like

Thanks, that’s about what I would expect in reality from a coin cell as well…

Have any of you tried pairing one of these recently? I had no problem with them when I first got them in June, but today I can not get any ‘new’ ones to work, though previously-working sensors are continuing to work.

Quick summary of my issue:

  • Using SkyConnect Radio
  • 10 previously-paired XHS2-UE contact sensors work fine
  • Attempted to replace 1 of the working ones that was draining batteries.
  • 5 different spare sensors all have the same behavior:
    1. Sensors pairs with zigbee easily
    2. Sensors respond to requests. For example, repeated ‘last_message_rssi’ returns -83, -75, -79. This is real updating data.
    3. Contact state (open/close) refuses to update
    4. No log messages occur when opening/closing contact with Zigbee integration diagnostic logging enabled

Some background:
I have a SkyConnect radio I am using for Zigbee, and I have a single SONOFF S40LITE repeater in my house.

I ordered 15 of these in June and set up 10 of them. They all worked great, save for the original batteries lasting only a week in nearly all of them. Probably been sitting in inventory for the last 5+ years, and replacing the batteries fixed most of the issues, except for one troublesome sensor.

One sensor would become “Unavailable” after a week or two, and replacing the battery is the only way to fix it. It went unavailable again today, and I wasn’t going to put a 4th battery in it, so decided to just use one of my spare sensors, and this is where the problems start.

I tried replacing the battery draining sensor with one of the spares. It immediately was recognized by Home Assistant and showed up as a contact/temperature sensor. However, the contact sensor never updates. It’s just stuck on ‘closed.’ After messing with it a bit, trying new batteries etc, I eventually tried some of my other spares. I tried 4 spares, and every one is acting the same. Pairs perfectly fine, refuses to update the contact sensor status.

I, just as typing this up, tried unplugging the SONOS repeater and pairing my 5th and final spare while sitting right next to the Skyconnect radio. Exact same behavior: Pairs great, refuses to update contact sensor.

Does anyone have any potential insight in to this? Or if you have a spare one of these sensors, could you test if pairing still works? I don’t think I have 5 faulty sensors, but am afraid to try any troubleshooting steps that will unpair my currently working sensors so am hoping someone else has some ideas :slight_smile:

Not along here, @chris8. I just ordered a 10-pack and have gone through 3. They all pair fine but I cannot for the life of me get them to update their open/closed status.
I have a Silicon Labs HubZ Smart Home Controller.

All 3 pair extremely fast and appear to report all data including battery status, temperature, and open/close status.

Contact state refuses to update. I left one paired for 30+ minutes and woke up other zigbee devices to make sure they saw the devices, still no luck.

I have the same exact issue and I even bought new ones to test. They all REFUSE to report the contact state as anything than closed or open, dependent on what state they decide to report upon pairing. I gave up on them. Drove me nuts, and now I don’t even know what to do with them. The weird part is the temperature status will update no issue. Uhg, zigbee in zha has been having quite a few random issues lately…

I’m going to be spending some time today messing with these. I’ll update this post with any findings in case something ends up being useful to somebody.


  1. Last night, to mitigate interference issues, I moved my 2.4GHz WiFi down to channels 1 and 6, and changed my Zigbee channel to 26. I still have some neighbors on WiFi channel 11 (overlap with Zigbee 26), but at least now my WiFi is as far away from my Zigbee as possible.
  2. All (working) XHS2-UE migrated channels properly by just changing it on the controller in HA UI.
  3. Testing with 4 sensors, last byte of MAC being: 6C, 32, 11, A2. 6C is the sensor that originally worked but drained batteries like crazy.
  4. Moving 1 battery between the 4 devices. Each time I put the battery in I do a Zigbee ‘Add Device’ and allow it to re-interview. Once it identifies it is always links up to the previous HA entities. It always identifies it. If I don’t do this re-pair the device becomes ‘available’ in Home Assistant, so it sees it back up, but the light on the sensor seems to blinks until I re-pair it.
  • 32: Updated from Open to Close a single time, then no more. Pulling the battery makes the entities go Unavailable, putting it back in (no re-pair) makes them become available again, but the Open/Close state never changes.
  • 11: Working fine (it was not the other day)
  • 6C: Pairs great, thinks it is always open.
  • A2: Working fine (it was not the other day)
  1. The Topology visualization does not seem to be a useful tool for debugging this. No correlation between working/not working devices and visualization view.

  2. That ‘blink until re-paired’ thing? Only the non-working ones do that. The working ones blink once when the battery is put on then the light shuts off.


  1. Issued ‘reset_fact_default’ to the working A2. After re-pairing, A2 is now in the ‘not working’ category.

  1. Issuing ‘lasZone:zone_status’ on the sensors returns correct state values, and when you do this manual query Home Assistant also updates the value. It knows if it is open or closed when polled.
  2. zone_state is ‘ZoneState.Enrolled’ on working sensors, ‘ZoneState.not_enrolled’ on not working sensors. Issuing a ‘enroll’ command reports not supported

  1. Rolled back the ZHA integration to sometime in June (when I first got the devices). Everything seems to work now. Starting a bisect…

  1. Pairing process seems to break at Wrap most ZHA exceptions in `HomeAssistantError` (#98421) · home-assistant/core@23839a7 · GitHub

  1. Tips with just that one patch reverted works. The issue is in there somewhere…

  1. This function is missing a return statement. The IASZoneClusterHandler init attempts to index into the (unreturned) result to print in a log statement. No other place tries to log the result, so no other place crashes.
    Adding the return statement fixes it. Preparing pull request…

  1. Bah, was fixed in a pull request yesterday. Waste of a day :frowning:
1 Like

I have these all over my house and haven’t had any recent issues with them…However, I haven’t had to repair one in well over a year. I have a couple sitting in a drawer somewhere that I will try to add this weekend and report back.

Update: Just paired one sitting in the drawer and it paired fine (as expected). I’m also seeing temp and battery sensors and my contact sensor is showing both open and closed status.

My setup:
Home Assistant 2023.9.3
Zigbee2MQTT (latest version)
Zigbee Coordinator: SONOFF ZigBee 3.0

Let me know if I can be of any further help. Good luck on getting it sorted out!

Thanks for the test @mboarman !
Ends up that the issue is with the ZHA integration (so you are avoiding it with Zigbee2MQTT) and a patch was pushed up for it last night, so it should be working for everyone with the next HA release

2 Likes

Thanks for all the work and tracking down the issue! Sorry that a different pull request fixed it :disappointed_relieved:
Looking forward to being able to get these guys paired up correctly and not worry about wasting $ on them.