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:

A new version for the PTM21xZ/ZE family is available here.

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.04:
A new version is now available :arrow_forward: HERE :arrow_backward:. Any PTM21xZ/ZE is supported as well as the multiple controller in the blueprint.

HOW TO UPGRADE

  1. Import the new blueprint
  2. Open your automation based on the older version
    2.1 Edit in YAML
    PTM215Z/ZE
    2.2.1. Update line 4 from path: path: Chris/PTM_215Z_ZE.yaml to path: path: Chris/PTM_21xZ_ZE.yaml
    PTM216Z
    2.2.2. Update line 4 from path: path: Chris/PTM_216Z.yaml to path: path: Chris/PTM_21xZ_ZE.yaml

DOWNLOAD (Older version)

Standard version:

Second 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
3 Likes

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.

Hi, I have the problem that the press action is always executed, even after holding (using v2).
This is not a problem when switching on/dimming brighter, but when dimming darker, the lamp always goes out afterwards. How can this be fixed?

    button_2_held:
      - repeat:
          count: 50
          sequence:
            - action: light.turn_on
              metadata: {}
              data:
                brightness_step: -15
                transition: 1
              target:
                entity_id: light.devzb_buero
            - delay:
                milliseconds: 300
    button_2_pressed:
      - type: turn_off
        device_id: d9811fc
        entity_id: e54436ff
        domain: light

Best regards

I just tested the blueprint again and it works as expected.
What you describe is when the light is decreased at minimum brightness. According to the light integration, when the brightness goes to 0, a light.turn_off command is then send to the light. This explain why you have the felling the blueprint does not work.

If your lights are connected to Zigbee2mqtt, I would use the standard version with brightness_move or brightness_move_onoff command which allow a better dimming experience.
I would also use the blueprint available in Zigbee2MQTT - PTM215Z/ZE and PTM216Z which is updated when required. I do not update the blueprint available in that thread anymore.