I need to use some "he raw" commands and plan to create a library file / library functions that I'll post to the community for handling.
The "he raw" command isn't well documented, so I've been looking through code to figure out the full set of fields.
Here's a request to anybody else with some knowledge in this area - can anybody confirm that this is the "full" correct format of the "he raw" commands (i.e., are any of the fields wrong, or are there other fields that might be included):
he raw $deviceNetworkId $sourceEndpointId $deviceEndpointId $clusterId { $frameControl $mfrCode $transactionSequenceNo $commandId
$commandPayload } { $profileId }
where:
deviceNetworkId is the destination address represented as a 4 octet string, not octet reversed, not preceded by 0x
sourceEndpointId is the source endpoint represented as an integer value (or hex using 0x prefix); not a two octet character. Usually 1 (This endpoint generally represents the hub; I have not seen another value used).
- Thus, for example, if you want to send from endpoint 15, the field would get the value 15, not 0F. (confirm?)
deviceEndpointId is the destination endpoint represented as an integer value (or hex using 0x prefix); not a two octet character.
- Thus, for example, if you want to send to endpoint 15, the field would get the value 15, not 0F. (confirm?)
Is the ordering of sourceEndpointId and deviceEndpointID correct? I would have thought that the destination EndpointId might directly follow the deviceNetworkID address? They are both usually 1, so it was a little hard for me to confirm correctness.
clusterId is the cluster of interest represented as an integer value (or hex using 0x prefix); not a four octet character string.
- Thus, for example, if you wanted to send to cluster "ABCD" (hex), you could use the integer value 43981 or 0xABCD but not ABCD as a character string. (confirm?)
The following values and their settings are detailed in Zigbee Cluster Library Specification, Document 07-5123 Revision 8 ("ZCL")
frameControl is the frame control field from ZCL section 2.4.1.1 represented as a two octet character string
mfrCode is the manufacturer code represented as a 4 octet character string with octet pairs reversed. I.e., code 0x1234 is included as 3412. Field is optional depending on frameControl bit settings.
transactionSequenceNo is the sequence no. field from ZCL section 2.4.1.3 represented as a two octet character string. As a practical matter, I noticed that the responses from devices don't seem to expose the transaction sequence no., so the practical effect is it doesn't matter what this is set to (correct?).
- If anybody knows of a way of getting the sequence No from a device's response, please clarify what that is (I actually had a use for it to correlate command responses with specific transmissions -- if I could get the info -- but took a different approach when I couldn't access it. Maybe it could be added to the parseDescriptionAsMap response? ).
commandId is the command represented as a two octet character string. Either a cluster global ("isClusterSpecific: false) or cluster-specific command ("isClusterspecific: true") , depending on a bit setting in the frameControl field.
commandPayload is the payload for the command, if any. Octets will need to be reversed on an element-by-element basis for payload elements that are greater than two octets. So, for example, if the command payload is the list of attributes 1234 ABCD, they would be put in the commandPayload section as 3412 CDAB.
profileId is the profile ID represented as an integer or hex value. Not an octet string / not octet reversed. So profileID 0101 could be 0x0104 or its Integer equivalent 260 (confirm?)
And spacing within the payload doesn't matter -- it all gets joined together. I.e., 00 12 3456 00 is the same as 0012345600
Thank you for your help.