Hi,
this is my first step deeper into HA. Up to now I have only sensors and TRVs, without any automations. Bear with me.
I have 3 independent lights with their switches in my hallway. I want all of the lights to be switched with all available switches. To solve this, I have mounted two TuYa TS0001_switch_module and one TuYa TS0002_switch_module, where the l1 endpoint is used for one light. All of them are set to toggle mode.
I now can switch all the lights independed as before, and have the possibility to switch them over zigbee2mqtt exposed state.
Now I tried to create a zigbee group and add the swich modules (and the endpoint l1).
devices.yaml:
'0xa4c138b5d21d492d':
friendly_name: switch_module.uf_hallway_light
'0xa4c13857541e99e6':
friendly_name: switch_module.gf_hallway_light_kitchen-door
'0xa4c13852c4de7fca':
friendly_name: switch_module.gf_kitchen_light
groups.yaml:
'11':
friendly_name: switch_module_group_hallway
devices:
- 'switch_module.uf_hallway_light'
- 'switch_module.gf_hallway_light_balcony-door'
- 'switch_module.gf_hallway_light_kitchen-door/l1'
I restarted Z2M, but this didn’t change anything. At least I didn’t observe any change.
Did I misunderstand ZigBee groups?
What I did, but didn’t bring my to a working solutions had been to convert the switches to lights and group them. Now I can switch them in Lovelace, but when I use the hardware light switches it also only switches the connected light. Which is expected I guess…
I also read something about ZigBee binding. Is this what I need?
Or do I need to set up automations for every switch to switch the other two?
Thanks for your help!
Edit: The finally workin solution.
I can’t remember what my first approach had been, but I successfully built a strobe light effect!
The solution below now works since weeks without any issues.
Next steps for the light will be some motion sensors with time conditions or maybe presence detection in the bed, as we sleep with open bedroom door…
groups.yaml
'1':
friendly_name: switch_module_hallway_goup
devices:
- 0xa4c138537ef57481/1
- 0xa4c13857541e99e6/1
- 0xa4c138b5d21d492d/1
automations.yaml:
# tell the other two switch_modules to toggle as well
- id: "1646665464616"
alias: Hallway Lights - GF Balcony switch on
description: Switch on the other two switch_modules
trigger:
- platform: device
type: turned_on
device_id: eb285a117aee84f4ce78b682b1ea50a2
entity_id: switch.switch_module_gf_hallway_light_balcony_door
domain: switch
condition: []
action:
- type: turn_on
device_id: 63baf1b9ed1cfa33183de48b5bb61958
entity_id: switch.switch_module_hallway_goup
domain: switch
mode: single
- id: "1646666015962"
alias: Hallway Lights - GF Balcony switch off
description: Switch off the other two switch_modules
trigger:
- platform: device
type: turned_off
device_id: eb285a117aee84f4ce78b682b1ea50a2
entity_id: switch.switch_module_gf_hallway_light_balcony_door
domain: switch
condition: []
action:
- type: turn_off
device_id: 63baf1b9ed1cfa33183de48b5bb61958
entity_id: switch.switch_module_hallway_goup
domain: switch
mode: single
- id: "1646666197508"
alias: Hallway Lights - GF Kitchen switch on
description: Switch on the other two switch_modules
trigger:
- platform: device
type: turned_on
device_id: 364a825756c954a0eeb71c9ff032da45
entity_id: switch.switch_module_gf_hallway_light_kitchen_door_l1
domain: switch
condition: []
action:
- type: turn_on
device_id: 63baf1b9ed1cfa33183de48b5bb61958
entity_id: switch.switch_module_hallway_goup
domain: switch
mode: single
- id: "1646666197509"
alias: Hallway Lights - GF Kitchen switch off
description: Switch off the other two switch_modules
trigger:
- platform: device
type: turned_off
device_id: 364a825756c954a0eeb71c9ff032da45
entity_id: switch.switch_module_gf_hallway_light_kitchen_door_l1
domain: switch
condition: []
action:
- type: turn_off
device_id: 63baf1b9ed1cfa33183de48b5bb61958
entity_id: switch.switch_module_hallway_goup
domain: switch
mode: single
- id: "1646666197510"
alias: Hallway Lights - UF Office switch on
description: Switch on the other two switch_modules
trigger:
- platform: device
type: turned_on
device_id: ed0b587cdb3a6d13100a730fc5bfd9d0
entity_id: switch.switch_module_uf_hallway_light
domain: switch
condition: []
action:
- type: turn_on
device_id: 63baf1b9ed1cfa33183de48b5bb61958
entity_id: switch.switch_module_hallway_goup
domain: switch
mode: single
- id: "164666619711"
alias: Hallway Lights - UF Office switch off
description: Switch off the other two switch_modules
trigger:
- platform: device
type: turned_off
device_id: ed0b587cdb3a6d13100a730fc5bfd9d0
entity_id: switch.switch_module_uf_hallway_light
domain: switch
condition: []
action:
- type: turn_off
device_id: 63baf1b9ed1cfa33183de48b5bb61958
entity_id: switch.switch_module_hallway_goup
domain: switch
mode: single
# now integrate the four zigbee switches
- id: "1647513866787"
alias: Hallway Lights - UF Living Room Button Turn On
description: ""
trigger:
- platform: mqtt
topic: zigbee2mqtt/push_button.uf_hw_living-room/action
- platform: mqtt
topic: zigbee2mqtt/push_button.uf_hw_bedroom/action
- platform: mqtt
topic: zigbee2mqtt/push_button.gf_hw_bath/action
- platform: mqtt
topic: zigbee2mqtt/push_button.gf_hw_guest-room/action
condition:
- condition: device
type: is_off
device_id: 63baf1b9ed1cfa33183de48b5bb61958
entity_id: switch.switch_module_hallway_goup
domain: switch
action:
- type: turn_on
device_id: 63baf1b9ed1cfa33183de48b5bb61958
entity_id: switch.switch_module_hallway_goup
domain: switch
mode: single
- id: "1647513866788"
alias: Hallway Lights - UF Living Room Button Turn Off
description: ""
trigger:
- platform: mqtt
topic: zigbee2mqtt/push_button.uf_hw_living-room/action
- platform: mqtt
topic: zigbee2mqtt/push_button.uf_hw_bedroom/action
- platform: mqtt
topic: zigbee2mqtt/push_button.gf_hw_bath/action
- platform: mqtt
topic: zigbee2mqtt/push_button.gf_hw_guest-room/action
condition:
- condition: device
type: is_on
device_id: 63baf1b9ed1cfa33183de48b5bb61958
entity_id: switch.switch_module_hallway_goup
domain: switch
action:
- type: turn_off
device_id: 63baf1b9ed1cfa33183de48b5bb61958
entity_id: switch.switch_module_hallway_goup
domain: switch
mode: single