🎮 ZHA, deCONZ, Zigbee2MQTT - Philips 324131092621 Hue dimmer switch Universal blueprint - all actions + double click events - control lights, media players and more with Hooks

This user has been inactive for some time, the blueprint below is still available, but please be advised it may no longer work.

Original Post

This blueprint is part of the Awesome HA Blueprints project.
Read more about it on the related Community Forum topic. :rocket:

Updates will be published on the project’s GitHub repository.

:arrow_down: Get Started

Option 1: My Home Assistant

Click the badge to import this Blueprint (needs Home Assistant Core 2021.3 or higher)

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

Option 2: Direct Link

Copy this link if you want to import the blueprint in your installation.

:link: Blueprint URL

:page_facing_up: Description

Philips 324131092621 Hue Dimmer switch|200X200

This blueprint provides universal support for running any custom action when a button is pressed on the provided Philips 324131092621 Hue Dimmer switch. Supports controllers integrated with deCONZ, ZHA, Zigbee2MQTT. Just specify the integration used to connect the remote to Home Assistant when setting up the automation, and the blueprint will take care of all the rest.

In addition of being able to provide custom actions for every kind of button press supported by the remote, the blueprint allows to loop the long press actions while the corresponding button is being held. Once released, the loop stops. This is useful when holding down a button should result in a continuous action (such as lowering the volume of a media player, or controlling a light brightness).

The blueprint also adds support for virtual double button press events, which are not exposed by the controller itself.

Automations created with this blueprint can be connected with one or more Hooks supported by this controller.
Hooks allow to easily create controller-based automations for interacting with media players, lights, covers and more. See the list of Hooks available for this controller for additional details.

:closed_book: Full Documentation

Full documentation regarding requirements, inputs and more is available here.

Docs provide all the information you need to properly configure this blueprint on your instance.

:electric_plug: Available Hooks

:bulb: Light

This Hook blueprint allows to build a controller-based automation to control a light. Supports brightness and color control both for white temperature and rgb lights.

Light Hook docs

:loud_sound: Media Player

This Hook blueprint allows to build a controller-based automation to control a media player. Supports volume setting, play/pause and track selection.

Media Player Hook docs

:information_source: Changelog

Updated list of changes and improvements is available here.

Happy automating to everyone! :fire:

7 Likes

This does not work for me: I am running 2021.3.4 with ZHA integration. And I keep getting the following output in my configuration log:

Logger: homeassistant.components.automation.zoe_hue_dimmer_switch
Source: components/automation/init.py:416
Integration: Automation (documentation, issues)
First occurred: 3:23:14 PM (1 occurrences)
Last logged: 3:23:14 PM

Error while executing automation automation.zoe_hue_dimmer_switch: UndefinedError: ‘trigger’ is undefined

I properly setup the input entity. and I do see the last run is being invoked.

As a reference I just tried this one and it works like a charm:

Your plugin seems more configurable so if you fix I’ll try it again.

Hi @shellcode,

I’m sorry for what you’re experiencing with this blueprint.
Could you please provide the YAML for the automation you are having issues with?

Thank you!

alias: Test
description: ''
use_blueprint:
  path: EPMatt/philips_324131092621.yaml
  input:
    integration: ZHA
    controller_device: 3a7fd0f77f7c1813ce66d996965b97f0
    action_button_on_short:
      - service: light.turn_on
        data:
          color_name: pink
          brightness_pct: 65
        target:
          device_id: dd4941910580bef11417cd8a28fc24de
    action_button_off_short:
      - service: light.turn_off
        target:
          device_id: dd4941910580bef11417cd8a28fc24de
    helper_last_controller_event: input_text.zoe_hue_dimmer_switch

Hi @shellcode, thank you for reporting. The config looks good to me.

Just as a note, are you triggering the automation by pressing a button on the controller, as it is intended?

It looks like the error refers to the trigger object not being available in the first steps of the automation, usually happening when an automation is manually run from the Configuration -> Automations page.

Thanks!

No, I’m just showing you the only output I can find associated to this automation.

I’m using a Phillips Hue Dimmer Switch, and I see all the zha_event properly via Node Red with a debug node. And it works with the other blueprint I linked above. So I have multiple remotes and I have one associated to your blueprint and one associated to the other blueprint . So I know events are arriving from the remote, and I see the last run for the automation update. However, the lights do not switch on and off with your blueprint.

And:
image

