Skip to content

Instantly share code, notes, and snippets.

@thomasmaxson
Last active September 23, 2025 22:09
Show Gist options
  • Save thomasmaxson/730d83fa9971097dc66a60a77a02d28c to your computer and use it in GitHub Desktop.
Save thomasmaxson/730d83fa9971097dc66a60a77a02d28c to your computer and use it in GitHub Desktop.
Home Assistant Blueprint to control your devices with a Philips Hue Tap Switch using the MQTT integration.
# This blueprint uses a Philips Hue Tap Remote Control connected through MQTT.
# This blueprint allows you to run custom actions with the remote's buttons
#
# | Button Type | Interaction | Action Choices |
# | ----------- | ----------------- | ------------------- |
# | One Dot | Press | - Run custom action |
# | ----------- | ----------------- | ------------------- |
# | Two Dots | Press | - Run custom action |
# | ----------- | ----------------- | ------------------- |
# | Three Dots | Press | - Run custom action |
# | ----------- | ----------------- | ------------------- |
# | Four Dots | Press | - Run custom action |
# | ----------- | ----------------- | ------------------- |
blueprint:
name: Philips Hue, Tap Remote Control
description: Control devices with your Philips Hue Tap remote.
author: Thomas Maxson
source_url: https://gist.github.com/thomasmaxson/730d83fa9971097dc66a60a77a02d28c
homeassistant:
min_version: 2024.6.0
domain: automation
input:
remote:
name: Philips Hue Tap remote control
description: Philips Hue Tap remote used to trigger actions.
selector:
device:
multiple: false
filter:
- integration: mqtt
manufacturer: Philips
model: Hue tap
default_button_events:
name: Button Events
icon: mdi:gesture-tap
collapsed: false
input:
action_press_dot_1:
name: 1 Dot Button Press Event
description: The action to perform on _press_ of the **1 Dot Button**.
default: []
selector:
action: null
action_press_dot_2:
name: 2 Dots Button Press Event
description: The action to perform on _press_ of the **2 Dots Button**.
default: []
selector:
action: null
action_press_dot_3:
name: 3 Dots Button Press Event
description: The action to perform on _press_ of the **3 Dots Button**.
default: []
selector:
action: null
action_press_dot_4:
name: 4 Dots Button Press Event
description: The action to perform on _press_ of the **4 Dots Button**.
default: []
selector:
action: null
mode: restart
max: 3
max_exceeded: silent
variables:
trigger_command: "{{ trigger.to_state.state }}"
triggers:
- trigger: state
entity_id: !input "remote"
attribute: action
conditions:
- condition: template
value_template: "{{ var_remote | count > 0 }}"
actions:
- choose:
- conditions:
- "{{ trigger_command == 'press_1' }}"
sequence: !input action_press_dot_1
- conditions:
- "{{ trigger_command == 'press_2' }}"
sequence: !input action_press_dot_2
- conditions:
- "{{ trigger_command == 'press_3' }}"
sequence: !input action_press_dot_3
- conditions:
- "{{ trigger_command == 'press_4' }}"
sequence: !input action_press_dot_4
@julienma
Copy link

julienma commented Sep 11, 2025

Hey Thomas, I stumbled on your blueprint, seems nice!
After importing it, I set up an automation but get an error when saving: Message malformed: Unknown entity registry entry ec7adf9f5145a3565bf2e55c5afc4207. This seems to be the ID of my [Z2M device's] Hue Tap when I selected it via the "remote" input dropdown.

Here's the generated automation:

description: ""
alias: Salon - Interupteur lampes salon avec Philips Hue Tap
use_blueprint:
  path: thomasmaxson/remote_philips_hue_tap.yaml
  input:
    remote: ec7adf9f5145a3565bf2e55c5afc4207
    action_press_dot_1:
      - action: light.toggle
        metadata: {}
        data: {}
        target:
          area_id: piece_principale
    action_press_dot_2:
      - action: light.toggle
        metadata: {}
        data: {}
        target:
          entity_id: light.salon_appliques
    action_press_dot_3:
      - action: light.toggle
        metadata: {}
        data: {}
        target:
          entity_id:
            - light.salon_trepied
    action_press_dot_4:
      - action: light.toggle
        metadata: {}
        data: {}
        target:
          entity_id: light.salon_canape_applique

Here's some details about the Z2M entry in HA:

image

Here's the log from Z2M:

image

I tried replacing the entity ID (ec7adf9f5145a3565bf2e55c5afc4207) with salon_interrupteur_huetap and 0x000000000047f221, but nothing works.

Any idea of how to get the correct ID? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment