Motion sensor zigbee endpoint

Hi all.

I’m trying to connect the motion sensor to my existing zigbee network (HA profile). I have a custom coordinator and have custom code to transmit the zigbee commands. I successfully retrieve the list of endpoints and the supported clusters for each endpoint of other zigbee devices, but I run into a problem with the motion sensor. I issue a command to retrieve the endpoints of the motion sensor and I receive 2 back - 1 and 2 (0x01, 0x02). I assume one of them is the sensor itself and the other is the battery monitor, but I can’t be sure. When I issue the command to get the supported clusters for each endpoint, I don’t get any response back.

I’m sending the Simple Descriptor request (cluster 0x0004, profile 0x0000). Like I said, the code I have works fine with the SafePlug device I have in my network but for some reason it fails when I send the command to the motion sensor.

Has anyone successfully queried the endpoints for the supported clusters? Should I try something else?

Thanks!

1 Like

DO you mind me asking which radio you are using, and where did you get your HA profile stack for it?

Thanks

I’m using a Digi xbee radio from sparkfun (https://www.sparkfun.com/products/11217). I have API mode 2 enabled, and you just need to put in the network encryption key to get it to work with the HA stack.

Well, I’ve made some headway. My code was adding an extra byte so that’s why it wasn’t working. I’m receiving a response from endpoint 2 for profile fc01, but that’s a manufacturer-specific profile. In addition, the response says there aren’t any input or output clusters available which is a HUGE bummer. I do get a signal from endpoint 2, profile fc01, cluster fc04, but I have no idea what that is.

I’m still trying to figure out why endpoint 1 isn’t responding. I’ll post more when I figure it out.

Why companies need to go and do a manufacturer specific profile when there’s existing profiles boggles my mind. It’s a motion sensor! It’s not like the product is some sort of intricate sensor, the only one of its kind.

FYI - here are the settings for the xbee radio to act as a coordinator with HA devices.

aggregation (AR): 255 (x 10 sec)
broadcast_hops (BH): 0
discover_timeout (NT): 60 (x 100 msec)
encrypt_enable (EE): 1
encrypt_options (EO): 0x2 (bitfield)
ext_pan_id (ID): 0x0000000000000000
initial_pan_id (II): 0xffff
join_time (NJ): 255 (sec)
link_key (KY):
max_hops (NH): 30
network_key (NK):
node_id (NI):
power_level (PL): 4
power_mode (PM): 1
scan_channels (SC): 0x1ffe (bitfield)
scan_duration (SD): 3 (exponent)
sleep_count (SN): 1
sleep_period (SP): 32 (x 10 msec)
stack_profile (ZS): 2

KY: 0x5A6967426565416C6C69616E63653039

With the help of someone at SmartThings (sorry, I don’t know your name, just twitter handle), I was able to get the motion sensor working with my own coordinator.

Endpoint 2 is a ST manufacturer specific endpoint.
Endpoint 1 is asleep if battery powered. I think that this is a bug since it’s asleep by default, even when pairing with a coordinator. I think that the endpoint should be awake when pairing for 20 seconds or so, to allow the coordinator to perform its scan for endpoints/clusters.

If Endpoint 1 isn’t asleep, you can do the simple descriptor request, but there’s a bug where the output cluster 0500 isn’t returned (which is the cluster that is used to detect motion). I’ve made a workaround in my code to get around this issue.

I hope this will help someone else.

1 Like

Hey @bdowden, this sounds like a really cool project. Do you know if it’s possible to configure the series 2 xbee radio to act as a (sleepy) slave in a HA network?
What I am trying to do is basically the inverse of your problem. I want to create a sensor with the xbee module and have it join an existing HA network, including SmartThings.

@Florianz - I don’t see why not. I’ve never developed an end device, but putting the radio to sleep/waking up shouldn’t be too difficult. I think you apply a certain voltage to a specific pin on the radio. A quick google search should give you what you need.

Thanks @bdowden. I was wondering more about the software side of things. I am sure the radio can be put to sleep. How about the Xbee’s Zigbee stack: Does it give me access to the full Zigbee PRO stack?

You can set the zigbee stack through x-CTU. the ZS attribute, value 2, equates to ZB Pro

Cool, thanks!

We chose a manufacturer specific cluster because we were adding some non-spec check-ins. We kept endpoint 1 with IAS Zone for other controllers. It’s also not spec yet, but were slowly adding more and more to get ZigBee HA certified.

I remember talking to Digi and they had mentioned not being able to get the full HA firmware on the Xbee S2 modules, but only for their mounted module.