XBee PRO S2B communicating with Zigbee HA profile sensors

So if on/off switch send me data with some source and destination end point value, should I use those values in tx packet?

of course.

For example, I see the frame which was shown in the above which captured.
I understand any parameters, SE=0D,DE=FF,ON/OFF CLUSTER(0006),HA profile(0104).

if you want to send any command or read attribute, then you will set DE=0D, and SE will be set as you like number.

Anything for SE?
There is one more thing, that I donā€™t quite understand ā€¦ that is FRAME CONTROL of ZCL header ā€¦ can you help me to build a packet which would put switch in ON mode? I donā€™t know what am I doing wrong, because nothing had worked so far.
Do I have to include both, 64 and 16 bit address or can I omit one of them?

So if we would build a packet ā€¦

Start Delimiter = 0x7E
Length = to be calculated ā€¦
Frame Type = 0x11
Frame ID = 01 meaning?
DA64 = 00124B0001A76371
DA16 = 0FB3
SE = some arbitrary number?
DE = 0x0D
Cluster ID = 0x0007 ?
Profile ID = 0x0104
Broadcast Radius = 0x00 (maximum)
Transmit Options = 0x00 (as stated in XBeeĀ®/XBee-PROĀ® ZB RF Modules document - All bits must be set to 0)
Frame Control = ???
Transaction Sequence Number = 0x01 - some arbitrary number right?
Command ID = 0x02 Write attributes?
Attribute ID = 0x0010 (Switch Settings Attribute Set)
ZCL Payload ? = 0x30 (8-bit enumeration) 0x01 (value) ??
Checksum = to be calculated ā€¦

And where can I find any info on returned value from certain cluster ā€¦ while I trying to get this packet right, the switch is sending me back packets, but I donā€™t know how to interpret them ā€¦

Start Delimiter = 0x7E
Length = to be calculated ā€¦
Frame Type = 0x11
Frame ID = 01 meaning? if you want to get transmited status, this field is set not zero.
DA64 = 00124B0001A76371
DA16 = 0FB3 if you got the 16bit network destination address, this field will be set it you got, but not, then it must be set to 0xfffe.
SE = some arbitrary number?yes,from 0x01 to 0xf0.
DE = 0x0D
Cluster ID = 0x0007 ? yes, perhaps.
Profile ID = 0x0104
Broadcast Radius = 0x00 (maximum)
Transmit Options = 0x00 (as stated in XBeeĀ®/XBee-PROĀ® ZB RF Modules document - All bits must be set to 0)
Frame Control = ??? perhaps 0x00
Transaction Sequence Number = 0x01 - some arbitrary number right? incremented counter
Command ID = 0x02 Write attributes? yes
Attribute ID = 0x0010 (Switch Settings Attribute Set) yes, perhaps. (notice!. this field is set little endian).
ZCL Payload ? = 0x30 (8-bit enumeration) 0x01 (value) ?? yes
Checksum = to be calculated ā€¦

By the way,does ā€œWireless IR Motion Detectorā€ have something on/off factor?.

I moved to wireless wall switch because I am more exited to get it working :slight_smile:
So I built a packet like this:

7E 00 1B 11 01 00 12 4B 00 01 A7 63 71 0F B3 01 0D 00 07 01 04 00 00 00 01 02 01 00 30 01 03

ā€¦ no luck with getting light to shine :frowning:
Switch responded me with this:

7E 00 18 91 00 12 4B 00 01 A7 63 71 0F B3 0D 01 00 07 01 04 01 18 01 04 86 01 00 14

I donā€™t have a clue what this means nor what is wrong with the assembled packet ā€¦

I can consider this to good signs.

7E 00 18 91 00 12 4B 00 01 A7 63 71 0F B3 0D 01 00 07 01 04 01 18 01 04 86 01 00 14

The receiving frame is explained as follows.

04 86 01 00 14

0x04 is the response to a command.

0x86 explains ā€œUNSUPPORTED ATTRIBUTEā€.

0x01 0x00 (0x0001) is the attribute which you transmitted.
However, a really required attribute is 0x10 0x00 (0x0010).

I messed up conversion from big to little endian byte order ā€¦
However, even though I correct it, I get back the same response :confused:

Packet content:
7E 00 1B 11 01 00 12 4B 00 01 A7 63 71 0F B3 01 0D 00 07 01 04 00 00 00 01 02 10 00 30 01 F4

Response:
7E 00 18 91 00 12 4B 00 01 A7 63 71 0F B3 0D 01 00 07 01 04 01 18 01 04 86 10 00 05

If READ ATTRIBUTE of cluster ID=0x0006 is tried, what will happen? .

oh,Possibly I was wrong.

If lighting is only turned on and off, ON/OFF CLUSTER is used, and it can be operated only by command ID.

How is it with the following frames? .

7E 00 17 11 01 00 12 4B 00 01 A7 63 71 0F B3 01 0D 00 06 01 04 00 00 01 01 01 36

about zcl command frame.

01 01 01

0x01:frame control
0x01:sequence number
0x01:on/off cluster command id sets on.

Same response ā€¦

7E 00 18 91 00 12 4B 00 01 A7 63 71 0F B3 0D 01 00 06 01 04 01 18 01 04 86 10 00 06

