Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add group membership command #1056

Merged
merged 4 commits into from
Feb 18, 2019
Merged

Conversation

glentakahashi
Copy link
Contributor

@glentakahashi glentakahashi commented Feb 10, 2019

From docs at http://www.zigbee.org/wp-content/uploads/2014/11/docs-07-5123-04-zigbee-cluster-library-specification.pdf section 3.6.2.3.3.2, sending the getMembership command with groupcount = 0 and grouplist = [] returns all the groups a device is a part of.

This worked against the Sengled element classic E11-G13 lights I had in my network, but I don't have any other devices to test against.

Example of using the command:

zigbee2mqtt:info 2019-2-10 04:43:26 Zigbee publish to device '0xb0ce18140316d859', genGroups - getMembership - {"groupcount":0,"grouplist":[]} - null - null
zigbee2mqtt:info 2019-2-10 04:43:27 0xb0ce18140316d859 is in groups [1] and its remaining group capacity is unknown
zigbee2mqtt:info 2019-2-10 04:43:37 Zigbee publish to device '0xb0ce18140316d859', genGroups - add - {"groupid":"2","groupname":""} - null - null
zigbee2mqtt:info 2019-2-10 04:43:37 Successfully add 0xb0ce18140316d859 to office_lights
zigbee2mqtt:info 2019-2-10 04:43:45 Zigbee publish to device '0xb0ce18140316d859', genGroups - getMembership - {"groupcount":0,"grouplist":[]} - null - null
zigbee2mqtt:info 2019-2-10 04:43:45 0xb0ce18140316d859 is in groups [1,2] and its remaining group capacity is unknown
zigbee2mqtt:info 2019-2-10 04:43:54 Zigbee publish to device '0xb0ce18140316d859', genGroups - remove - {"groupid":"2"} - null - null
zigbee2mqtt:info 2019-2-10 04:43:54 Successfully remove 0xb0ce18140316d859 to office_lights
zigbee2mqtt:info 2019-2-10 04:43:57 Zigbee publish to device '0xb0ce18140316d859', genGroups - getMembership - {"groupcount":0,"grouplist":[]} - null - null
zigbee2mqtt:info 2019-2-10 04:43:57 0xb0ce18140316d859 is in groups [1] and its remaining group capacity is unknown

n.b. reading https://www.nxp.com/docs/en/user-guide/JN-UG-3077.pdf says that 255 means group capacity is unknown, 254 means that there is space for at least 1 more group but how many more is unknown.

u8Capacity is the capacity of the device’s Group table to receive more groups -
that is, the number of groups that may be added (special values: 0xFE means
at least one more group may be added, a higher value means that the table’s
remaining capacity is unknown)

@Koenkk
Copy link
Owner

Koenkk commented Feb 10, 2019

Great, I would like to request one minor change. Could you also post the results to the following MQTT topic? zigbee2mqtt/bridge/group/[friendly_name]?

@glentakahashi
Copy link
Contributor Author

glentakahashi commented Feb 10, 2019 via email

@Koenkk
Copy link
Owner

Koenkk commented Feb 10, 2019

After thinking more about this, I think this makes more sense:

To request:
topic: zigbee2mqtt/bridge/device/[DEVICE_FRIENDLY_NAME]/get_group_membership
payload: `` (emtpy)

The results are then send to zigbee2mqtt/[DEVICE_FRIENDLY_NAME] (just use the publishDeviceState with cache: false.

@glentakahashi
Copy link
Contributor Author

glentakahashi commented Feb 10, 2019 via email

@glentakahashi
Copy link
Contributor Author

@Koenkk updated! Let me know if that's what you want published to the MQTT topic.

glentakahashi added a commit to glentakahashi/zigbee2mqtt.io that referenced this pull request Feb 18, 2019
Koenkk pushed a commit to Koenkk/zigbee2mqtt.io that referenced this pull request Feb 18, 2019
@Koenkk
Copy link
Owner

Koenkk commented Feb 18, 2019

Perfect!

@Koenkk Koenkk merged commit 3238687 into Koenkk:dev Feb 18, 2019
@glentakahashi glentakahashi deleted the gt/group-membership branch March 10, 2019 07:27
wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this pull request Sep 26, 2019
* Group membership

* Fix lint

* Update deviceGroupMembership.js

* Update deviceGroupMembership.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants