zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Xiaomi Wall switch group message support question

Open pkedvessy opened this issue 7 years ago • 12 comments

Hi All,

I'm really interested in the zigbee groups feature to control multiple Xiaomi Wall Switches by a single MQTT command.

I can see that how we can send messages to a group, but sending control messages to these switches is a bit different because they are using separated topics for left and right relays.

Is it possible to apply the group functionality for these switches? If so, how we can set up them?

Thanks, Peter

pkedvessy avatar May 09 '19 22:05 pkedvessy

First we have to check if this device support groups. Could you try to add it to a group the way it is now? Then either the left or right button should be in a group.

Koenkk avatar May 10 '19 15:05 Koenkk

Sorry for the late response. Finally I was able to have a try with a "Xiaomi Aqara Neutral Line Type Remote Control Switch": it got added to a really new group (lets say 'test'), but when I have tried to send '{"state": "ON"}' message to '/bridge/group/test/set' I got the following error: '{"type":"entity_not_found","message":"bridge/group/test"}'

pkedvessy avatar May 28 '19 21:05 pkedvessy

You should send the message to zigbee2mqtt/test/set {"state": "ON"}

Koenkk avatar May 29 '19 06:05 Koenkk

Ahh, thanks, it is working now: left is in the group. Can we add right as well or can we configure somehow which one is in the group?

pkedvessy avatar May 29 '19 07:05 pkedvessy

This was not implemented yet but can now be done in the dev branch. (http://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html). Documentation: https://github.com/Koenkk/zigbee2mqtt.io/blob/dev/information/groups.md#adding-a-specific-endpoint

Koenkk avatar May 29 '19 18:05 Koenkk

Should I update my coordinator's firmware? I'm experiencing issues when starting zigbee2mqtt but I have no issue with the master branch...

pkedvessy avatar May 29 '19 22:05 pkedvessy

I missed to say thank you for the quick turnaround on having support on my request! It's going to be more than brilliant to controll both channels by group messages!

pkedvessy avatar May 29 '19 23:05 pkedvessy

I have updated my coordinator to Z-Stack_Home_1.2 version 20190425 and dev branch is working as expected. But when I'm trying to add a specific endpoint to a group, I get this error:

Jun 01 14:08:22 peetserver npm[17732]: zigbee2mqtt:debug 6/1/2019, 2:08:22 PM Received MQTT message on 'zigbee2mqtt/ground_floor/bridge/group/wall_switches/add' with data 'kitchen/wall_switch/2/right' Jun 01 14:08:22 peetserver npm[17732]: zigbee2mqtt:error 6/1/2019, 2:08:22 PM Failed to find device with entity ID 'kitchen/wall_switch/2' Jun 01 14:08:22 peetserver npm[17732]: /opt/zigbee2mqtt/lib/extension/groups.js:150 Jun 01 14:08:22 peetserver npm[17732]: const {entityID, endpointID} = this.parseID(ID); Jun 01 14:08:22 peetserver npm[17732]: ^ Jun 01 14:08:22 peetserver npm[17732]: TypeError: Cannot destructure property entityIDof 'undefined' or 'null'. Jun 01 14:08:22 peetserver npm[17732]: at Groups.updateDeviceGroup (/opt/zigbee2mqtt/lib/extension/groups.js:150:45) Jun 01 14:08:22 peetserver npm[17732]: at Groups.onMQTTMessage (/opt/zigbee2mqtt/lib/extension/groups.js:221:14) Jun 01 14:08:22 peetserver npm[17732]: at results.extensions.filter.map (/opt/zigbee2mqtt/lib/controller.js:152:27) Jun 01 14:08:22 peetserver npm[17732]: at Array.map (<anonymous>) Jun 01 14:08:22 peetserver npm[17732]: at Controller.onMQTTMessage (/opt/zigbee2mqtt/lib/controller.js:152:14) Jun 01 14:08:22 peetserver npm[17732]: at MQTT.onMessage (/opt/zigbee2mqtt/lib/mqtt.js:81:18) Jun 01 14:08:22 peetserver npm[17732]: at MqttClient.emit (events.js:189:13) Jun 01 14:08:22 peetserver npm[17732]: at MqttClient._handlePublish (/opt/zigbee2mqtt/node_modules/mqtt/lib/client.js:1162:12) Jun 01 14:08:22 peetserver npm[17732]: at MqttClient._handlePacket (/opt/zigbee2mqtt/node_modules/mqtt/lib/client.js:351:12) Jun 01 14:08:22 peetserver npm[17732]: at work (/opt/zigbee2mqtt/node_modules/mqtt/lib/client.js:283:12) Jun 01 14:08:23 peetserver npm[17732]: npm ERR! code ELIFECYCLE Jun 01 14:08:23 peetserver npm[17732]: npm ERR! errno 1 Jun 01 14:08:23 peetserver npm[17732]: npm ERR! [email protected] start:node index.js Jun 01 14:08:23 peetserver npm[17732]: npm ERR! Exit status 1 and Z2M is terminating.

pkedvessy avatar Jun 01 '19 12:06 pkedvessy

Did you configure a base_topic in configuration.yaml?

Koenkk avatar Jun 03 '19 09:06 Koenkk

Yes I did: zigbee2mqtt/ground_floor

pkedvessy avatar Jun 03 '19 11:06 pkedvessy

Can you post your configuration.yaml?

Koenkk avatar Jun 03 '19 12:06 Koenkk

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 02 '19 12:08 stale[bot]