While turning on the fireplace I thought it would be nice to have some background lights switching colors to “align” with the fireplace mood and colors.
I used this little script to activate. it will switch color every second (configured in input_number.led_color_timeout_transition
) until the light is turned off.
The RGB colors are limited in range R:160-255,G:0-85,B:0
to keep the red/orange/yellow mood . Looks fine so far
Feel free to comment or share your opinion.
alias: Led color fireplace random
mode: single
icon: mdi:fireplace
sequence:
- service: light.turn_on
target:
entity_id:
- light.lamp_led_rgb_e27
data:
brightness_pct: 100
- repeat:
until:
- condition: state
state: "off"
entity_id: light.lamp_led_rgb_e27
sequence:
- service: light.turn_on
data_template:
rgb_color:
- "{{ (range(160, 255)|random) }}"
- "{{ (range(0, 85)|random) }}"
- 0
transition: 3
brightness_pct: 100
target:
entity_id:
- light.lamp_led_rgb_e27
- delay: "{{states.input_number.led_color_timeout_transition.state|float}}"