ZHC5010 - Light control blueprint.

The blueprint has a few simple functions:
When pressing a scene button; 1,2,3 or 4 it toggles a light source between 0 and 100 percent (based on on/off state) with a selectable transition time (0 to 10 seconds)

When holding the same scene button, it dims the light source to a selectable dim-level.

Used to control lights from a Logic Group ZHC5010 z-wave device.


blueprint:
  name: ZHC5010 Button Light Control
  description: Control a light with a selected button on the ZHC5010 using Z-Wave JS.
  domain: automation
  input:
    zhc5010_device:
      name: ZHC5010 Device
      description: Select the ZHC5010 device to use.
      selector:
        device:
          integration: zwave_js
          manufacturer: Logic Group
          model: ZHC5010
    target_light:
      name: Target Light
      description: Select the light to control.
      selector:
        entity:
          domain: light
    button:
      name: ZHC5010 Button
      description: Select which button on the ZHC5010 to use.
      selector:
        select:
          options:
            - Button 1
            - Button 2
            - Button 3
            - Button 4
    hold_brightness:
      name: Hold Brightness
      description: Brightness level to set when the button is held.
      default: 50
      selector:
        number:
          min: 1
          max: 100
          unit_of_measurement: "%"
          mode: slider
    transition_time:
      name: Transition Time
      description: Set the transition speed (in seconds) for light changes.
      default: 1.0
      selector:
        number:
          min: 0
          max: 10
          unit_of_measurement: "s"
          mode: slider
          step: 0.1

mode: single
max_exceeded: silent
trigger:
  - platform: event
    event_type: zwave_js_value_notification
    event_data:
      device_id: !input zhc5010_device

variables:
  button_id: '{{ trigger.event.data.property_key_name }}'
  button_action: '{{ trigger.event.data.value }}'
  selected_button: !input button
  hold_brightness: !input hold_brightness
  transition_time: !input transition_time

condition:
  # Ensure the event matches the selected button.
  - condition: template
    value_template: >
      {{ (selected_button == 'Button 1' and button_id == '001') or
         (selected_button == 'Button 2' and button_id == '002') or
         (selected_button == 'Button 3' and button_id == '003') or
         (selected_button == 'Button 4' and button_id == '004') }}

action:
  - choose:
      # Single button press toggles light brightness between 100% and 0%
      - conditions:
          - condition: template
            value_template: "{{ button_action == 'KeyPressed' }}"
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: !input target_light
                    state: "on"
                sequence:
                  - service: light.turn_off
                    data:
                      entity_id: !input target_light
                      transition: "{{ transition_time }}"
              - conditions:
                  - condition: state
                    entity_id: !input target_light
                    state: "off"
                sequence:
                  - service: light.turn_on
                    data:
                      entity_id: !input target_light
                      brightness_pct: 100
                      transition: "{{ transition_time }}"

      # Button hold sets light to a specific brightness
      - conditions:
          - condition: template
            value_template: "{{ button_action == 'KeyHeldDown' }}"
        sequence:
          - service: light.turn_on
            data:
              entity_id: !input target_light
              brightness_pct: !input hold_brightness
              transition: "{{ transition_time }}"

Hello Lurendrejer,
Welcome to the Home Assistant Forums!

Thanks for contributing to the community with a new Blueprint.
I have a suggestion for you. Many people who are not familiar with directory structures will have problems installing this without the Home Assistant MY tools.

Adding a MY link for this Blueprint to your top post would help them a lot.
Here is the link to make that.

Create a link – My Home Assistant