I'm trying to setup a zigbee button to increase brightness of all lights tagged "living room lamps" to 100% and then decrease to 0% and repeat as long as the button is on continuous press.
What am I doing wrong and how can I do this better?
description: Dim lights continuously, then brighten to max on long press
mode: single
triggers:
- device_id: f8f65cd72f0f23f8d845c7fbc2911935
domain: zha
type: remote_button_long_press
subtype: button_4
trigger: device
conditions: []
actions:
- service: light.turn_on
data:
brightness_pct: 0
target:
label_id: living_room_lamps
- loop:
count: 100
sequence:
- delay: 0.1
- service: light.turn_on
data:
brightness_pct: "{{ (loop.index - 1) | float / loop.count * 100 }}"
target:
entity_id:
- light.b1
- light.b2
- light.b3
- light.living_room_overhead
- service: light.turn_on
data:
brightness_pct: 100
target:
label_id: living_room_lamps
- loop:
count: 100
sequence:
- delay: 0.1
- service: light.turn_on
data:
brightness_pct: "{{ (loop.count - loop.index) | float / loop.count * 100 }}"
target:
entity_id:
- light.b1
- light.b2
- light.b3
- light.living_room_overhead