SwitchBot Universal Remote Button Handler

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.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

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

  1. 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.
  2. 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.
  3. 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:

  1. 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:

  1. 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…)

yaml

  1. 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!

1 Like

Currently experiencing this error while trying to import

image

I believe I’ve fixed it. Please try it again and let me know what your results are.

Thanks for your patience!

1 Like

Unfortunaly matter function/support does not appear in the app or the remote, because its not supported by Google Home, as it seems.
Meaning that the events dont trigger on HA.

Edit:
Unless I am missing anything :confused:

1 Like

Good day, is there any solution to the buttons not showing up on the remote? I have the exact same issue where the buttons are showing up in Home Assistant, but I am unable to activate Matter as a third-party control on the remote.