This is my first Blueprint post. Please be patient with me.
Description
This blueprint allows you to handle button presses from the SwitchBot Universal Remote (via Matter) and define custom actions for each button. The Matter integration provides 4 (event) buttons, making it easy to integrate and customize for various use cases.
Features:
- Supports up to 4 buttons.
- Customizable actions for each button press.
- Specifically designed for SwitchBot Universal Remote devices integrated via Matter.
- Includes a condition to ensure actions are triggered only on the
initial_press
event.
Blueprint
Click here to import into your HA instance.
OR, feel free to copy/paste for yourself:
blueprint:
name: SwitchBot Universal Remote Button Handler
description: This blueprint handles button presses from the SwitchBot Universal Remote, via. Matter, with customizable actions.
domain: automation
input:
button_1:
name: Button 1
description: Entity ID for Button 1
selector:
entity:
domain: sensor
button_2:
name: Button 2
description: Entity ID for Button 2
selector:
entity:
domain: sensor
button_3:
name: Button 3
description: Entity ID for Button 3
selector:
entity:
domain: sensor
button_4:
name: Button 4
description: Entity ID for Button 4
selector:
entity:
domain: sensor
button_1_action:
name: Button 1 Action
description: Action for Button 1 press
default: []
selector:
action: {}
button_2_action:
name: Button 2 Action
description: Action for Button 2 press
default: []
selector:
action: {}
button_3_action:
name: Button 3 Action
description: Action for Button 3 press
default: []
selector:
action: {}
button_4_action:
name: Button 4 Action
description: Action for Button 4 press
default: []
selector:
action: {}
trigger:
- platform: state
entity_id: !input button_1
id: button_1
- platform: state
entity_id: !input button_2
id: button_2
- platform: state
entity_id: !input button_3
id: button_3
- platform: state
entity_id: !input button_4
id: button_4
condition:
- condition: template
value_template: "{{ trigger.to_state.attributes.event_type == 'initial_press' }}"
action:
- choose:
- conditions:
- condition: trigger
id: button_1
sequence: !input button_1_action
- conditions:
- condition: trigger
id: button_2
sequence: !input button_2_action
- conditions:
- condition: trigger
id: button_3
sequence: !input button_3_action
- conditions:
- condition: trigger
id: button_4
sequence: !input button_4_action
mode: single
Setup
- You will need one of SwitchBotâs Matter-enabled hubs. Set up Matter in the the hub setttings. Switchbot has a number of articles to help with this depending on if youâre using Android or iOS, or which hub you have.
- Follow SwitchBotâs guide to set up Matter on the Universal Remote. At the time of writing this, only 1 Matter confiuration can be done on a remote at a time.
- In Home Assistant, be sure to add the SwitchBot Hub as a Matter device. Home Assistant found this automatically for me. Once the Hub was added, the remote came in along with it as a Generic Switch, which can be renamed. With that, HA simply names each Button as âButton.â Iâve renamed mine for clarity:
- Make note of the Entity ID for each of the buttons. These come across as part of the
event
domain. Hereâs an example from mine:
- Create your new automation from the blueprint using each button Entity ID. HA doesnât seem to want to autocomplete entity ids from the âeventâ domain, so it may be easisest to copy/paste them individually. Hereâs where Iâve done it through the gui:
And through yaml (easier for copy/paste - I thinkâŚ)
- Add actions as it makes sense for you!
Feedback
I hope this blueprint is helpful to you in simplifying the process of calling actions based on remote button presses. I have 3 of these remotes and am glad to have created this blueprint for myself. I do welcome your feedback. Let me know how it works for you!