Zigbee2mqtt - EnOcean PTM 215Z On-Off-Dimming

A input boolean must be created, named dimming occured (with a underscore between dimming and occured, cant insert that here ?)

blueprint:
  name: zigbee2mqtt - EnOcean PTM 215Z On-Off-Dimming
  description: Top buttons on/off and dimming of light. Bottom buttons control on/off and dimming of light
  domain: automation
  input:
    switch:
      name: Switch
      description: on/off/dimming sensor
      selector:
        entity:
          domain: sensor

    light_top:
      name: Light_top
      description: The light to control with top buttons
      selector:
        target:
          entity:
            domain: light

    light_buttom:
      name: Light_buttom
      description: The light to control with bottom buttons
      selector:
        target:
          entity:
            domain: light
mode: restart
max_exceeded: silent
trigger:
  - platform: state
    entity_id: !input "switch"
    attribute: action
condition:
  - condition: template
    value_template: '{{ trigger.to_state.attributes.action in ("press_1","release_1","press_2","release_2","press_3","release_3","press_4","release_4") }}'
action:
  - variables:
      command: "{{ trigger.to_state.state }}"

  - choose:
  
      - conditions:
          - "{{ command == 'press_2' }}"
        sequence:
          - service: light.turn_on
            target: !input "light_buttom"
            data: {}
          - delay: "0.5"
          - repeat:
              count: "7"
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: 15
                    transition: 0
                  target: !input "light_buttom"
                - delay: "0.5"

      - conditions:
          - "{{ command == 'release_4' }}"
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: input_boolean.dimming_occured
                    state: "off"
                sequence:
                  - service: light.turn_off
                    data: {}
                    target: !input "light_buttom"

              - conditions:
                  - condition: state
                    entity_id: input_boolean.dimming_occured
                    state: "on"
                sequence:
                  - service: input_boolean.turn_off
                    target:
                      entity_id: input_boolean.dimming_occured
                    data: {}

      - conditions:
          - "{{ command == 'press_4' }}"
        sequence:
          - delay: "0.5"

          - service: input_boolean.turn_on
            target:
              entity_id: input_boolean.dimming_occured
            data: {}

          - repeat:
              count: "7"
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: -15
                    transition: 0
                  target: !input "light_buttom"
                - delay: "0.5"


      - conditions:
          - "{{ command == 'press_1' }}"
        sequence:
          - service: light.turn_on
            target: !input "light_top"
            data: {}
          - delay: "0.5"
          - repeat:
              count: "7"
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: 15
                    transition: 0
                  target: !input "light_top"
                - delay: "0.5"

      - conditions:
          - "{{ command == 'release_3' }}"
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: input_boolean.dimming_occured
                    state: "off"
                sequence:
                  - service: light.turn_off
                    data: {}
                    target: !input "light_top"

              - conditions:
                  - condition: state
                    entity_id: input_boolean.dimming_occured
                    state: "on"
                sequence:
                  - service: input_boolean.turn_off
                    target:
                      entity_id: input_boolean.dimming_occured
                    data: {}

      - conditions:
          - "{{ command == 'press_3' }}"
        sequence:
          - delay: "0.5"

          - service: input_boolean.turn_on
            target:
              entity_id: input_boolean.dimming_occured
            data: {}

          - repeat:
              count: "7"
              sequence:
                - service: light.turn_on
                  data:
                    brightness_step_pct: -15
                    transition: 0
                  target: !input "light_top"
                - delay: "0.5"

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.