Very Easy Custom Philips Hue Dimmer Switch for Z2M(Zigbee2MQTT)

Shouldnt the choose not be like:

  - choose:
      - conditions:
          - condition: template
            value_template: "{{ True }}"
          - condition: template
            value_template: "{{ True }}"
        sequence: ...

PS.: dont get me wrong i am not an yaml/template expert :slight_smile:
Just guessing what yould lead to the warning.

thx

i have the same problem and message in the log viewer.
@PatpaC can you help us here?

@pOpY @bt1v1
Hmmm… I think this is mainly caused by the sluggishness of the automation and the too fast reset of the payload from the device.
NoneType is maybe bc the payload is already vanished when it tries to compare the payload with the values in the automation.

Simplified ~~~> a timing issue.

In z2mqtt I think you have an option to retain a payload for longer.
Can you try it? I sadly can’t now cause the remotes are in the rooms where my people are already sleeping :sweat_smile:

Sorry, don’t using the blueprint anymore.
Had it just for one automation, which throwed the warning. Since I removed it, the warnings are gone.
Sadly can’t test it anymore.

But thanks for your efforts!!!

Found the option. I have set it like this now. Is that ok? Will observe it.

Looks good. Hope it works for you :wink:

First of all, thanks for this blueprint!
I’m all new to HA and still trying to figure my devices out. I just came from enOcean PTM 215Z switch configuration and when setting up that i had some “problems” with the dimming decrease and increase wasn’t too smooth. I found some code inside that topic which led me to a smoother dimming.

So when I found this blueprint I used the same code for the hold function, but here it’s stepping. Its like it decrease or increase brightness for 3 seconds, then hold a very short pause and then do it again for 3 seconds until light is either off or on full brightness. Can anyone maybe tell me what the problem could be and a possible solution?

Here is my code.

alias: Auto - Hue Dimmer Switch
description: ""
use_blueprint:
  path: patpac9/Hue_Dimmer_Switch_Easy_Custom_Buttons.yaml
  input:
    controller: Switch Dimmer Guestroom
    on_press:
      - service: light.toggle
        data: {}
        target:
          entity_id: light.guestroom_ceiling
    up_held:
      - service: mqtt.publish
        data:
          topic: zigbee2mqtt/Guestroom Ceiling/set
          payload: "{\"brightness_move_onoff\": 51}"
          qos: 0
          retain: false
    up_hold_released:
      - service: mqtt.publish
        data:
          topic: zigbee2mqtt/Guestroom Ceiling/set
          payload: "{\"brightness_move\": \"stop\"}"
          qos: 0
          retain: false
    down_held:
      - service: mqtt.publish
        data:
          topic: zigbee2mqtt/Guestroom Ceiling/set
          payload: "{\"brightness_move_onoff\": -51}"
          qos: 0
          retain: false
    down_hold_released:
      - service: mqtt.publish
        data:
          topic: zigbee2mqtt/Guestroom Ceiling/set
          payload: "{\"brightness_move\": \"stop\"}"
          qos: 0
          retain: false

I’ve also tried another code but it is still stepping in the brightness not that much but does still occurs. I can get it smoother if i put a higher transition value, but stepping is never fully removed.

alias: Auto - Hue Dimmer Switch
description: ""
use_blueprint:
  path: patpac9/Hue_Dimmer_Switch_Easy_Custom_Buttons.yaml
  input:
    controller: Switch Dimmer Guestroom
    on_press:
      - service: light.toggle
        data: {}
        target:
          entity_id: light.guestroom_ceiling
    up_held:
      - service: light.turn_on
        data:
          brightness_step: 35
          transition: 1
        target:
          entity_id: light.guestroom_ceiling
    down_held:
      - service: light.turn_on
        data:
          brightness_step: -35
          transition: 1
        target:
          entity_id: light.guestroom_ceiling

Last I want to ask @PatpaC as author a question.

What are your reasons for not using the press and the release insted?

Unfortunately it didn’t help. Put it even higher? 20 seconds?

