Files
2026-05-15 17:20:09 +02:00

118 lines
3.1 KiB
YAML

blueprint:
name: "IKEA STYRBAR - Contrôle groupe lumières"
description: "Contrôle ON/OFF, luminosité et température de couleur avec une télécommande STYRBAR"
domain: automation
input:
remote:
name: Télécommande STYRBAR
description: "L'entité action de la télécommande"
selector:
entity:
filter:
- integration: mqtt
domain: sensor
light_target:
name: Lumière ou groupe
description: "La lumière ou le groupe à contrôler"
selector:
target:
entity:
domain: light
brightness_step:
name: Pas de luminosité
description: "Pourcentage de changement par pas"
default: 10
selector:
number:
min: 5
max: 25
step: 5
unit_of_measurement: "%"
color_temp_step:
name: Pas de température couleur
description: "Changement de mireds par pas"
default: 25
selector:
number:
min: 10
max: 50
step: 5
trigger:
- platform: state
entity_id: !input remote
to:
- "on"
- "off"
- "brightness_move_up"
- "brightness_move_down"
- "arrow_left_click"
- "arrow_right_click"
action:
- choose:
# ON
- conditions:
- condition: state
entity_id: !input remote
state: "on"
sequence:
- service: light.turn_on
target: !input light_target
# OFF
- conditions:
- condition: state
entity_id: !input remote
state: "off"
sequence:
- service: light.turn_off
target: !input light_target
# BRIGHTNESS UP
- conditions:
- condition: state
entity_id: !input remote
state: "brightness_move_up"
sequence:
- service: light.turn_on
target: !input light_target
data:
brightness_step_pct: !input brightness_step
# BRIGHTNESS DOWN
- conditions:
- condition: state
entity_id: !input remote
state: "brightness_move_down"
sequence:
- service: light.turn_on
target: !input light_target
data:
brightness_step_pct: "{{ -1 * brightness_step }}"
# COLOR TEMP WARMER (left)
- conditions:
- condition: state
entity_id: !input remote
state: "arrow_left_click"
sequence:
- service: light.turn_on
target: !input light_target
data:
color_temp: >
{{ [state_attr(light_entity, 'color_temp') | int + color_temp_step, 500] | min }}
# COLOR TEMP COOLER (right)
- conditions:
- condition: state
entity_id: !input remote
state: "arrow_right_click"
sequence:
- service: light.turn_on
target: !input light_target
data:
color_temp: >
{{ [state_attr(light_entity, 'color_temp') | int - color_temp_step, 153] | max }}
mode: restart