Issue with aqara p1 sensor with zigbee2mqtt - nothing exposed


i am new to home assistant and zigbee2mqtt but starting small with the various zigbee devices i have.

have zigbee2mqtt working and have added 2 of my aqara sensors
the door/window sensor and the p1 motion sensor.
the door sensor is working fine, however the p1 sensor isn’t.

i’ve paired it and it’s listed in the mqtt devices

however, when checking the exposes everything is showing as N/A

and checking the map it doesn’t seem to have a connection line to the zigbee controller

i’m using a sonoff ZBDongle-E connected to a Pi4 running HAOS

have i done something wrong?

The motion sensor in your image is the original, not the P1.

It also doesn’t look to have paired properly. When you’re pairing it you want to keep tapping the pair/wake button until the interview completes.

More importantly, you have no (Zigbee) routers. That’s fine for a single room and testing, but if you want to cover the house/flat/whatever then you need routers.

I hope too that:

  1. You’re using a USB extension cable
  2. You picked a Zigbee channel clear of WiFi interference

ok, the non P1 version then.

i didn’t have to continually press the pair button for the door sensor for it to pair successfully, so assumed the same would be ok for the motion sensor.

i am planning on adding my hue bulbs/switches and ikea bulbs, but whilst testing have only added my aqara sensors. will that result in zigbee routers?

so how do i fix this partial pairing issue?
should i delete it and re-pair from scratch?

It’s a good thing to do with any end device (battery powered).

The bulbs yes, things that are mains powered (other than Sengled bulbs and most two-wire switches/dimmers) are routers.

That’s the best approach.

Also, for Xiaomi (Aqara) devices always use the option to pair to a specific router as they will randomly pick a parent and never change, no matter how bad the signal is.

an update to this.
i removed and re-paired the device, using the method mentioned above.

this time is did seem to pair fully this time with the exposes now showing values - however from that point onwards it seems to not be working again. the exposed values are stuck on what they have been since 16:40 yesterday. covering the light sensors shows no luminance value update.

checking the zigbee map the device is back to having no connection line to the coordinator.

this is motion sensor that was working perfectly when it was connected to the aqara hub (which is now disconnected but was sitting in the same location as the pi4)

i’m now unsure as to what the issue is.

How far from the Pi with what walls in the way?

Direct range from the coordinator to the first device is maybe 6 meters with only one or two drywall/plasterboard walls in the way.

about 30 cm direct line of sight with nothing in between.
the other sensor, that is working fine, is further away but still in the same room.

i have since added a hue led strip (powered), which is working, in the same room as the coordinator and the 2 sensors

current map looks like this

i have 2 unifi APs (1 in the same room and one further away), the one in the same room is on channel 1, the other channel 6 (they are separated by thick brick walls to can’t “see” each other.

i am unsure what channel is being using for zigbee, i installed using the add-ons from the add-on store.

as for the USB extension, i keep seeing this mentioned, and to be honest i’m not sure how that helps? does it improve the signal? at the moment the sensor with the issue it pretty much sitting right next to the aerial of the sonoff. as it stands right now i don’t have a usb extension cable to use.

Then it uses the default of 11, which is a problem if you have WiFi on channel one:

By reducing interference:

so the solution is?
2.4GHz only has 13 channels available, of which only 1 are non overlapping.

my WIFI is already very strong so not really looking to change anything at that end - besides it wasn’t an issue when using the aqara hub.

how does one change the channel being used by home assistant?
note that the existing hue bridge is currently using channel 11.

Well, look at the image. There should be at least three channels that don’t overlap (much) with wifi - assuming the wifi is on 1, 6, and 11.

Scan your environment. See what you have.

You don’t, you change the channel used by Zigbee2MQTT.

Changing the channel will result in Z2M refusing to start until you follow the instructions in the log file (when it fails to start) and you’ll have to re-pair the devices.

So, two meshes on the same channel, possibly with WiFi interference… :grimacing:

i essentially live inside a sold brick building (both external and internal walls are solid brick) the only networks i can see in any room are my own. my 2 WIFI APs are only about 50 feet apart but are unable to “see” each other due to the walls (hence why i had to hardwire each room and have 2 APs in such a small environment).

no need to scan as 1 AP uses channel 1 and the other channel 11

strange how i didn’t have any issues with interference previously.
note that the only device i have removed from my system is the aqara hub, everything is “as is”.

so changing the channel will result in everything having to be re-added again? that seems quite un-user friendly.

Yes, because not all devices can channel hop and that avoids unpleasant surprises.

well i went to Zigbee2MQTT > Settings > Advanced (via the UI)
change the channel to “20”, as it wouldn’t allow anything below 11. saved, restarted, and all the devices are still active and working (apart from the motion sensor).

so it seems changing the channel didn’t result in any devices needing re-paired?

i have since added bulbs and switch and the map now looks like this

i have created a group for the 4 IKEA bulbs, so i should probably bind the hue dimmer switch to that group? (as it makes sense to do that i would assume) - note every device in the map is in the same room.

Check the log, check it actually restarted with the new channel

i’m not seeing any obvious errors in the /homeassistant/zigbee2mqtt/log/2023-11-28.10-50-43/log.txt (this is the most recent log file).

but unless i know what to specifically search for in the log i would be none the wise.

Doesn’t sound like it actually restarted, or it did but the channel didn’t change.

i appreciate the link, however you said check the log for errors after changing the channel. i changed the channel using the zigbee2mqtt UI, saved, restarted HA.

checked the logs, no error.
the UI and the YAML both have the channel listed as 20 (previously 11).

so if i see no errors, both the UI and YAML show the new channel then how am i supposed to know that it actually hasn’t changed the channel? that seems a little odd that i would see no reference to it not actually doing it.

so, if indeed, it has restarted or changed the channel, what steps do i need to go thru to do it?

It appears it was a simple battery issue.
Replaced the battery in the Aqara sensor and it now seems to stay connected and does what it should