I only started using Home Assistant a few months ago, so I’m a newbie. If there is a way to grab more detailed information, I can get it for you.

Hi @shellcode,
thank you for your detailed response. :slight_smile:
I’ll take a look at this issue in the next days and let you know if additional info might be useful for solving it.

Thank you for your help. :+1:

Hi
The Ikea On/Off blueprint works for me with Deconz, but not this one.
If i use the Philips dimmer with that blueprint it works as expected for the 2 upper buttons (the 1000-2003 events from Deconz).

Hi @damtjern,

which model number is your Philips Hue Dimmer? Currently, this blueprint only supports the device with model no.324131092621.

Can you also provide the YAML for the automation you’re configuring with this blueprint?

Thank you!

Having a similar issue as the poster above. Confirmed that I’m using 324131092621.

Seeing this error in the trace timeline at step 6…

Stopped because an error was encountered at July 26, 2021, 10:01:12 PM (runtime: 0.02 seconds)
not a valid value for dictionary value @ data[‘entity_id’]

And here’s what the automation YAML looks like (just something basic while troubleshooting).

alias: Test
description: ''
use_blueprint:
  path: EPMatt/philips_324131092621.yaml
  input:
    integration: deCONZ
    controller_device: 8e0d65a64a07581ec12b5e4a7bc8eacb
    action_button_on_short:
      - scene: scene.gaming
    action_button_up_short:
      - type: turn_off
        device_id: 54deaf4ca9c2335f3a3cdd36df63ed45
        entity_id: light.main_floor
        domain: light

I’ve tried a few different buttons/actions to no avail.

Thank you for this blueprint, just what I was looking for.

I setup the blueprint to activate a scene on double up press but it is failing to run any actions as it does not pass the conditions stage.

Executed: 7 August 2021, 20:39:39
Result:
result: false
conditions/0

Executed: 7 August 2021, 20:39:39
Result:
result: false
entities: []
condition: and
conditions:
  - >-
    {%- set trigger_action -%} {%- if integration_id == "zigbee2mqtt" -%} {{
    trigger.event.data.new_state.state }} {%- elif integration_id == "deconz"
    -%} {{ trigger.event.data.event }} {%- elif integration_id == "zha" -%} {{
    trigger.event.data.command }}{{"_" if trigger.event.data.args|length > 0}}{{
    trigger.event.data.args|join("_") }} {%- endif -%} {%- endset -%} {{
    trigger_action not in ["","None"] }}
  - >-
    {{ integration_id != "zigbee2mqtt" or trigger.event.data.new_state.state !=
    trigger.event.data.old_state.state }}

My yaml:

alias: Blueprint - Controller - Philips Hue Dimmer switch
description: ''
use_blueprint:
  path: EPMatt/philips_324131092621.yaml
  input:
    integration: Zigbee2MQTT
    controller_entity: sensor.living_room_buttons_action
    helper_last_controller_event: input_text.hue_dimmer_switch_helper
    button_on_double_press: false
    button_up_double_press: true
    action_button_up_double:
      - scene: scene.xbox_lighting_scene
    helper_double_press_delay: 2000

Can’t seem to get the light hook to work with my Philips dimmer. Here is my yaml:

- id: '1628860362772'
  alias: Controller - Cabinet Lights Philips Hue Dimmer switch
  description: ''
  use_blueprint:
    path: EPMatt/philips_324131092621.yaml
    input:
      integration: ZHA
      controller_device: 5e82410c32d2dfda8a8f19a6eb8b76d7
      helper_last_controller_event: input_text.cabinet_switch_helper_last_controller_event
- id: '1628860424189'
  alias: Hook - Light - Cabinet Lights
  description: ''
  use_blueprint:
    path: EPMatt/light.yaml
    input:
      light_color_mode: Auto
      controller_device: 5e82410c32d2dfda8a8f19a6eb8b76d7
      controller_model: Philips Hue Dimmer switch
      light: light.cabinets

Would be nice to also have a Hue Tap version :nerd_face:

1 Like

Thanks for nice blueprint! I wanted it for Dimmer switch v2 with zigbee2mqtt, which of course, was not working. Thankfully, there is simple change:
rename commands from ‘on-press’ to ‘on_press’.
Can you please add it as separate switch? PN: 9290023986

I’m having trouble getting the short press up/down to work when also using the double press. After a single up/down button press, the delay waits for the double press and in this time the process gets reset by the up/down release.