I believe the problem is in Frame Control ā€¦ that is the only thing, that I donā€™t know how to set.

2.3.1.1 Frame Control Field
The frame control field is 8-bits in length and contains information defining the
command type and other control flags. The frame control field shall be formatted
as shown in Figure 2.3. Bits 5-7 are reserved for future use and shall be set to 0.

Bits: 0-1 -> Frame type | 2 -> Manufacturer specific | 3 -> Direction | 4 -> Disable default response | 5-7 -> Reserved

2.3.1.1.1 Frame Type Sub-field
The frame type sub-field is 2 bits in length and shall be set to one of the nonreserved
values listed in Figure 2.4.

Frame Type Value(b1b0) | Description
00 | Command acts across the entire profile
01 | Command is specific to a cluster
10-11 | Reserved

2.3.1.1.2 Manufacturer Specific Sub-field
The manufacturer specific sub-field is 1 bit in length and specifies whether this
command refers to a manufacturer specific extension to a profile. If this value is
set to 1, the manufacturer code field shall be present in the ZCL frame. If this
value is set to 0, the manufacturer code field shall not be included in the ZCL
frame.

2.3.1.1.3 Direction Sub-field
The direction sub-field specifies the client/server direction for this command. If
this value is set to 1, the command is being sent from the server side of a cluster to
the client side of a cluster. If this value is set to 0, the command is being sent from
the client side of a cluster to the server side of a cluster.

2.3.1.1.4 Disable Default Response Sub-field
The disable default response sub-field is 1 bit in length. If it is set to 0, the Default
response command will be returned, under the conditions specified in 2.4.12.2. If
it is set to 1, the Default response command will only be returned if there is an
error, also under the conditions specified in 2.4.12.2.

2.3.1.2 Manufacturer Code Field
The manufacturer code field is 16-bits in length and specifies the ZigBee assigned
manufacturer code for proprietary extensions to a profile. This field shall only be
included in the ZCL frame if the manufacturer specific sub-field of the frame
control field is set to 1.

I set frame control to 0x01, cluster id to 0x0006, and voila, light turned on [:D]
The packet contains only command ID (0x00 - OFF, 0x01 - ON, 0x02 - TOGGLE)

7E 00 17 11 01 00 12 4B 00 01 A7 63 71 0F B3 01 0D 00 06 01 04 00 00 01 01 02 35 - TOGGLE

So what is the purpose of cluster 0x0007?
In the end the problem really was in frame control ā€¦ finally getting somewhere [:D/]

2 Likes

I set frame control to 0x01, cluster id to 0x0006, and voila, light turned on [:D]
The packet contains only command ID (0x00 - OFF, 0x01 - ON, 0x02 - TOGGLE)

[quote]7E 00 17 11 01 00 12 4B 00 01 A7 63 71 0F B3 01 0D 00 06 01 04 00 00 01 01 02 35 - TOGGLE
[/quote]

Really? thatā€™s good. I think that I am very glad.

So what is the purpose of cluster 0x0007?

It may be cluster id for probably changing the configuration itself.

Thank you chobichan, youā€™ ve been a great support so far! :slight_smile: I finally started to understand zigbee ha protocol.
But as far I understand, not all options are supported with xbee ā€¦ for that I would need zigbee module with HA support right?
Such as forming a network, discovery of devices etc. I can only use zdo and zcl commands right?

Such as forming a network, discovery of devices etc. I can only use zdo and zcl commands right?

Yes, may be,

Hi!

Maybe you find an answer on site 2, bellow table in this document ftp://ftp1.digi.com/support/images/APP_NOTE_XBee_ZigBee_Device_Profile.pdf

Hi!

I have the same ir motion detector as Pajci has mentioned in first postā€¦ Now i wonder how can i configure it? iā€™m reading zigbee cluster library but i donā€™t get it
I can read some values, eg. ZoneState (page 361 in zcl) 18 01 01 00 00 00 30 00 79 (this means not enrolled,how to get it?) or ZoneType (page 362 in zcl) 18 01 01 01 00 00 31 FF FF 79 ffff means invalid zone typeā€¦ expected value is 0d00 (motion sensor) any suggestion how to set it, that iā€™ll get some values when something will move in front of the sensor?

if i read IAS_CIE_Address register (page 364 in zcl) i get response 18 01 01 10 00 00 F0 00 00 00 00 00 00 00 00 A9 ā€“> this is address of coordinator (digi xstick) is this ok?
How could i send (how should i structure a packet)a generated Command (page 366, chapter 8.2.2.4 in zcl document) Zone Enroll Request?

Thanks

Hi,

Can someone explain in details step by step how to control HA Profile switch with xbee pro S2B? Really appreciate it your help.

1 Like

Hi,

sorry for late response ā€¦ have you managed to establish connection between xbee and switch?

@chobichan

One more question for you :slight_smile: Have you any idea, how could I get a list of connected devices?

Thank you. Yes, i am able to establish connection between them. Have you tried to read data from the its attributes?

hi could you tell me how you built that. I am doing something pretty similar except with a door lock

i got it. ill put what i did in the post related to the kiwkset