Files
homeassistant-config/scripts.yaml

172 lines
4.7 KiB
YAML

wled_random_effect:
alias: 'WLED: Zufälliger Effekt'
sequence:
- service: light.turn_on
target:
entity_id: light.wohnzimmer_hinten, light.wohnzimmer_vorne, light.kuche
data:
effect: '{{ state_attr(''light.wohnzimmer_hinten'', ''effect_list'') | random
}}'
mode: single
icon: mdi:firework
wled_random_palette:
alias: 'WLED: Zufällige Palette'
sequence:
- service: select.select_option
target:
entity_id: select.wohnzimmer_hinten_color_palette, select.wohnzimmer_vorne_color_palette,
select.kuche_color_palette
data:
option: '{{ state_attr(''select.wohnzimmer_hinten_color_palette'', ''options'')
| random }}'
mode: single
icon: mdi:palette
moodlight_neutral:
alias: Moodlight neutral
sequence:
- service: light.turn_on
data:
brightness_pct: 20
kelvin: 2900
transition: 2
effect: Solid
target:
device_id:
- 6dcbd87b459412144bddc42af3ae8b83
- 4edd9b9df7d1f6f2fe7dcc2e5c0eb968
- c64e7c3dcda7f1c23e456959f2c60f39
- condition: state
state: 'on'
entity_id: media_player.lg_webos_smart_tv
- service: light.turn_off
target:
device_id: 6dcbd87b459412144bddc42af3ae8b83
data:
transition: 2
mode: single
icon: mdi:lightbulb-on
moodlight_orange_plasma:
alias: Moodlight Orange Plasma
sequence:
- service: light.turn_on
data:
brightness_pct: 20
transition: 2
effect: Lake
target:
device_id:
- 6dcbd87b459412144bddc42af3ae8b83
- 4edd9b9df7d1f6f2fe7dcc2e5c0eb968
- c64e7c3dcda7f1c23e456959f2c60f39
- service: select.select_option
target:
entity_id: select.wohnzimmer_hinten_color_palette, select.wohnzimmer_vorne_color_palette,
select.kuche_color_palette
data:
option: Orangery
- condition: state
state: 'on'
entity_id: media_player.lg_webos_smart_tv
- service: light.turn_off
target:
device_id: 6dcbd87b459412144bddc42af3ae8b83
data:
transition: 2
mode: single
icon: mdi:lightbulb-on
moodlight_xmas:
alias: Moodlight XMas
sequence:
- data:
brightness_pct: 20
transition: 2
effect: Glitter
target:
device_id:
- 6dcbd87b459412144bddc42af3ae8b83
- 4edd9b9df7d1f6f2fe7dcc2e5c0eb968
- c64e7c3dcda7f1c23e456959f2c60f39
action: light.turn_on
- target:
entity_id: select.wohnzimmer_hinten_color_palette, select.wohnzimmer_vorne_color_palette,
select.kuche_color_palette
data:
option: Orangery
action: select.select_option
- condition: state
state: 'on'
entity_id: media_player.lg_webos_smart_tv
- target:
device_id: 6dcbd87b459412144bddc42af3ae8b83
data:
transition: 2
action: light.turn_off
mode: single
icon: mdi:lightbulb-on
wled_wohnzimmer_nachster_effekt:
alias: 'WLED: Wohnzimmer nächster Effekt'
sequence:
- service: light.turn_on
target:
entity_id: light.wohnzimmer_hinten, light.wohnzimmer_vorne
data:
effect: '{{ state_attr(''light.wohnzimmer_hinten'', ''effect_list'') | random
}}'
mode: single
icon: mdi:firework
light_color_temp_helper:
sequence:
- action: light.turn_on
target:
entity_id: '{{ target_light }}'
data:
color_temp_kelvin: "{% if state_attr(target_light, 'color_temp_kelvin') is none
%} \n {{ max_color_temp }} \n{% else %} \n {% if mode == \"cycle\" and
state_attr(target_light, 'color_temp_kelvin')\n == max_color_temp %}\n {{min_color_temp}}\n
\ {% else %} \n {% set new_value = state_attr(target_light, 'color_temp_kelvin')+iif(mode
== \"down\", -1, +1) * color_temp_step %}\n {{ [([new_value, max_color_temp]
| min), min_color_temp] | max}} \n {% endif %} \n{% endif %} "
alias: light_color_temp_helper
fields:
target_light:
name: Light
description: Light entity
selector:
entity:
filter:
domain: light
required: true
min_color_temp:
name: Minimal color temperature
default: 2200
selector:
number:
mode: box
required: true
max_color_temp:
name: Maximal color temperature
default: 4000
selector:
number:
mode: box
required: true
color_temp_step:
name: Change of color temperature per step
default: 300
selector:
number:
mode: box
required: true
mode:
selector:
select:
options:
- up
- down
- cycle
required: true
default: cycle
name: Mode
description: Select switch mode
description: Switch color temperature of light in steps