Zigbee2mqtt - EnOcean PTM 215Z On-Off-Dimming

A input boolean helper must be created to use the blueprint
Updated to use MQTT, now works with Zigbee2MQTT 2.0

blueprint:
  name: zigbee2mqtt - EnOcean PTM 215Z On-Off-Dimming MQTT
  description: Control lights with MQTT actions including on, off, and brightness adjustments for top and bottom lights.
  domain: automation
  input:
    mqtt_device:
      name: MQTT Device
      description: "Select the MQTT device for triggers."
      selector:
        device:
          integration: mqtt

    light_top:
      name: Top Light
      description: The light controlled by the top actions.
      selector:
        entity:
          domain: light

    light_bottom:
      name: Bottom Light
      description: The light controlled by the bottom actions.
      selector:
        entity:
          domain: light

    dimming_boolean:
      name: Dimming Occurred Boolean
      description: "Select the input_boolean for tracking dimming."
      selector:
        entity:
          domain: input_boolean

trigger:
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: press_1
    id: press_1
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: release_1
    id: release_1
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: press_3
    id: press_3
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: release_3
    id: release_3
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: press_2
    id: press_2
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: release_2
    id: release_2
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: press_4
    id: press_4
  - platform: device
    device_id: !input mqtt_device
    domain: mqtt
    type: action
    subtype: release_4
    id: release_4

condition: []

action:
  - choose:
      - conditions:
          - condition: trigger
            id: press_1
        sequence:
          - service: light.turn_on
            target:
              entity_id: !input light_top
          - delay:
              seconds: 0.5
          - repeat:
              count: 7
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: 15
                    transition: 0
                  target:
                    entity_id: !input light_top
                - delay:
                    seconds: 0.5
      - conditions:
          - condition: trigger
            id: press_3
        sequence:
          - delay:
              seconds: 0.5
          - service: input_boolean.turn_on
            target:
              entity_id: !input dimming_boolean
          - repeat:
              count: 7
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: -15
                    transition: 0
                  target:
                    entity_id: !input light_top
                - delay:
                    seconds: 0.5
      - conditions:
          - condition: trigger
            id: release_3
        sequence:
          - if:
              - condition: state
                entity_id: !input dimming_boolean
                state: "off"
            then:
              - service: light.turn_off
                target:
                  entity_id: !input light_top
            else:
              - service: input_boolean.turn_off
                target:
                  entity_id: !input dimming_boolean

      - conditions:
          - condition: trigger
            id: press_2
        sequence:
          - service: light.turn_on
            target:
              entity_id: !input light_bottom
          - delay:
              seconds: 0.5
          - repeat:
              count: 7
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: 15
                    transition: 0
                  target:
                    entity_id: !input light_bottom
                - delay:
                    seconds: 0.5
      - conditions:
          - condition: trigger
            id: press_4
        sequence:
          - delay:
              seconds: 0.5
          - service: input_boolean.turn_on
            target:
              entity_id: !input dimming_boolean
          - repeat:
              count: 7
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: -15
                    transition: 0
                  target:
                    entity_id: !input light_bottom
                - delay:
                    seconds: 0.5
      - conditions:
          - condition: trigger
            id: release_4
        sequence:
          - if:
              - condition: state
                entity_id: !input dimming_boolean
                state: "off"
            then:
              - service: light.turn_off
                target:
                  entity_id: !input light_bottom
            else:
              - service: input_boolean.turn_off
                target:
                  entity_id: !input dimming_boolean

mode: restart

I am a bit confused my friend.
Is this a finished blueprint you are sharing or a not working blueprint that you have a question with?

Just passing along if anyone is interested…

1 Like

@wmaker
Hi, may I ask if you’re still using this blueprint from Vandalon? I unfortunately get warnings in the log after every full system reboot. Maybe you had this too and have a solution? Here I explain the message:

Hi,
No I actually never used it. I was transitioning from Philips Hue to Z2M and was doing research on the PTM215Z I have for use with Z2M. I came across his Blueprint while doing this research, and so when I came across this thread I was just passing the information along.

Okay, too bad. But thanks for the feedback. Are you using a different blueprint that works well?

In my case, I only want to turn lights ON and OFF (no dimming needed) so the automations are simple and I made them myself.

Ok. Then I have to keep looking. But it was worth a try. Thank you again.

Hi alexsaas, please let me/us know what you ended up with after researching :slight_smile:

Hi @sumsaricum

In the end I stuck with the blueprint and added another condition:

After a complete reboot, the error messages no longer appear. But still after a quick restart. Since I know this, I’ll simply delete them afterwards. These are not real errors, just messages. I’ve come to terms with it because the blueprint works well.

Maybe not the best solution, but I can live with it.

I have one of thes 4xbuttons connected, did not try you blueprint yet, because the 4xbutton device is more often then not, not reacting. I’s really random if its working or not. Suddenly it will work 10 times in a row, then the next 8 presses no reaction…
Did any one else have this behaviour? I dont have it connected to a hue hub og Ikea bulp. Its just connected to my normal Sonoff zigbee mqtt2zigbee networ running on a pie.