#Light Dimming Condition

1 messages · Page 1 of 1 (latest)

opal wyvern
#

Hi, im trying to edit this blueprint: https://raw.githubusercontent.com/AnderssonPeter/HomeAssistantBlueprints/760487baae0f5e5d933ff896e63a0ead322aefb0/HueTapDailSwitch.yaml

It has a dimmer function:

dim_scale:
      name: Diming Scale
      description:
        Scale factor for the dimming. This value will be multiplied by
        the value given from the dial. So lower number, more gradual dimming. Larger
        number, faster dimming.
      default: 1.0
      selector:
        number:
          min: 0.0
          max: 5.0
          step: 0.01
          mode: slider

- conditions:
          - "{{ action == 'dial_rotate_left_step' }}"
        sequence:
          - choose:
              - conditions: "{{ current_button != none }}"
                sequence:
                  - service: light.turn_on
                    target: "{{ lights[states(current_button)] }}"
                    data:
                      brightness_step_pct: "{{ -dim_scale }}"
                      transition: 0
            default:
              - service: light.turn_on
                target: !input remote_button_1_single_press
                data:
                  brightness_step_pct: "{{ -dim_scale }}"
                  transition: 0

What I'm trying to do is change it so that the brightness doesn't go to zero = off when dimming. So brightness_pct would have to stop at 1%.

Can anyone point me in the right direction?

rocky timber
#

Hello @opal wyvern,
Personally I would find all the instances of

brightness_step_pct: "{{ -dim_scale }}"

(I don't know why that is negative, BTW, seems weird but I didn't study this...)
and make sure if the value is less that one, make it 1. You might have to screw with positive and negative BC the value is minus-ed there, but that's where I would attack this and the logic I would use.

lean parcel
#

I think you're confusing brightness_pct and brightness_step_pct

#

brightness_step_pct: -1 means decrease brightness by 1%

rocky timber
#

Yes oops.

#

Then it gets much more involved...

lean parcel
#
-brightness_step_pct: "{{ -dim_scale }}"
+brightness_pct: "{{ max(current_brightness - dim_scale, 1) }}"
#

maybe something like that