Help with blueprint - Philips RWL021 dimmer

Hi there,

I have created an automation that I am finally pretty happy with for a Philips hue dimmer switch connected via Z2M. I have a bunch of them so a blueprint would be awesome. Have tried my hand at it without luck. The automation behaves much like the original hue switch, also allowing scene change via top button using a scene helper. If anyone could blueprint this would be very happy as would many other others with similar dimmers I am sure.

Code as follows, ideally you would be able to select dimmer, light and scene helper.

alias: Lights - officetest
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: bacc5162df911c9f8c50784660c8ebcf
    type: action
    subtype: on_press
    discovery_id: 0x0017880106719a3f action_on_press
    id: on_press
  - platform: device
    domain: mqtt
    device_id: bacc5162df911c9f8c50784660c8ebcf
    type: action
    subtype: off_press
    discovery_id: 0x0017880106719a3f action_off_press
    id: off_press
  - platform: device
    domain: mqtt
    device_id: bacc5162df911c9f8c50784660c8ebcf
    type: action
    subtype: up_hold
    discovery_id: 0x0017880106719a3f action_up_hold
    id: up_hold
  - platform: device
    domain: mqtt
    device_id: bacc5162df911c9f8c50784660c8ebcf
    type: action
    subtype: down_hold
    discovery_id: 0x0017880106719a3f action_down_hold
    id: down_hold
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: on_press
          - condition: state
            entity_id: light.office_lights
            state: "on"
        sequence:
          - service: input_select.select_next
            data:
              cycle: true
            target:
              entity_id: input_select.scene_office_selector
          - service: scene.turn_on
            target:
              entity_id: "{{ states('input_select.scene_office_selector')}}"
      - conditions:
          - condition: trigger
            id: off_press
        sequence:
          - type: turn_off
            device_id: 295c524cf09e4e24094897526c87c7c3
            entity_id: light.office_lights
            domain: light
      - conditions:
          - condition: trigger
            id: up_hold
        sequence:
          - service: light.turn_on
            data:
              transition: 1
              brightness_step_pct: 10
            target:
              entity_id: light.office_lights
      - conditions:
          - condition: trigger
            id: down_hold
        sequence:
          - service: light.turn_on
            data:
              transition: 1
              brightness_step_pct: -10
            target:
              entity_id: light.office_lights
      - conditions:
          - condition: trigger
            id: on_press
        sequence:
          - service: light.turn_on
            data:
              color_temp: 400
              brightness_pct: 80
            target:
              entity_id: light.office_lights
mode: single

Hi @xprezz

Did you ever got a blueprint based on this logic?