Zigbee2MQTT - PTM215Z/ZE

Mainly based on the hard work of @vandalon and @alexsaas who was my beta tester…

:warning:Choose carefully the version according to your needs :warning:

There are explanations in the UPDATE section to see the main differences between the versions available.

Home Assistant must run version 2024.10.x minimum in order to use those blueprints.

Tested on Z2M versions 1.x and 2.x.

UPDATE

2025.02 :
There are two different versions of the blueprint available. The second version (v2) aim to enable the repeat function which eases the dimming when using HA commands.
PTM215ZE: New commands added (version - 2025.02.12)

DOWNLOAD

Standard version:

New version (v2):

:warning: :warning: :warning:

elapsed has to be enabled in Zigbee2mqtt. Go to Settings → Advanced

EXAMPLES

Here, some examples how to use those blueprints especially for the dimming commands.

Work in both versions:

    button_1_held:
      - action: mqtt.publish
        data:
          qos: "0"
          retain: false
          topic: zigbee2mqtt/friendly_name/set
          payload: "{\"brightness_move\": 50}"
        enabled: true
    button_1_released:
      - action: mqtt.publish
        data:
          qos: "0"
          retain: false
          topic: zigbee2mqtt/friendly_name/set
          payload: "{\"brightness_move\": \"stop\"}"
        enabled: true

Work in v2 only:

    button_1_held:
      - repeat:
          count: 15
          sequence:
            - action: light.turn_on
              metadata: {}
              data:
                brightness_step: -25
                transition: 1
              target:
                entity_id: light.my_light
            - delay:
                milliseconds: 500
1 Like

As a beta tester :sweat_smile:, I can confirm that this blueprint works perfectly. Many thanks to @chris-1243

Hello
I am following your blueprint for a while on github. (zigbee2mqtt v.2 trigger)

i would like to use your bluepring, but repeated dimming with hold is not possible.
is there a way to implement repeat on hold in your blueprint? (at the moment the dimming funktion is only triggered once.

PS: i found two methodes for dimming lights:

1.)

repeat:
  count: 25
  sequence:
    - action: mqtt.publish
      metadata: {}
      data:
        evaluate_payload: false
        qos: 0
        retain: false
        payload: "{\"brightness_step\": -20}"
        topic: zigbee2mqtt/lampe_buro_oben/set
      enabled: true
    - delay:
        milliseconds: 500

2.)

repeat:
  count: 25
  sequence:
    - data:
        transition: 1
        brightness_step: 25
      target:
        entity_id:
          - light.lampe_kinderklein
      action: light.turn_on
    - delay:
        milliseconds: 500

@propi62

Hello,
It should not be so complicated to modify the blueprint. It would be a complete re-write of the code unfortunately. I am using mode: single . This is why your automation is not repeated.
May I suggest, as you are dimming a light via Zigbee2mqtt, to use the brightness_move command. It would be like:

Button_x_held:

    - action: mqtt.publish
      metadata: {}
      data:
        evaluate_payload: false
        qos: 0
        retain: false
        payload: "{\"brightness_move\": -50}"
        topic: zigbee2mqtt/lampe_buro_oben/set

Button_x_release:

    - action: mqtt.publish
      metadata: {}
      data:
        evaluate_payload: false
        qos: 0
        retain: false
        payload: "{\"brightness_move\": "stop"}"
        topic: zigbee2mqtt/lampe_buro_oben/set

You should have a smooth dimming. Actually, this what I use and I am very happy of the dimming.

@propi62

There is an update available. Check the first post.

i also use the mqtt.publish method now, because it performs the best an smoothest dimming on my tests.

small change: using {“brightness_move_onoff”: 20} also allows dimming from and to light completely off.

i use it in your V2 blueprint, but it also works in V1.

PS: is there a disadvantage of elapsed turned on?

thank you very much

    button_1_held:
      - action: mqtt.publish
        metadata: {}
        data:
          topic: zigbee2mqtt/lampe_buro_oben/set
          payload: "{\"brightness_move_onoff\": 30}"
        alias: MQTT Dimming UP

    button_1_released:
      - action: mqtt.publish
        metadata: {}
        data:
          topic: zigbee2mqtt/lampe_buro_oben/set
          payload: "{\"brightness_move\": \"stop\"}"
        alias: MQTT Dimming STOP

@propi62

There is no disadvantage to have the elapsed option turned on. It is used to measure the time between two commands. I have not found an other way, for the moment, to measure easily the time between two mqtt topic.

If you do not want to use the elapsed option, you may try this blueprint based on the experimental events. The main problem with Z2M events is there might be some breaking changes in the incoming future as it is not yet completely implemented.

I am personally going to stick on mqtt as it will not change that much.

Thanks to have tested both.