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

I get an unknown error when trying to import this blueprint.

Same here!

- id: '1655240391531'
  alias: Controller - Philips 324131092621 Hue Dimmer switch
  description: ''
  use_blueprint:
    path: EPMatt/philips_324131092621.yaml
    input:
      integration: ZHA
      controller_device: 2e01a9e75464cb463155da7345cc24ac
      action_button_on_short:
      - service: light.turn_on
        data:
          brightness_pct: 70
        target:
          entity_id:
          - light.living_room_tv_lights_subgroup
          - light.living_room_hue_go_lights_subgroup
      action_button_off_short:
      - service: light.turn_off
        data:
          transition: 3
        target:
          entity_id:
          - light.living_room_tv_lights_subgroup
          - light.living_room_hue_go_lights_subgroup
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4107, maximum_buffer_size=71, maximum_incoming_transfer_size=45, server_mask=0, maximum_outgoing_transfer_size=45, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": 49246,
      "device_type": "0x0830",
      "in_clusters": [
        "0x0000"
      ],
      "out_clusters": [
        "0x0000",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0008"
      ]
    },
    "2": {
      "profile_id": 260,
      "device_type": "0x000c",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x000f",
        "0xfc00"
      ],
      "out_clusters": [
        "0x0019"
      ]
    }
  },
  "manufacturer": "Philips",
  "model": "RWL020",
  "class": "zhaquirks.philips.rwlfirstgen.PhilipsRWLFirstGen"
}

I’m getting the following error with Hue DImmer V2. Can you help me out correcting this?

Blueprint Controller - Philips 324131092621 Hue Dimmer switch generated invalid automation with inputs OrderedDict([('integration', 'deCONZ'), ('controller_device', '0a9782da5b73724fca7937bc327690ae'), ('helper_last_controller_event', 'input_text.kinderzimmer_input_text'), ('action_button_on_short', [OrderedDict([('service', 'scene.turn_on'), ('target', OrderedDict([('entity_id', 'scene.kinderzimmer_tageslicht')])), ('metadata', OrderedDict())])]), ('action_button_off_short', [OrderedDict([('service', '')])]), ('action_button_up_short', [OrderedDict([('service', 'scene.turn_on'), ('target', OrderedDict([('entity_id', 'scene.kinderzimmer_gedimmt')])), ('metadata', OrderedDict())])]), ('action_button_down_short', [OrderedDict([('service', 'scene.turn_on'), ('target', OrderedDict([('entity_id', 'scene.kinderzimmer_nachtlicht')])), ('metadata', OrderedDict())])])]): Service does not match format <domain>.<name> for dictionary value @ data['action'][3]['choose'][3]['sequence'][0]['choose'][0]['sequence'][0]['default'][2]['choose'][0]['sequence'][0]['service']. Got None Service does not match format <domain>.<name> for dictionary value @ data['action'][3]['choose'][3]['sequence'][0]['default'][1]['choose'][0]['sequence'][0]['service']. Got None

With the new trigger_id settings, I was able to mimic the behavior (and more) of the original hue remote without a blueprint, using the UI. Basically, I created a counter and 2 automations.

Disclaimer, I just barely tested this but it seems to be working.
I may still hit a bug, but wanted to share here.
I’ll update it if it needs correcting. Please comment with any input or suggestions.

First, I built a simple counter helper with an initial value of 0 and step of 1.

Next we increment the counter using an automation:

alias: 'Hue Remote: Living Room Counter'
  description: ''
  trigger:
  - platform: device
    domain: mqtt
    device_id: 3b5d102784be447d571e93638db7fc67
    type: action
    subtype: on_press
    discovery_id: 0x001788011033d61f action_on_press
  condition: []
  action:
  - service: counter.increment
    data: {}
    target:
      entity_id: counter.counter_living_room_button_press
  mode: single

Now, we build an automation for capturing and executing on multiple button presses:

  alias: 'Hue Remote: Living Room Multi-Press Action'
  description: ''
  trigger:
  - platform: state
    entity_id:
    - counter.counter_living_room_button_press
    id: 2_press
    to: '2'
    for:
      hours: 0
      minutes: 0
      seconds: 2
  - platform: state
    entity_id:
    - counter.counter_living_room_button_press
    for:
      hours: 0
      minutes: 0
      seconds: 2
    to: '3'
    id: 3_press
  - platform: numeric_state
    entity_id: counter.counter_living_room_button_press
    id: reset_counter
    for:
      hours: 0
      minutes: 0
      seconds: 2
    above: '3'
  condition: []
  action:
  - choose:
    - conditions:
      - condition: trigger
        id: 2_press
      sequence:
      - service: scene.turn_on
        data:
          transition: 3
        target:
          entity_id: scene.cozy
      - service: counter.reset
        data: {}
        target:
          entity_id: counter.counter_living_room_button_press
    - conditions:
      - condition: trigger
        id: 3_press
      sequence:
      - service: scene.turn_on
        data:
          transition: 2
        target:
          entity_id: scene.daybreak
      - service: counter.reset
        data: {}
        target:
          entity_id: counter.counter_living_room_button_press
    - conditions:
      - condition: trigger
        id: reset_counter
      sequence:
      - service: counter.reset
        data: {}
        target:
          entity_id: counter.counter_living_room_button_press
    default: []
  mode: single

