Hello everyone,
I have a problem with my HomeAssistant automation where I want to turn several sockets on or off via switch.turn_on, but only individual devices are activated.
I’m wondering if others are experiencing this issue and why Zigbee2mqtt is not buffering this and running so poorly.
One possible solution is to define the relevant sockets as a group in Zigbee2mqtt. This works to some extent, but is not particularly useful in other aspects.
And if you do have to perform several in succession, you always have to insert a one-second delay in between.
Here is an example of my automation:
current Automation
alias: Haus verlassen -> bestimmte Plugs aus
description: ""
trigger:
- platform: numeric_state
entity_id:
- zone.home
below: 1
condition:
- condition: state
entity_id: input_boolean.stop_automations
state: "off"
action:
- service: switch.turn_off
data: {}
target:
entity_id: switch.sonos_plugs
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.wohn_drucker_plug
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- service: switch.turn_off
data: {}
target:
entity_id: switch.wohn_media_plugs
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- service: switch.turn_off
data: {}
target:
entity_id: switch.schlaf_media_plugs
mode: restart
Why can't I do the automation like this?
alias: Test
description: ""
trigger:
- platform: numeric_state
entity_id:
- zone.home
below: 1
condition:
- condition: state
entity_id: input_boolean.stop_automations
state: "off"
action:
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.sonos_plugs
- switch.wohn_drucker_plug
- switch.wohn_media_plugs
- switch.schlaf_media_plugs
mode: restart
Nevertheless, I still have the problem that sometimes Zigbee commands sent simultaneously from HomeAssistant are only partially executed.
For example in this automation(copys the states of light.wohnzimmer but only when my tv is off) i have a delay of 200ms which works perfectly most of the time, but sometimes didnt.
alias: Couch Lampe Controller
description: ""
trigger:
- platform: state
entity_id:
- media_player.denon_avr_x4400h
from: null
to: null
- platform: state
entity_id:
- light.wohnzimmer_lampen
condition: []
action:
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 200
- choose:
- conditions:
- condition: or
conditions:
- condition: state
entity_id: media_player.denon_avr_x4400h
state: "on"
- condition: state
entity_id: light.wohnzimmer_lampen
state: "off"
sequence:
- service: light.turn_off
data:
transition: 1
target:
entity_id: light.wohn_couch_lampe
- conditions:
- condition: state
entity_id: light.wohnzimmer_lampen
state: "on"
- condition: not
conditions:
- condition: state
entity_id: media_player.denon_avr_x4400h
state: "on"
sequence:
- service: light.turn_on
target:
entity_id: light.wohn_couch_lampe
data:
transition: 1
brightness: "{{state_attr('light.wohnzimmer_lampen','brightness')}}"
mode: restart
Has anyone had similar experiences or found a solution to this problem?
Thanks in advance for your help!
My Setup:
Homeassistant in Docker
Zigbee2mqtt in docker ~ 70 Devices about 45 are Routers(mostly Plugs)
Conbee 2