“Error in ‘choose[0]’ evaluation: In ‘template’ condition: TypeError: argument of type ‘NoneType’ is not iterable”

Any idea on how double/triple/quadruple presses could be implemented?

1 Like

For some reason it is not working for me.

If I look at the topic settings (settings>> MQTT>> basic topic) it says zigbee2mqtt so that is default like the blueprint.
Then I entered the friendly name of the device (in this case, Dimmer livingroom)

And then in entered a very normal call service toggle light option in the “release” section. But nothing happens.

Am I doing something wrong here?

You need to use the name you entered (or was entered for you) for the device in Z2M not what you have in HA.

I just started messing with this. I suck at yaml but my code does have smooth dimming. I think if you mess with the % and transition it could be pretty customizable. Let me know if this works well.

alias: Livingroom dim
description: Dims livingroom when held
use_blueprint:
  path: patpac9/Hue_Dimmer_Switch_Easy_Custom_Buttons.yaml
  input:
    controller: Hallway hue switch
    down_held:
      - service: light.turn_on
        metadata: {}
        data:
          brightness_step_pct: -20
          transition: 2
        target:
          entity_id: light.livingroom
    up_held:
      - service: light.turn_on
        metadata: {}
        data:
          brightness_step_pct: 20
          transition: 2
        target:
          entity_id: light.livingroom

Hi. Thanks for your reply.

I’ve tried your code and it’s better, but still not totally smooth. I could start playing with transition and brightness step but I would prefer to use mqtt.publish command, I read somewhere that it should be better than the other solution (brightness_step/brightness_step_pct). Any experience how to get that (mqtt.publish) to operate smoother?
Like I also mentioned in my first comment i use this code for my enOcean PTM 215Z and it operate like a charm, so I don’t know why it’s a problem when using Hue dimmer switch.

I have the same problem i cant not get the blueprint to work. I have tried both the friendly name and the mqqt id that was given at the time. I still dont get a response. if i set up my own automation i can get it to work.

Fairly new to HA and Z2M, but just discovered this blueprint and it is just what I needed. Thanks for sharing!

As a related question - I was initially attempting to set up this switch in Z2M using a bind. Has anyone had success with direct binding of this Hue Dimmer Switch to a light or set of lights using the Z2M GUI (Bind under device settings)?

Despite getting messages that the switch is bound to a light successfully i have had no luck getting a response using that method… just curious if anyone had similar experience.

to remove the warning just replace these lines:

  • conditions: ‘{{(’‘hold’’ in trigger.payload_json.action) or (‘‘release’’ in trigger.payload_json.action)
    or ‘‘press’’ in trigger.payload_json.action}}’

by this line:

  • conditions: ‘{{(trigger.payload_json.action is not none) and ((’‘hold’’ in trigger.payload_json.action) or (‘‘release’’ in trigger.payload_json.action) or (‘‘press’’ in trigger.payload_json.action))}}’

Reason: Hue dimmers are sending status updates regulary. However, these payloads do not have an “action” item. Hence, the whole payload is NULL which leads to this warning.

Hi guys.

Are you aware of the removal of the legacy “action” payload in the upcoming Z2M 2.0.0?

See here: Z2M 2.0.0, legacy triggers, _action entity's and hue dimmer blueprints · Koenkk/zigbee2mqtt · Discussion #24997 · GitHub
The blueprint i am using and i assume this one is not working anymore.

This is the one i am using: 💡 Awesome HA Blueprints: A curated list of blueprints + easily create controller-based automations (remotes, switches,...) for controlling lights, media players, and more - #106 by pOpY

What do you use now instead?

2 Likes

Well today I woke up with non working Philips dimmers:) guess I found the problem:):).

the WAF just went down:) I fly in 6 hours to the other end of the world…

You can enable the legacy action triggers in the z2mqtt options (tab “homeassasitant integration”) Then all should work again (till this is then depracted) but for the time beeing, this is a good way to go.

Guys here is an updated blueprint which uses mqtt json payload. That’s a real solutions until “events” are coming.

Here it is:

I swear, this would get the WAF high again :sunglasses: