Files
Home-Assistant/scripts.yaml
T
2026-07-21 11:19:17 -04:00

243 lines
7.5 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
play_80_s_office_room_spotify:
alias: Play 80's Office Room Spotify
sequence:
- action: media_player.play_media
target:
device_id: 40424cc65a2eaf52e939d2fc97d61989
data:
media:
media_content_id: play All Out 80s on Spotify on Shuffle
media_content_type: custom
metadata: {}
mode: single
description: ''
toggle_nest_fan:
alias: Toggle Nest Fan
sequence:
- choose:
- conditions:
- condition: state
entity_id: sensor.nest_fan_mode_status
state: 'on'
sequence:
- action: climate.set_fan_mode
target:
entity_id: climate.living_room_living_room
data:
fan_mode: 'off'
default:
- action: nest.set_fan_timer
target:
entity_id: climate.living_room_living_room
data:
duration: 01:00:00
description: Toggles the Nest fan on for 1 hour or turns it off if already on.
weather_and_comfort_report:
alias: Weather and comfort report
sequence:
- action: ai_task.generate_data
data:
task_name: weather comfort report
instructions: 'Based on the current conditions:
- Outdoor temperature: {{ states(''sensor.outdoor_weather_hilo'') }}°C
- Weather condition: {{ states(''weather.forecast_home'') }}
- Living Room: {{ states(''sensor.living_room_living_room_temperature'') }}°C
and Humidity: {{ states(''sensor.living_room_living_room_humidity'') }}%
- Bedroom: {{ states(''sensor.bedroom_nest_temperature_sensor_bedroom_temperature'')
}}°C
- Basement: {{ states(''sensor.basement_nest_temperature_sensor_basement_temperature'')
}}°C
- Leo''s Room: {{ states(''sensor.leo_room_nest_temperature_sensor_leo_room_temperature'')
}}°C
- Seraphine''s Room: {{ states(''sensor.seraphine_room_nest_temperature_sensor_seraphine_room_temperature'')
}}°C
Generate a funny weather description and provide a funny assessment of the indoor
comfort level across the different zones of the house. Make sure it is funny.
Also, Seraphine is my daughter and Leo is my son. The Basement is my office.
'
structure:
weather_description:
description: A humorous description of the current weather outside
required: true
selector:
text: {}
indoor_comfort:
description: Overall assessment of how comfortable it is inside compared
to outside
required: true
selector:
text: {}
zone_breakdown:
description: A detailed summary detailing if any specific rooms (like the
bedroom or basement) are too hot, cold, or perfect
required: true
selector:
text: {}
response_variable: comfort_report
- action: notify.persistent_notification
data:
title: "\U0001F3E0 Home climate report"
message: "\U0001F324 **Weather outside:**\n{{ comfort_report.data.weather_description
}}\n\n\U0001F6CB **Indoor comfort:**\n{{ comfort_report.data.indoor_comfort
}}\n\n\U0001F4CA **Zone Breakdown:**\n{{ comfort_report.data.zone_breakdown
}}\n"
- action: notify.notify
data:
title: "\U0001F3E0 Home climate report"
message: "\U0001F324 **Weather outside:**\n{{ comfort_report.data.weather_description
}}\n\n\U0001F6CB **Indoor comfort:**\n{{ comfort_report.data.indoor_comfort
}}\n\n\U0001F4CA **Zone Breakdown:**\n{{ comfort_report.data.zone_breakdown
}}"
dynamic_alexa_spotify_player:
alias: Dynamic Alexa Spotify Player
sequence:
- action: media_player.play_media
target:
entity_id: '{{ states(''input_select.alexa_target_device'') }}'
data:
media:
media_content_id: play {{ states('input_select.alexa_playlist') }}
media_content_type: custom
metadata: {}
mode: single
description: Dynamically plays the selected helper playlist on the selected Echo
speaker.
stop_alexa_music:
alias: Stop Alexa Music
sequence:
- action: media_player.media_stop
target:
entity_id: '{{ states(''input_select.alexa_target_device'') }}'
mode: single
description: Stops playback on the selected Echo speaker.
light_color_hs_helper:
sequence:
- action: light.turn_on
target:
entity_id: '{{ target_light }}'
data:
transition: '{{ light_transition_duration }}'
hs_color: "{% set new_value = (state_attr(target_light, 'hs_color')[0] + iif(mode
== \"down\", -1, +1) * color_hue_step) %} {{ [iif(new_value > 360, \n new_value
- 360,\n iif(new_value < 0, \n new_value + 360, \n new_value),
\n new_value), \n color_saturation - 1 ] }} "
alias: light_color_hs_helper
fields:
target_light:
name: Light
description: Light entity
selector:
entity:
filter:
domain: light
required: true
color_hue_step:
name: Change of color hue per step
default: 5
selector:
number:
mode: box
required: true
color_saturation:
name: Color saturation
default: 100
selector:
number:
mode: box
required: true
light_transition_duration:
name: Transition duration
description: Controls the duration of transitions
default: 0.5
selector:
number:
mode: box
required: true
mode:
selector:
select:
options:
- up
- down
required: true
default: up
name: Mode
description: Select switch mode
description: 'Switch color hue/saturation of light in steps
Version: 2026-03-22'
light_color_temp_helper:
sequence:
- action: light.turn_on
target:
entity_id: '{{ target_light }}'
data:
transition: '{{ light_transition_duration }}'
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
light_transition_duration:
name: Transition duration
description: Controls the duration of transitions
default: 0.5
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 \nVersion: 2026-03-22"