Executed: November 17, 2021, 10:27:13 PM
Result:

delay: 0.5 done: false

I can lower the delay so that it just executes, but then the double press must be done very fast.

Hi everyone,

thank you for reporting here, sorry for my late response. I’m trying to keep up with all the messages I’m receiving both here and on GitHub, and answering all of your questions, with the same attention to every single one of them, but sometimes I miss a few posts here and there.

@Vicis welcome to the HA Community forum! :slight_smile: While configuring the blueprint you need to provide a valid input_text entity for the helper_last_controller_event input, as described in the Inputs section in the blueprint documentation.
You can find additional details regarding this mandatory input in the general Controller-Hooks Ecosystem documentation.
Please let me know if adding the missing blueprint input solves your issue.

@jackpea try to add an action for the up button short press. Does it get executed in place of the double press action? If this is the case, the issue might be with the helper_double_press_delay being too small, or the two short presses too close in time.

@pmontgo33 the YAML for your automations looks good to me. Could you please share screenshots/traces from the HA automation trace tool for the automation runs triggered when interacting with the controller? This way we should be able to detect what is causing the lamp not to be controlled by the automation.

@svh1985 @lucidnx (welcome to the HA Community forum! :smiley:) thank you so much for your suggestions! I’m glad to add support for both of these controllers in our collection. I’ll let you know as soon as blueprints for these devices are ready. :+1:

@rubencvdb welcome to the HA Community! :rocket: So the up/down release event is fired after short pressing the up/down buttons, is that right? Unfortunately I don’t own a Philips Hue Dimmer Switch, therefore I cannot check this on my own.

Thank you all for your patience!

1 Like

Thanks!

Yes, the release event immediately follows the short (or long) press of every button. I fixed my usecase by moving all short press actions to the release event! So after a release, it waits the double_press_delay and if nothings happens it executes the short press action.

Btw, I am using the v2 switch 9290023986 and everything works fine! Only had to change the release event mapping from 3003->3002 and 2003->2002 for up/down buttons.

It’s the same for Dimmer V1 when you have set legacy to false for the device.
When you set it to legacy, it sends on-press again.

1 Like

I try to clean up my HA setup and I remove this blueprint.
But now I get this message in HA log.


Logger: homeassistant.config
Source: components/blueprint/models.py:211 
First occurred: 23:17:12 (1 occurrences) 
Last logged: 23:17:12

Invalid config for [automation]: Failed to load blueprint: Unable to find EPMatt/philips_324131092621.yaml (See /home/homeassistant/homeassistant/configuration.yaml, line 232).
Traceback (most recent call last):
  File "/usr/local/share/homeassistant/lib/python3.9/site-packages/homeassistant/components/blueprint/models.py", line 209, in _load_blueprint
    blueprint_data = yaml.load_yaml(self.blueprint_folder / blueprint_path)
  File "/usr/local/share/homeassistant/lib/python3.9/site-packages/homeassistant/util/yaml/loader.py", line 110, in load_yaml
    with open(fname, encoding="utf-8") as conf_file:
FileNotFoundError: [Errno 2] No such file or directory: '/home/homeassistant/homeassistant/blueprints/automation/EPMatt/philips_324131092621.yaml'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/share/homeassistant/lib/python3.9/site-packages/homeassistant/components/automation/config.py", line 103, in _try_async_validate_config_item
    config = await async_validate_config_item(hass, config, full_config)
  File "/usr/local/share/homeassistant/lib/python3.9/site-packages/homeassistant/components/automation/config.py", line 70, in async_validate_config_item
    return await blueprints.async_inputs_from_config(config)
  File "/usr/local/share/homeassistant/lib/python3.9/site-packages/homeassistant/components/blueprint/models.py", line 297, in async_inputs_from_config
    blueprint = await self.async_get_blueprint(bp_conf[CONF_PATH])
  File "/usr/local/share/homeassistant/lib/python3.9/site-packages/homeassistant/components/blueprint/models.py", line 275, in async_get_blueprint
    blueprint = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/share/homeassistant/lib/python3.9/site-packages/homeassistant/components/blueprint/models.py", line 211, in _load_blueprint
    raise FailedToLoad(
homeassistant.components.blueprint.errors.FailedToLoad: Failed to load blueprint: Unable to find EPMatt/philips_324131092621.yaml

I double check, I can’t find any automation the use that blueprint.
Any idea ?