This method basically creates a 2 second time window to press the buttons before the triggers are activated. Also, if the count limit is exceeded, the counter resets. It could be modified to support many more presses. Additionally, multiple counters could be configured to use this technique for every button if you wanted to.

It looks far scarier here in YAML format, so if you want to try this but are having issues, let me know and I’ll post screenshots. I am just trying to keep the post short.

Hi epmatt

Thanks for this nice blueprint.
I’m pretty new to this, so sorry for the dumb question.

I just created a “input_text.helper_last_controller_event” for my DimmerSwitch1.

Do I need an additional input_text-helper for a 2. DimmerSwitch2 or can I just use the same input_text-helper for all my DimmerSwitches?

Thank you very much!

Hi epmatt

This looks like a really useful blueprint and I think you are a really capable programmer. So I hope this following is somehow possible.

How can I set it up for multiple button presses?
I would love to set it up like it was possible in the “Hue Essentials” app (https://play.google.com/store/apps/details?id=com.superthomaslab.hueessentials&hl=de_CH&gl=US).

Here there are multiple possibilities to turnOn, turnOff, setScene, increseBrightness, … combined with multiple buttenpresses (e.g. press ON 5. time = setScene “ET [8] neutral”, hold OFF 2. time = turnOff switch of TV)

I hope it’s somewhat clear what I mean, otherwise pleas just ask and I’m happy to clarify my thoughts.

Is this somehow possible?

This would be really awesome!!!

Thank you very much!

This blueprint isn’t working for me. The first condition never gets through.

Been moving from Deconz to z2m and this blueprint is exactly what I’ve been looking for but I am getting the exact same error as @shawn99

Any debugging/logs we can provide, I’d be more than happy.

Thanks

Yeah. It’s very annoying. Now I have to control my lights with Alexa or Mobile app ughh

I had to change the blueprint.
The Z2M actions have (I think) a new format. They use underscores instead of dashes
Change line 324 and below.

From:

    zigbee2mqtt:
      button_on_short: [on-press]
      button_on_long: [on-hold]
      button_on_release: [on-hold-release]
      button_off_short: [off-press]
      button_off_long: [off-hold]
      button_off_release: [off-hold-release]
      button_up_short: [up-press]
      button_up_long: [up-hold]
      button_up_release: [up-hold-release]
      button_down_short: [down-press]
      button_down_long: [down-hold]
      button_down_release: [down-hold-release]

To

    zigbee2mqtt:
      button_on_short: [on_press]
      button_on_long: [on_hold]
      button_on_release: [on_hold_release]
      button_off_short: [off_press]
      button_off_long: [off_hold]
      button_off_release: [off_hold_release]
      button_up_short: [up_press]
      button_up_long: [up_hold]
      button_up_release: [up_hold_release]
      button_down_short: [down_press]
      button_down_long: [down_hold]
      button_down_release: [down_hold_release]
3 Likes

Thanks … saved me from hours of frustration. I had to make this change after moving from old Conbee stick to Sonoff Zigbee 3.0 dongle.

Nice one, this got it working for me also.

Appreciate it.

Me again,

So I’ve now got this working with the Light Hook as well and can control lights with dimming etc and it works great.

What I’m also trying to achieve is using the same dimmer switch when holding the on button for it to turn on a lamp, when I do this though it also detects the on press and runs the hook for the lights to they both turn on.
Is there anyway I can achieve what I’m after?

Thanks all.

THANKS!!! That did it.

Hello,

I am trying to use this blueprint with my V1 Hue dimmer but can get the brightness up/ down to work can someone give me a pointer on what I am missing?

Hook YAML:

alias: SLEEPING Remote (Hook)
description: ""
use_blueprint:
  path: EPMatt/light.yaml
  input:
    controller_device: ad9f92d389ab9e6c87ca7b6b0782c6aa
    controller_entity: sensor.sleeping_remote_battery
    controller_model: Philips 324131092621 Hue Dimmer switch
    light: light.sleeping
    on_brightness: 255
    force_brightness: true

Controller YAML

alias: SLEEPING Remote (Controller)
description: ""
use_blueprint:
  path: EPMatt/philips_324131092621.yaml
  input:
    integration: ZHA
    controller_device: ad9f92d389ab9e6c87ca7b6b0782c6aa
    helper_last_controller_event: input_text.sleeping_light_remote_last_event
    action_button_on_short: []
    action_button_off_short: []
    action_button_off_long: []

My understanding is that IF I leave the actions empty it uses the defaults as expland in the docs?

thx, that worked also for me. Would be nice if the blueprint on github get’s updates.

@Photelegy Please compare

I interpret the “CAUTION box” as advice to create a helper for each device, even if you make use of the same blueprint. Just to avoid running into inconsistencies when two person push a button on different dimmers almost the same time.

Hello!
Thank you for this very nice blueprint. Just one thing isn’t working for me: Double Pressing a button does not work for me. Nothing happens, no matter the settings for it. Am I doing something wrong?

Thanks!

Have you enabled this?

(I had the same issue :slight_smile: ). This made the double on press work for me, but unfortunately it stopped the single press on from working. Maybe both can work for you?