I have a bunch of Tuya Rotary buttons, for which I created a blueprint.
I have several scenarios where I want two or more of these to do exactly the same, for example one button at each end of a hallway (like a traditional three-way switch).
HA Groups seems like a good way to do this. I’ve used groups a fair bit with output devices (lights, active speakers) and sensors (windows open / closed), but this would be my first time grouping input devices.
The grouping works ok, but I seem to be unable to listen to events from any of the input devices in the group in the blueprint.
Here is my attempt:
blueprint:
name: Tuya Rotary Switch
description: Automate your Tuya rotary switch using ZHA events.
domain: automation
input:
group_name:
name: 'Group'
default: 'Group Name'
group_object_id:
name: 'object_id to assign to the group. Example: all_lights'
default: 'group_id'
button_press:
name: Toggle
description: Push button
default: []
selector:
action: {}
rotate_right:
name: Dim up
description: Rotate right
default: []
selector:
action: {}
rotate_left:
name: Dim down
description: Rotate left
default: []
selector:
action: {}
button_press_right:
name: Hold and rotate right
description: Rotate right while holding
default: []
selector:
action: {}
button_press_left:
name: Hold and rotate left
description: Rotate left while holding
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
variables:
input_group_name: !input 'group_name'
input_group_group_object_id: !input 'group_object_id'
trigger:
- platform: event
event_type: zha_event
event_data:
entity_id: input_group_group_object_id
action:
- variables:
command: '{{ trigger.event.data.command }}'
step_mode: '{{ trigger.event.data.params.step_mode }}'
- choose:
- conditions: '{{ command == ''toggle'' }}'
sequence: !input 'button_press'
- conditions: '{{ command == ''step'' and step_mode == ''StepMode.Up'' }}'
sequence: !input 'rotate_right'
- conditions: '{{ command == ''step'' and step_mode == ''StepMode.Down'' }}'
sequence: !input 'rotate_left'
- conditions: '{{ command == ''step_color_temp'' and step_mode == ''StepMode.Up'' }}'
sequence: !input 'button_press_right'
- conditions: '{{ command == ''step_color_temp'' and step_mode == ''StepMode.Down'' }}'
sequence: !input 'button_press_left'
This lets me assign a group (e.g. button.rotary_buttons_hallway
), but then the blueprint never triggers.
How can I listen to the events from the buttons when they are in a group?