AutomationDataset/klaasnicolaas/klaasnicolaas_automations.yaml

876 lines
24 KiB
YAML

- alias: '[House] - Forgot the lights'
description: Automation for when a light is still ON in my house when I leave
id: fb712601-6f02-4908-9ec1-4213ca66a99b
mode: single
trigger:
- platform: zone
entity_id: person.klaas_schoute
zone: zone.home
event: leave
condition:
condition: or
conditions:
- condition: state
entity_id: light.livingroom
state: 'on'
- condition: state
entity_id: light.kitchen
state: 'on'
- condition: state
entity_id: light.hall
state: 'on'
- condition: state
entity_id: light.bathroom
state: 'on'
action:
- service: notify.mobile_app_klaas_samsung_s24_plus
data:
title: Lampen vergeten!
message: 'Je bent vertrokken, maar de lampen staan nog aan.
'
data:
actions:
- action: turn_light_off
title: Zet lampen UIT
- alias: '[House] - Light turns on in empty house'
description: Notify when a light was turned on but nobody is home
id: 20faccbc-348c-4520-abdb-9d7d9f6827ea
mode: single
trigger:
- platform: state
entity_id:
- light.bathroom
- light.hall
- light.kitchen
- light.livingroom
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: device_tracker.klaas_samsung_s24_plus
state: not_home
action:
- service: notify.mobile_app_klaas_samsung_s24_plus
data:
title: Lamp is aan gegaan!
message: 'Een lamp uit de groep {{ trigger.to_state.attributes.friendly_name
}} is aan gegaan.
'
data:
actions:
- action: turn_light_off
title: Zet lampen UIT
- alias: '[Light] - Turn all light off'
description: Turn all light of when start action from notification
id: ca887d6b-7d28-4150-b821-4002f996a0f5
mode: single
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: turn_light_off
action:
- service: script.turn_on
target:
entity_id: script.all_lights_off
- alias: '[Light] - Turn on light when come home'
description: Automate the lights for when you return home
id: b9d75a5f-1b8b-4f2c-bc87-b3898b2f3a0f
mode: single
trigger:
- platform: state
entity_id: binary_sensor.front_door_contact
to: 'on'
condition:
- condition: state
entity_id: sensor.klaas_status
state: Net Aangekomen
- condition: numeric_state
entity_id: sensor.kitchen_light_sensor_illuminance
below: 5
action:
- service: scene.turn_on
target:
entity_id: scene.evening
- alias: '[Light] - Turn ON bathroom light'
description: Turn the light on when I open a door or if there is occupancy
id: 2498664e-7b8d-4de5-9613-25435b183274
mode: single
trigger:
- platform: state
entity_id: binary_sensor.bathroom_door_contact, binary_sensor.badkamer_presence_occupancy
to: 'on'
from: 'off'
action:
- service: light.turn_on
target:
entity_id: light.bathroom
data_template:
color_temp: 380
brightness_pct: '{% if is_state (''binary_sensor.night'' , ''on'') %} 15 {%
else %} 70 {% endif %}
'
- alias: '[Light] - Turn OFF bathroom light'
description: Turn the light off when there is no motion for 6 minutes
id: 40f79c91-8483-4ef7-b6d5-4025ad306276
mode: single
trigger:
- platform: state
entity_id: binary_sensor.badkamer_presence_occupancy
to: 'off'
condition:
- condition: numeric_state
entity_id: sensor.bathroom_sensor_humidity
below: 75
action:
- service: light.turn_off
target:
entity_id: light.bathroom
- alias: '[Light] - Shower warning - 5 min'
description: Show me a green color warning when showring for 5 min
id: f793694b-3cb0-41a8-99b0-53e89cfe0b17
mode: single
trigger:
- platform: state
entity_id: binary_sensor.shower
to: 'on'
for:
minutes: 5
condition:
- condition: state
entity_id: light.bathroom
state: 'on'
action:
- service: scene.create
data:
scene_id: bathroom_before
snapshot_entities:
- light.bathroom
- service: light.turn_on
target:
entity_id: light.bathroom
data:
transition: 5
rgb_color:
- 109
- 255
- 108
- delay: 00:00:10
- service: scene.turn_on
target:
entity_id: scene.bathroom_before
- alias: '[Light] - Shower warning - 10 min'
description: Show me a red color warning when showring to loooooooong
id: 6ae1e947-7ca9-4d81-9ff0-640759f353f8
mode: single
trigger:
- platform: state
entity_id: binary_sensor.shower
to: 'on'
for:
minutes: 10
condition:
- condition: state
entity_id: light.bathroom
state: 'on'
action:
- service: scene.create
data:
scene_id: bathroom_before
snapshot_entities:
- light.bathroom
- service: light.turn_on
target:
entity_id: light.bathroom
data:
transition: 5
rgb_color:
- 255
- 75
- 75
- delay: 00:00:10
- service: scene.turn_on
target:
entity_id: scene.bathroom_before
- alias: '[House] - Studio climate automated'
description: Make sure the climate is livable in my studio
id: ee8b0ad0-5888-44a9-8291-1305dc646cf7
mode: single
trigger:
- platform: numeric_state
id: low
entity_id:
- sensor.home_sensor_temperature
below: input_number.temp_value_climate_low
for:
minutes: 5
- platform: numeric_state
id: high
entity_id:
- sensor.home_sensor_temperature
above: input_number.temp_value_climate_high
for:
minutes: 5
condition:
- condition: state
entity_id: input_boolean.climate_automated
state: 'on'
- condition: state
entity_id: input_boolean.sleeping
state: 'off'
- condition: state
entity_id: sensor.klaas_status
state: Thuis
action:
- choose:
- alias: Turn the air conditioning ON
conditions:
- '{{ trigger.id == ''high'' }}'
- condition: state
entity_id: binary_sensor.airco
state: 'off'
sequence:
- service: switch.turn_on
target:
entity_id: switch.airco
- alias: Turn the air conditioning OFF
conditions:
- '{{ trigger.id == ''low'' }}'
- condition: state
entity_id: binary_sensor.airco
state: 'on'
sequence:
- service: switch.turn_off
target:
entity_id: switch.airco
- alias: '[People] - Warn in case of emergency'
description: I can single press an emergency button to alert people with an exact
location of me.
id: 50f12371-553c-4702-8b78-a4a671afe080
mode: single
initial_state: true
trigger:
- platform: event
event_type: deconz_event
event_data:
id: switch_17
event: 1002
- platform: event
event_type: telegram_command
event_data:
user_id: secret telegram_user_id_klaas
command: /help
action:
- service: script.turn_on
target:
entity_id: script.call_emergency
- alias: '[People] - It is a false alarm'
description: Double press to alert people that it was false alarm.
id: 5be01cf8-299b-4f4c-b680-cb47905929af
mode: single
initial_state: true
trigger:
- platform: event
event_type: deconz_event
event_data:
id: switch_17
event: 1004
- platform: event
event_type: telegram_command
event_data:
user_id: secret telegram_user_id_klaas
command: /falsealarm
action:
- service: script.turn_on
target:
entity_id: script.false_alarm_emergency
- alias: '[System] - Make weekly Home Assistant backup'
description: Every week a make backups on specific days
id: 436bf2e1-ac2b-448e-855f-55bb96d8afed
mode: single
trigger:
- platform: time
at: 03:00:00
condition:
- condition: time
weekday:
- wed
- sun
action:
- service: hassio.backup_full
data_template:
name: Backup {{ now().strftime('%Y-%m-%d') }} running HA version {{ states('sensor.current_version')
}}
- service: notify.mobile_app_klaas_samsung_s24_plus
data_template:
title: '*Home Assistant Backup!*'
message: 'Backup is gemaakt met de naam: Backup {{ now().strftime(''%Y-%m-%d'')
}} running HA version {{ states(''sensor.current_version'') }}'
- alias: '[Light] - Kitchen automated'
description: Turn the lights on if LUX value is low or on if high
id: b7776a4c-39ec-4c97-8234-98cc2f7c3cf3
mode: single
trigger:
- platform: numeric_state
entity_id:
- sensor.kitchen_light_sensor_illuminance
below: input_number.lux_value_kitchen_low
- platform: numeric_state
entity_id:
- sensor.kitchen_light_sensor_illuminance
above: input_number.lux_value_kitchen_high
condition:
- condition: state
entity_id: input_boolean.lights_automated
state: 'on'
- condition: state
entity_id: sensor.klaas_status
state: Thuis
action:
- choose:
- conditions:
- condition: template
value_template: '{{ ((trigger.to_state.state)|float) <= (states(''input_number.lux_value_kitchen_low'')|float)
}}'
- condition: state
entity_id: light.hall
state: 'off'
- condition: state
entity_id: light.z2m_kitchen
state: 'off'
sequence:
- service: logbook.log
data:
name: Hal & Keuken
message: '- Lampen worden automatisch ingeschakeld'
entity_id: light.z2m_kitchen
- service: light.turn_on
target:
entity_id:
- light.hall
- light.z2m_kitchen
data:
brightness_pct: '{{ states(''input_number.brightness_dimmed'') | round }}'
- conditions:
- condition: template
value_template: '{{ ((trigger.to_state.state)|float) >= (states(''input_number.lux_value_kitchen_high'')|float)
}}'
- condition: state
entity_id: light.hall
state: 'on'
- condition: state
entity_id: light.z2m_kitchen
state: 'on'
sequence:
- service: logbook.log
data:
name: Hal & Keuken
message: '- Lampen worden automatisch uitgeschakeld'
entity_id: light.z2m_kitchen
- service: light.turn_off
target:
entity_id:
- light.hall
- light.z2m_kitchen
- alias: '[Light] - Livingroom automated'
description: Turn the lights on if LUX value is low or on if high
id: 7d8ada0b-770a-4d2f-b662-26c1965e7a09
mode: single
trigger:
- platform: numeric_state
entity_id:
- sensor.livingroom_light_sensor_illuminance
below: input_number.lux_value_living_low
- platform: numeric_state
entity_id:
- sensor.livingroom_light_sensor_illuminance
above: input_number.lux_value_living_high
condition:
- condition: state
entity_id: input_boolean.lights_automated
state: 'on'
- condition: state
entity_id: sensor.klaas_status
state: Thuis
action:
- choose:
- conditions:
- condition: template
value_template: '{{ ((trigger.to_state.state)|float) <= (states(''input_number.lux_value_living_low'')|float)
}}'
- condition: state
entity_id: light.livingroom
state: 'off'
sequence:
- service: light.turn_on
target:
entity_id: light.livingroom
data:
brightness_pct: '{{ states(''input_number.brightness_dimmed'') | round }}'
- conditions:
- condition: template
value_template: '{{ ((trigger.to_state.state)|float) >= (states(''input_number.lux_value_living_high'')|float)
}}'
- condition: state
entity_id: light.livingroom
state: 'on'
sequence:
- service: light.turn_off
target:
entity_id: light.livingroom
- alias: '[House] - Forgot the air conditioning'
description: Automation for when the airco is still ON in my house when I leave
id: f6247cce-8ce4-4498-b759-8eff5e63480a
mode: single
trigger:
- platform: zone
entity_id: person.klaas_schoute
zone: zone.home
event: leave
condition:
- condition: state
entity_id: switch.airco
state: 'on'
action:
- service: notify.mobile_app_klaas_samsung_s24_plus
data:
title: Airco vergeten!
message: 'Je bent vertrokken, maar de Airco staat nog aan.
'
- alias: '[People] - Notify when phone is fully charged'
description: Give me a TTS notification when my phone is full charged and only if
I am home and it is before midnight
id: 1bb2fb11-efdc-41c4-823a-e39f9b4902d6
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.klaas_samsung_s24_plus_battery_level
above: 99
for: 00:03:00
condition:
- condition: state
entity_id: sensor.klaas_status
state: Thuis
- condition: state
entity_id: binary_sensor.night
state: 'off'
action:
- service: notify.livingroom
data:
message: Je telefoon is 100% opgeladen
- alias: '[Presence] - Markeer persoon als net aangekomen'
description: Change state of a person to just arrived.
id: 0e3ca66b-1816-49f5-9f3f-bcb15d7e03c4
mode: single
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.klaas_at_home
from: 'off'
to: 'on'
action:
- service: input_select.select_option
data_template:
entity_id: input_select.klaas_status_dropdown
option: "{% if states.input_select.klaas_status_dropdown.state == 'Net Vertrokken'\
\ %}\n Thuis\n{% else %}\n Net Aangekomen\n{% endif %}\n"
- alias: '[Presence] - Markeer persoon als thuis'
description: Change state of a person to home
id: 43c1a0d2-c066-4f35-b4a3-7504fb9bdfbb
mode: single
initial_state: true
trigger:
- platform: state
entity_id: input_select.klaas_status_dropdown
to: Net Aangekomen
for: 00:15:00
- platform: state
entity_id: input_select.klaas_status_dropdown
from: Net Vertrokken
to: Net Aangekomen
action:
- service: input_select.select_option
data_template:
entity_id: input_select.klaas_status_dropdown
option: Thuis
- alias: '[Presence] - Markeer persoon als net vertrokken'
description: Change state of a person to just leaved
id: 4a5458c2-8eb0-4e38-8967-bf03b5fdcf3c
mode: single
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.klaas_at_home
from: 'on'
to: 'off'
action:
- service: input_select.select_option
data_template:
entity_id: input_select.klaas_status_dropdown
option: Net Vertrokken
- alias: '[Presence] - Markeer persoon als weg'
description: Change state of a person to away
id: fceea58c-1ae9-4c71-9cf4-3466eb28906a
mode: single
initial_state: true
trigger:
- platform: state
entity_id: input_select.klaas_status_dropdown
to: Net Vertrokken
for: 00:10:00
action:
- service: input_select.select_option
data_template:
entity_id: input_select.klaas_status_dropdown
option: Weg
- alias: '[Presence] - Markeer persoon als lang weg'
description: Change state of a person to long away
id: 73c2da46-5c02-41dc-812f-4910e2b27dc5
mode: single
initial_state: true
trigger:
- platform: state
entity_id: input_select.klaas_status_dropdown
to: Weg
for: '24:00:00'
action:
- service: input_select.select_option
data_template:
entity_id: input_select.klaas_status_dropdown
option: Lang Weg
- alias: '[System] - Set HA theme'
description: Change theme based on day or night
id: 6de4f15a-300c-46ae-ad72-a379732c8ed4
mode: single
trigger:
- platform: homeassistant
event: start
- platform: state
entity_id: sun.sun
to: above_horizon
- platform: state
entity_id: sun.sun
to: below_horizon
- platform: state
entity_id:
- input_boolean.maintenance_mode
action:
- service_template: frontend.set_theme
data_template:
name: '{% if is_state (''input_boolean.maintenance_mode'' , ''on'') %} darkorange
{% elif is_state (''sun.sun'' , ''below_horizon'') %} midnight_blue {% else
%} default {% endif %}
'
- alias: '[System] - ON automations counter'
description: Check how many automations are turned ON
id: b3d1a4a4-3f40-4279-95cb-3212d356c7cb
mode: single
trigger:
- platform: homeassistant
event: start
- platform: time_pattern
hours: /1
action:
- service: python_script.on_automations_counter
- alias: '[House] - Notify too warm in house'
description: Notify me if it gets too warm in house
id: b9fee44a-eca0-421a-891a-57fae1b91296
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.home_sensor_temperature
above: 30
action:
- service: notify.telegram_klaas
data_template:
title: '*Warmte alarm!*'
message: Het is nu {{ states('sensor.home_sensor_temperature') }}°C in huis,
doe een raam open!
- alias: '[Voice] - Let''s start cooking'
description: Get more light while cooking via voice assistant.
id: 58e218c9-27c7-45b0-b181-933b52dc3bc7
mode: single
triggers:
- alias: Trigger sentence
trigger: conversation
command:
- (Ik wil|Laten we) gaan koken
conditions: []
actions:
- action: scene.turn_on
data:
transition: 2
target:
entity_id: scene.cooking
- set_conversation_response: Succes, ik zal de lampen wat feller maken
- alias: '[Voice] - Evening lights'
description: Activating the evening lights scene
id: 5cb83534-4136-4c54-a767-43c37fe069f5
mode: single
triggers:
- alias: Trigger sentence
trigger: conversation
command:
- Het is avond
- Mag het licht aan
conditions: []
actions:
- action: scene.turn_on
data:
transition: 2
target:
entity_id: scene.evening
- set_conversation_response: Begrepen, ik zal de lampen als sfeerverlichting aanzetten.
- alias: '[Voice] - Leave the house'
description: When I want the house to be in a status of departure
id: 0b3b6121-27d7-43df-a207-d3056fb17494
mode: single
triggers:
- alias: Trigger sentence
trigger: conversation
command:
- Sluit jij het huis af
- Ik pak mijn (tas|fiets) en ga
conditions: []
actions:
- action: input_boolean.turn_off
target:
entity_id: input_boolean.lights_automated
- action: light.turn_off
data:
transition: 2
target:
entity_id:
- light.livingroom
- light.kitchen
- light.hall
- light.bathroom
- action: cover.close_cover
target:
entity_id: cover.curtain_window
- action: media_player.media_stop
data: {}
target:
entity_id: media_player.ma_home_assistant_voice_pe
- set_conversation_response: Ik zal het huis voor je afsluiten, kom je snel weer
thuis?
- alias: '[Voice] - Start sleeping'
description: For when I want to go to sleep
id: 070636cc-bb71-415e-aa75-35ca17d4080a
mode: single
triggers:
- trigger: conversation
id: with_alarm
command:
- Ik wil (morgen vroeg op|vroeg op morgen)
- trigger: conversation
id: without_alarm
command: Ik ga slapen zonder wekker
conditions: []
actions:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.sleeping
- action: input_boolean.turn_off
target:
entity_id: input_boolean.lights_automated
- action: script.turn_on
target:
entity_id: script.lights_fading_off
- choose:
- conditions:
- condition: trigger
id:
- with_alarm
sequence:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.wakeup_with_alarm
- set_conversation_response: Slaap lekker, vergeet niet een tijd in te stellen
als wekker
- conditions:
- condition: trigger
id:
- without_alarm
sequence:
- set_conversation_response: Slaap lekker, ik zal je morgen niet wakker maken.
- alias: '[Assist] - Wake up'
description: Let Home Assistant know that I wake up
id: afedd031-cefd-4997-830d-2376293ae956
mode: single
triggers:
- alias: Trigger sentence
trigger: conversation
command:
- Goede[ ]morgen [nabu]
conditions: []
actions:
- action: input_boolean.turn_off
target:
entity_id: input_boolean.sleeping
- action: input_boolean.turn_on
target:
entity_id: input_boolean.lights_automated
- set_conversation_response: Goedemorgen, lekker geslapen?
- alias: '[House] - Wake up ritual'
description: Start wakeup automation
id: 6db6c97d-fe7d-4217-a8f1-0dd3c01804b0
mode: single
trigger:
- platform: state
entity_id: binary_sensor.manual_wakeup_alarm
from: 'off'
to: 'on'
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.sleeping
state: 'on'
- condition: state
entity_id: sensor.klaas_status
state: Thuis
- condition: state
entity_id: input_boolean.wakeup_with_alarm
state: 'on'
action:
- action: input_boolean.turn_off
target:
entity_id:
- input_boolean.sleeping
- input_boolean.wakeup_with_alarm
- input_boolean.wakeup_wait
- alias: Open the curtain to 30%
action: cover.set_cover_position
data:
position: 30
target:
entity_id: cover.curtain_window
- alias: Turn on wake up lights to 50%
action: light.turn_on
data:
transition: 2
brightness_pct: 50
target:
entity_id:
- light.hall
- light.kitchen
- delay:
minutes: 10
- sequence:
- action: media_player.volume_set
data:
volume_level: 0.5
target:
entity_id: media_player.ma_home_assistant_voice_pe
- action: music_assistant.play_media
data:
media_id: Happy Harmony
media_type: track
target:
entity_id: media_player.ma_home_assistant_voice_pe
- delay:
seconds: 30
- action: script.turn_on
target:
entity_id: script.home_status_message
- wait_template: '{{ is_state(''input_boolean.wakeup_wait'', ''on'') }}'
continue_on_timeout: true
- action: media_player.volume_set
data:
volume_level: 0.25
target:
entity_id: media_player.ma_google_home
- action: music_assistant.play_media
target:
entity_id: media_player.ma_google_home
data:
media_id: Radio 538
media_type: radio
- action: input_boolean.turn_on
target:
entity_id: input_boolean.lights_automated
- alias: Open the curtain to 100%
action: cover.open_cover
target:
entity_id: cover.curtain_window
- alias: '[Light] - Set wardrobe lights'
description: These automations ensure that the lights above my wardrobe will go
on or off based on the door sensors.
id: 8c0b35c6-0917-4768-aabc-b4235301c115
mode: single
trigger:
- platform: state
entity_id: binary_sensor.wardrobe
action:
- alias: Turn lights OFF if group off else turn light ON
choose:
- alias: Doors are closed
conditions:
- condition: state
entity_id: binary_sensor.wardrobe
state: 'off'
sequence:
- service: scene.turn_on
target:
entity_id: scene.wardrobe_before
data:
transition: 0.5
default:
- service: scene.create
data:
scene_id: wardrobe_before
snapshot_entities:
- light.hall
- service: light.turn_on
target:
entity_id: light.hall
data:
brightness: 170
transition: 0.5
- alias: '[House] - Welcome home message'
description: Let Google Home do a briefing when I get home
id: dde327a1-dfa2-4d38-b835-2e158867169b
mode: single
trigger:
- platform: state
entity_id: binary_sensor.front_door_contact
to: 'on'
condition:
- condition: state
entity_id: sensor.klaas_status
state: Net Aangekomen
action:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.lights_automated
- delay:
seconds: 3
- service: script.turn_on
target:
entity_id: script.home_status_message
- alias: '[House] - Airco off on windows open'
description: Turn off the air conditioner when opening a window
id: caa78028-a1c5-4c75-b2b2-6b5db1e3e63c
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.window_left_contact
- binary_sensor.window_right_contact
from: 'off'
to: 'on'
condition:
condition: state
entity_id: binary_sensor.airco
state: 'on'
action:
- service: switch.turn_off
target:
entity_id: switch.airco