AutomationDataset/golles/golles_automations.yaml

2874 lines
84 KiB
YAML

- id: kerst_sfeer_achtertuin
alias: Achtertuin - Kerst sfeer
mode: single
max_exceeded: silent
triggers:
- trigger: time
at: '15:30:00'
conditions:
- alias: All days in December after Sinterklaas.
condition: template
value_template: '{{ now().month == 12 and now().day >= 6 }}
'
actions:
- alias: Turn on the light
action: light.turn_on
entity_id: light.gekleurde_licht_plug
- alias: Auto turn off the light after midnight
action: number.set_value
target:
entity_id: number.gekleurde_licht_plug_countdown
data:
value: "{{\n (today_at(\"00:00\") + timedelta(days=1, minutes=range(0, 1) |\
\ random)).timestamp() | int - now().timestamp() | int\n}}"
- id: automatic_backgarden_lights
alias: Achtertuin - verlichting aan bij deur open of beweging
mode: restart
triggers:
- trigger: state
entity_id: binary_sensor.achterdeur_contact
from: 'off'
to: 'on'
- trigger: state
entity_id: binary_sensor.achtertuin_beweging
from: 'off'
to: 'on'
conditions:
- condition: numeric_state
entity_id: sensor.achtertuin_sensor_1_licht
below: 10
actions:
- alias: Lights on
action: scene.turn_on
data:
transition: 2
target:
entity_id: scene.achtertuin_helder
- alias: Wait a little
delay:
minutes: 10
- alias: Lights off
action: light.turn_off
data:
entity_id: light.achtertuin_groep
transition: 2
- id: adguardhome_protection_switches
alias: 'AdGuard Home: Bescherming schakelaars'
mode: single
triggers:
- trigger: state
entity_id: switch.adguard_home_primary_bescherming
to:
- 'on'
- 'off'
actions:
- if:
- condition: state
entity_id: switch.adguard_home_primary_bescherming
state: 'on'
then:
- alias: Turn the 2nd instance on
action: switch.turn_on
target:
entity_id: switch.adguard_home_secondary_bescherming
else:
- alias: Turn the 2nd instance off
action: switch.turn_off
target:
entity_id: switch.adguard_home_secondary_bescherming
- id: notification_afval
alias: 'Notificatie: Afval wordt morgen opgehaald'
mode: single
variables:
entity: "{{\n states.sensor\n | selectattr(\"attributes.Wastecollector\",\
\ \"defined\")\n | selectattr(\"attributes.Days_until\", \"eq\", 1)\n \
\ | map(attribute=\"entity_id\")\n | first\n | default(\"none\")\n}}"
triggers:
trigger: time
at: '19:30:00'
conditions:
- condition: template
value_template: '{{ entity = "none" }}'
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
actions:
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_afval
data:
embed:
title: 🗑️ Afval
description: 'Morgen wordt de **{{ state_attr(entity, "friendly_name") |
upper }}** container geleegd.
'
thumbnail:
url: '{{ state_attr(entity, "entity_picture") | replace("/local/", "https://raw.githubusercontent.com/golles/Home-Assistant-Config/refs/heads/main/www/")
}}'
- id: ios_action_everything_off
alias: iOS action - Alles uit
mode: single
max_exceeded: silent
triggers:
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Alles uit
actions:
- alias: Now turn everything off
action: script.everything_off
- id: check_devices_left_on
alias: iOS action - Apparaten aangelaten
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: group.residents
to: not_home
for:
minutes: 5
conditions:
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.count_inside_lights_on
above: 0
- condition: numeric_state
entity_id: sensor.count_speakers_on
above: 0
- condition: numeric_state
entity_id: sensor.count_tvs_on
above: 0
actions:
- alias: Set up variables for the actions
variables:
action_all_off: '{{ ''ALL_OFF_'' ~ context.id }}'
- alias: Message everyone
action: notify.all_phones
data:
title: Niemand meer thuis
message: 'Dit staat nog aan: {% if states("sensor.count_inside_lights_on") not
in ["unknown", "0"] %}{{ states("sensor.count_inside_lights_on") }}💡 {% endif
%} {% if states("sensor.count_tvs_on") not in ["unknown", "0"] %}{{ states("sensor.count_tvs_on")
}}📺 {% endif %} {% if states("sensor.count_speakers_on") not in ["unknown",
"0"] %}{{ states("sensor.count_speakers_on") }}🔊 {% endif %}'
data:
tag: devices_left_on
url: /lovelace/welkom
actions:
- action: '{{ action_all_off }}'
title: Zet alles uit
- alias: Wait for a response
wait_for_trigger:
- trigger: event
event_type: mobile_app_notification_action
event_data:
action: '{{ action_all_off }}'
- alias: Perform the action
choose:
- conditions: '{{ wait.trigger.event.data.action == action_all_off }}'
sequence:
- action: script.everything_off
- alias: Clear this notification on all devices
action: notify.all_phones
data:
message: clear_notification
data:
tag: devices_left_on
- id: air_purifier_off_door_open
alias: Air purifier uit als de achterdeur of keukenraam open staat
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.achterdeur_contact
to: 'on'
for:
minutes: 5
- trigger: state
entity_id: binary_sensor.keukenraam_contact
to: 'on'
for:
minutes: 5
conditions:
- condition: state
entity_id: fan.air_purifier
state: 'on'
actions:
- action: fan.turn_off
entity_id: fan.air_purifier
- id: air_purifier_on_based_on_aqi
alias: Air purifier aan gebasseerd op aqi
mode: single
triggers:
- trigger: numeric_state
entity_id: sensor.air_purifier_pm2_5
above: 10
for:
minutes: 2
conditions:
- condition: state
entity_id: fan.air_purifier
state: 'off'
- condition: state
entity_id: binary_sensor.achterdeur_contact
state: 'off'
- condition: state
entity_id: binary_sensor.keukenraam_contact
state: 'off'
actions:
- action: fan.turn_on
entity_id: fan.air_purifier
- id: air_purifier_off_based_on_aqi
alias: Air purifier uit gebasseerd op aqi
mode: single
triggers:
- trigger: numeric_state
entity_id: sensor.air_purifier_pm2_5
below: 5
for:
minutes: 2
conditions:
- condition: state
entity_id: fan.air_purifier
state: 'on'
actions:
- action: fan.turn_off
entity_id: fan.air_purifier
- id: notification_aurora
alias: 'Notificatie: Noorderlicht'
triggers:
- trigger: state
entity_id: binary_sensor.aurora_visibility_visibility_alert
from: 'off'
to: 'on'
actions:
- if:
- condition: state
entity_id: media_player.lg_c9
state: 'on'
then:
- alias: Sent a notification to the tv
action: notify.lg_c9
data:
message: '{{ states("sensor.aurora_visibility_visibility") }}% kans op het
noorderlicht'
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_weer
data:
embed:
author:
name: National Oceanic and Atmospheric Administration
icon_url: https://brands.home-assistant.io/aurora/icon.png
color: 11877887
title: 🌌✨💫 Noorderlicht
description: '{{ states("sensor.aurora_visibility_visibility") }}% kans
op het noorderlicht
https://www.swpc.noaa.gov/products/aurora-30-minute-forecast
'
- id: logeerkamer_klimaat
alias: Logeerkamer klimaat aan/uit door raam
use_blueprint:
path: golles/door-window-climate-control.yaml
input:
door_entity: binary_sensor.logeerkamerraam_contact
climate_entity: climate.logeerkamer
turn_off_delay: 300
- id: logeerkamer_electric_heater
alias: Logeerkamer - Elektrische verwarming
mode: single
triggers:
- alias: Immediately trigger when laptops are being used
trigger: state
entity_id:
- binary_sensor.macbook_in_thuis_kantoor_en_aan
to: 'on'
- alias: Trigger when logeerkamer is occupied
trigger: state
entity_id: binary_sensor.logeerkamer_bezetting
to: 'on'
for:
minutes: 5
- alias: Trigger when logeerkamer is not occupied
trigger: state
entity_id: binary_sensor.logeerkamer_bezetting
to: 'off'
actions:
- if:
- condition: state
entity_id: binary_sensor.logeerkamer_bezetting
state: 'on'
then:
- alias: Turn electric heater on
action: climate.turn_on
target:
entity_id: climate.elektrische_kachel
else:
- alias: Turn electric heater off
action: climate.turn_off
target:
entity_id: climate.elektrische_kachel
- id: close_logeerkamer_cover
alias: Logeerkamer rolgordijn sluiten op tijd
mode: single
max_exceeded: silent
triggers:
- trigger: time
at: input_datetime.covers_down
actions:
- action: script.close_cover_window_state
data:
wait_minutes: 240
cover_entity: cover.logeerkamer
window_entity: binary_sensor.logeerkamerraam_contact
- id: close_slaapkamer_cover
alias: Slaapkamer rolluik sluiten op tijd
mode: single
max_exceeded: silent
triggers:
- trigger: time
at: input_datetime.covers_down
actions:
- action: script.close_cover_window_state
data:
wait_minutes: 240
cover_entity: cover.slaapkamer
window_entity: binary_sensor.slaapkamerraam_contact
- id: slaapkamer_light_auto
alias: Slaapkamerlamp automatisch aan/uit door aanwezigheid
use_blueprint:
path: golles/motion-activated_scenes.yaml
input:
day_end_time: 00:00:00
motion_entity: binary_sensor.slaapkamer_beweging_occupancy
cool_down: 60
light_entity: light.slaapkamer_plafond_groep
illuminance_entity: sensor.slaapkamer_lichtsterkte_illuminance
illuminance_below: 10
day_start_time: 08:00:00
day_scene: scene.slaapkamer_plafond_groep_helder
day_scene_before_off: scene.slaapkamer_plafond_groep_gedimd
night_scene: scene.slaapkamer_plafond_groep_ontspannen
night_scene_before_off: scene.slaapkamer_plafond_groep_nachtlampje
no_motion_wait: 15
- id: disable_slaapkamer_light_auto
alias: Slaapkamerlamp niet automatisch tijdens slaap
mode: single
max_exceeded: silent
triggers:
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Naar bed
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Gaan slapen
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Uit bed
id: aan
- trigger: state
entity_id: cover.slaapkamer
attribute: current_position
to: 100
id: aan
actions:
- choose:
- conditions:
- condition: trigger
id: aan
sequence:
- action: automation.turn_on
entity_id: automation.slaapkamerlamp_automatisch_aan_uit_door_aanwezigheid
default:
- action: automation.turn_off
entity_id: automation.slaapkamerlamp_automatisch_aan_uit_door_aanwezigheid
- id: mechanische_ventilatie_toilet
alias: Mechanische ventilatie toilet
mode: restart
triggers:
- trigger: state
entity_id: binary_sensor.toilet_beweging_occupancy
from: 'off'
to: 'on'
conditions:
- condition: numeric_state
entity_id: fan.mechanische_ventilatie_ventilatie
attribute: percentage
below: 26
actions:
- alias: Set fan to medium for 15 minutes
action: script.mechanical_ventilation_speed_timer
data:
speed: 2
timer: 15
- id: auto_light_woonkamer
alias: Woonkamer automatisch aan/uit door aanwezigheid
use_blueprint:
path: golles/motion-activated_scenes.yaml
input:
day_end_time: 00:00:00
motion_entity: binary_sensor.woonkamer_bezetting
cool_down: 60
light_entity: light.wooneet
illuminance_entity: sensor.epl_eettafel_illuminance
illuminance_below: 2.2
illuminance_above: 25
day_start_time: 08:00:00
day_scene: scene.wooneet_avond
day_scene_before_off: scene.wooneet_nacht
night_scene: scene.wooneet_nacht
night_scene_before_off: scene.wooneet_nacht
no_motion_wait: 15
- id: auto_light_woonkamer_when_someone_arrives_home
alias: Automatisch licht aan in de woonkamer wanneer iemand thuis komt
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: group.residents
from: not_home
to: home
conditions:
- condition: numeric_state
entity_id: sensor.epl_eettafel_illuminance
below: 2.2
actions:
- alias: Turn on the evening scene
action: scene.turn_on
target:
entity_id: scene.wooneet_avond
data:
transition: 1
- id: skull_light_woonkamer
alias: Skull aan doen als de avond scene actief wordt
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: light.wooneet
to: 'off'
- trigger: state
id: aan
entity_id: scene.wooneet_avond
actions:
- choose:
- conditions:
- condition: trigger
id: aan
sequence:
- alias: Turn on the skull
action: light.turn_on
target:
entity_id: light.skull
data:
effect: breathe
brightness: 128
xy_color:
- 0.701
- 0.299
default:
- alias: Turn off the skull
action: light.turn_off
target:
entity_id: light.skull
- id: tv_lights_based_on_source
alias: TV verlichting aanpassen op basis van de bron
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: media_player.lg_c9
attribute: source
from:
- Jellyfin
- Netflix
- trigger: state
entity_id: media_player.lg_c9
attribute: source
to:
- Jellyfin
- Netflix
- trigger: numeric_state
id: illuminance
entity_id: sensor.epl_eettafel_illuminance
below: 4
conditions:
- condition: numeric_state
entity_id: sensor.epl_eettafel_illuminance
below: 4
- condition: state
entity_id: light.woonkamer
state: 'on'
- condition: template
value_template: "{{\n trigger.id != \"illuminance\" or\n trigger.id == \"illuminance\"\
\ and state_attr(\"media_player.lg_c9\", \"source\") in [\"Jellyfin\", \"Netflix\"\
]\n}}"
actions:
- if:
- condition: state
entity_id: media_player.lg_c9
attribute: source
state:
- Jellyfin
- Netflix
then:
- alias: Turn on movie scenes
action: scene.turn_on
data:
entity_id: scene.wooneet_film
else:
- if:
- condition: time
after: 08:00:00
before: 00:00:00
then:
- alias: Turn on evening scene
action: scene.turn_on
data:
entity_id: scene.wooneet_avond
else:
- alias: Turn on night scene
action: scene.turn_on
data:
entity_id: scene.wooneet_nacht
- id: disable_automatic_lights_movie_scene
alias: Woonkamer automatisch aan/uit door film scene
mode: single
max_exceeded: silent
triggers:
- trigger: state
id: disable
entity_id: scene.wooneet_film
- trigger: state
entity_id:
- scene.wooneet_avond
- scene.wooneet_eten
- scene.wooneet_nacht
- trigger: state
entity_id: light.tv
to: 'off'
actions:
- if:
- condition: trigger
id: disable
then:
- alias: Disable automatic lights
action: automation.turn_off
entity_id: automation.woonkamer_automatisch_aan_uit_door_aanwezigheid
else:
- alias: Enable automatic lights
action: automation.turn_on
entity_id: automation.woonkamer_automatisch_aan_uit_door_aanwezigheid
- id: zolder_light_auto
alias: Zolderlamp automatisch aan/uit door aanwezigheid
use_blueprint:
path: golles/motion-activated_scenes.yaml
input:
day_end_time: 00:00:00
motion_entity: binary_sensor.zolder_bezetting
cool_down: 60
light_entity: light.zolder
illuminance_entity: sensor.epl_zolder_illuminance
illuminance_below: 0.7
day_start_time: 08:00:00
day_scene: scene.zolder_helder
day_scene_before_off: scene.zolder_gedimd
night_scene: scene.zolder_ontspannen
night_scene_before_off: scene.zolder_nachtlampje
no_motion_wait: 15
- id: zolder_auto_off
alias: Zolder verlichting uit bij geen beweging
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.zolder_bezetting
to: 'off'
for:
minutes: 10
- trigger: state
entity_id: light.zolder
to: 'on'
for:
minutes: 5
conditions:
- condition: state
entity_id: binary_sensor.zolder_bezetting
state: 'off'
for:
minutes: 10
- condition: state
entity_id: light.zolder
state: 'on'
actions:
- action: light.turn_off
entity_id: light.zolder
- id: notification_low_battery
alias: 'Notificatie: Batterij laag'
description: Meldingen voor lage batterij, alleen voor apparaten die belangrijk
zijn
mode: single
triggers:
- alias: Mobile devices getting low
trigger: numeric_state
entity_id:
- sensor.iphone_van_golles_battery_level
- sensor.iphone_van_golles_watch_battery_level
- sensor.ipad_mini_van_golles_battery_level
below: 30
- alias: Important devices getting low
trigger: numeric_state
entity_id:
- sensor.logeerkamer_battery
- sensor.keuken_battery
- sensor.tandenborstel_battery
below: 30
for:
minutes: 30
- alias: Tado devices getting low
trigger: state
entity_id:
- binary_sensor.va1788876800_batterij
- binary_sensor.va1805654016_batterij
- binary_sensor.va1923094528_batterij
- binary_sensor.va2677479424_batterij
- binary_sensor.va2979272704_batterij
- binary_sensor.va3030325248_batterij
- binary_sensor.va3382122496_batterij
- binary_sensor.va4103542784_batterij
from: 'off'
to: 'on'
actions:
- variables:
device_id: '{{ device_id(trigger.entity_id) }}'
device_model: '{{ iif("watch_battery" in trigger.entity_id, "Apple Watch", device_attr(device_id,
"model")) }}'
area: '{{ area_name(trigger.entity_id) }}'
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_batterijen
data:
embed:
color: 16753920
title: 🔋 Batterij leeg
description: '{{ device_model ~ " batterij" ~ iif(area = None, " in de "
~ area, "") ~ " is leeg" }}
'
- id: ios_action_going_to_bed
alias: iOS action - Naar bed
mode: single
max_exceeded: silent
triggers:
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Naar bed
actions:
- alias: Turn most of the devices off
action: script.everything_off
data:
exclude_entity_ids:
- light.woonkamer_groot_1
- light.woonkamer_groot_2
- light.overloop_spot_1
- light.overloop_spot_2
- light.overloop_spot_3
- light.gekleurde_licht_plug
- fan.ventilator
- alias: Now turn some lights off with a transition
action: light.turn_off
data:
entity_id: light.woonkamer
transition: 30
- choose:
- conditions:
- alias: If any of the covers is still open
condition: template
value_template: "{{\n is_state(\"cover.slaapkamer\", \"open\") or\n is_state(\"\
cover.kledingkamer\", \"open\") or\n is_state(\"cover.logeerkamer\", \"\
open\")\n}}"
sequence:
- alias: Set the covers down time to be in a few seconds, so they all close
action: input_datetime.set_datetime
data:
entity_id: input_datetime.covers_down
time: '{{ (now() | as_timestamp + 5) | timestamp_custom("%H:%M:%S") }}'
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.slaapkamerraam_contact
state: 'on'
sequence:
- alias: Wait if the window is closed within a given time
wait_template: '{{ is_state("binary_sensor.slaapkamerraam_contact", "off")
}}'
timeout:
minutes: 60
continue_on_timeout: false
- alias: Turn on the bed lights
action: scene.turn_on
data:
transition: 2
target:
entity_id: scene.slaapkamer_naar_bed
- id: ios_action_going_to_sleep
alias: iOS action - Gaan slapen
mode: single
max_exceeded: silent
triggers:
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Gaan slapen
actions:
- alias: Now turn everything off
action: script.everything_off
- id: ios_action_going_out_of_bed
alias: iOS action - Uit bed
mode: single
max_exceeded: silent
triggers:
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Uit bed
actions:
- alias: Open south facing covers based on temperature
action: script.open_south_facing_covers_based_on_weather
- alias: Set curtains to preference position
action: button.press
target:
entity_id:
- button.logeerkamer_rolgordijn_voorkeurspositie
- button.keuken_rolgordijn_voorkeurspositie
- id: tado_auto_home_and_away_mode
alias: Tado - Automatisch home en away mode activeren
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: group.residents
actions:
- choose:
- conditions:
- condition: state
entity_id: group.residents
state: not_home
sequence:
- alias: Set climate preset mode to home
action: climate.set_preset_mode
data:
preset_mode: away
target:
entity_id: climate.woonkamer
- alias: Turn electric heater off
action: climate.turn_off
target:
entity_id: climate.elektrische_kachel
default:
- alias: Set climate preset mode to home
action: climate.set_preset_mode
data:
preset_mode: home
target:
entity_id: climate.woonkamer
- id: tado_preheat_going_home_cold_day
alias: Tado - Huis opwarmen op een koude dag naar huis gaan
mode: single
max_exceeded: silent
triggers:
- trigger: numeric_state
entity_id: sensor.huis_nearest_distance
below: 10
conditions:
- condition: state
entity_id: group.residents
state: not_home
- condition: state
entity_id: sensor.huis_nearest_direction_of_travel
state: towards
- condition: numeric_state
entity_id: climate.woonkamer
attribute: current_temperature
below: 18
actions:
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_algemeen
data:
embed:
title: Verwarming
description: 'Ik zie dat {{ states("sensor.huis_nearest_device") }} bijna
thuis is
Het is hier nu nog koud, dus ik verwarm de woonkamer alvast
'
- alias: Heat up the living room for a short time
action: tado.set_climate_timer
data:
time_period: 00:15:00
temperature: 25
target:
entity_id: climate.woonkamer
- id: covers_down_set_daily_time
alias: Rolluiken - Tijd voor sluiten dagelijks aanpassen
mode: single
triggers:
- trigger: homeassistant
event: start
- trigger: time
at: '12:00:00'
actions:
- action: input_datetime.set_datetime
data:
entity_id: input_datetime.covers_down
time: '{% set currentDay = now().strftime("%j") | int %} {% set middleDay =
183 %} {% set longestDayOffsetMinutes = 45 %} {% set magicFactor = 2.5 %}
{% set ofsetMinutes = (-((currentDay-middleDay) | abs) / magicFactor--longestDayOffsetMinutes)
| round(0) %}
{{ as_local((state_attr("sun.sun", "next_setting")) | as_datetime + timedelta(minutes
= ofsetMinutes)).strftime("%H:%M:%S") }}
'
- id: covers_overkiz_reload_integration
alias: Rolluiken - Overkiz integratie herladen bij probleem
mode: single
triggers:
- trigger: state
entity_id: cover.slaapkamer
to: unavailable
for:
minutes: 5
- trigger: state
entity_id: cover.slaapkamer
to: unavailable
for:
minutes: 60
actions:
- alias: Reload Overkiz integration
action: homeassistant.reload_config_entry
target:
entity_id: cover.slaapkamer
- alias: Clear the notification
action: persistent_notification.dismiss
data:
notification_id: config_entry_reconfigure
- id: doorbell_press_action
alias: Deurbel wordt ingedrukt
description: "Wanneer er op de deurbel gedrukt wordt:\n - Stuur een melding naar\
\ Sander wanneer hij aan het thuiswerken is.\n - Stuur een melding naar de tv\
\ en start de stream wanneer de tv aan staat.\n - Pauzeer de tv als Jellyfin,\
\ Netflix of Youtube aan staat.\n - Pauzeer Ziggo wanneer die geen lineaire tv\
\ afspeelt.\n"
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.deurbel_ringing
from: 'off'
to: 'on'
actions:
- variables:
message_title: Ding dong
message_text: Iemand staat bij de deur
tv_sources_to_pause:
- Jellyfin
- Netflix
- YouTube
tv_current_source: '{{ state_attr(''media_player.lg_c9'', ''source'') }}'
internal_url: secret internal_url
- choose:
- conditions:
- condition: state
entity_id:
- binary_sensor.macbook_in_thuis_kantoor_en_aan
state: 'on'
sequence:
- alias: Notify Sander when he's working from home, he might not hear the doorbell
as he's really busy
action: notify.sander
data:
title: '{{ message_title }}'
message: '{{ message_text }}'
data:
group: deurbel
entity_id: camera.deurbel
url: /dashboard-buiten/voortuin
- choose:
- conditions:
- condition: state
entity_id: media_player.lg_c9
state: 'on'
sequence:
- alias: Notify tv when on
action: notify.lg_c9
data:
message: '{{ message_title }} {{ message_text }}'
- choose:
- conditions:
- '{{ state_attr(''media_player.lg_c9'', ''source'') in tv_sources_to_pause
}}'
sequence:
- alias: Pause tv for given sources
action: media_player.media_pause
entity_id: media_player.lg_c9
- conditions:
- '{{ not is_state(''media_player.mediabox'', [''idle'', ''paused'', ''off'',
''unavailable'', ''unknown'']) }}'
- '{{ is_state_attr(''media_player.lg_c9'', ''source'', ''Ziggo'') }}'
- '{{ not is_state_attr(''media_player.mediabox'', ''play_mode'', ''linear'')
}}'
sequence:
- alias: Pause Ziggo, but not when watching linear tv
action: media_player.media_pause
entity_id: media_player.mediabox
- delay:
seconds: 5
- id: flightradar24_notification
alias: 'Notificatie: Flightradar24'
mode: restart
max_exceeded: silent
triggers:
- alias: Plane entering the area
trigger: event
event_type: flightradar24_entry
actions:
- alias: Set variables
variables:
registration: '{{ iif(trigger.event.data.aircraft_registration, trigger.event.data.aircraft_registration,
"N/A") }}'
callsign: '{{ iif(trigger.event.data.callsign, trigger.event.data.callsign,
"N/A") }}'
model: '{{ iif(trigger.event.data.aircraft_model, trigger.event.data.aircraft_model,
"N/A") }}'
airline: '{{ iif(trigger.event.data.airline_short, trigger.event.data.airline_short,
"N/A") }}'
from: '{{ iif(trigger.event.data.airport_origin_city, trigger.event.data.airport_origin_city
~ ", " ~ trigger.event.data.airport_origin_country_name, "N/A") }}'
to: '{{ iif(trigger.event.data.airport_destination_city, trigger.event.data.airport_destination_city
~ ", " ~ trigger.event.data.airport_destination_country_name, "N/A") }}'
altitude: '{{ (trigger.event.data.altitude | float * 0.3048) | round(0) }}'
speed: '{{ (trigger.event.data.ground_speed | float * 1.852) | round(0) }}'
url: "{% if callsign not in [\"N/A\", \"Blocked\"] %}\n {{ \"https://www.fr24.com/\"\
\ ~ callsign }}\n{% else %}\n {{ \"https://www.fr24.com/\" ~ trigger.event.data.flight_number\
\ }}\n{% endif %}"
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_flightradar
data:
embed:
author:
name: Flightradar24
icon_url: https://brands.home-assistant.io/flightradar24/icon.png
color: '{% if "LIFELN" in callsign %} 16776960 {% else %} None {% endif
%}'
title: ✈️ {{ model }} - {{ airline }}
description: '{{ now().strftime(''%d-%m-%Y %H:%M:%S'') }}
Callsign: {{ callsign }}
Registration: {{ registration }}
From: {{ from }}
To: {{ iif(callsign == "LIFELN1", states(''sensor.p2000_lifeliner_1''),
to) }}
Altitude: {{ altitude }} meter
Speed: {{ speed }} km/h
{{ url }}
'
thumbnail:
url: '{{ trigger.event.data.aircraft_photo_large }}'
- id: goedemorgen_bericht
alias: Goedemorgen bericht bij 1e beweging in de woonkamer
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.overloop_sensor_1_beweging
to: 'on'
conditions:
- condition: state
entity_id: media_player.lg_c9
state: 'off'
- condition: state
entity_id: media_player.lg_soundbar
state:
- 'off'
- idle
- condition: state
entity_id: binary_sensor.morning
state: 'on'
- condition: template
value_template: '{% from "automations.jinja" import last_triggered_longer_than
%} {{ last_triggered_longer_than("automation.goedemorgen_bericht_bij_1e_beweging_in_de_woonkamer",
6 * 60 * 60) }}
'
actions:
- alias: Force update weather description
action: homeassistant.update_entity
target:
entity_id: sensor.lokaal_weer_en_verkeer
- alias: Set soundbar volume
action: media_player.volume_set
data:
entity_id: media_player.lg_soundbar
volume_level: 0.25
- alias: Wait a little
delay:
seconds: 5
- alias: Speak message
action: tts.microsoft_say
entity_id: media_player.lg_soundbar
data:
message: "{% from 'nl.jinja' import month, day, daypart %}\nGoede{{ daypart()\
\ }} Vandaag is het {{ day() }} {{ now().day }} {{ month() }}. {% if state_attr(\"\
sensor.lokaal_weer_en_verkeer\", \"weatherDescription\").replace(\"-\", \"\
\") in [\"\", None] %}\n {{ states(\"sensor.knmi_weersverwachting\") }}\n\
{% else %}\n {{\n state_attr(\"sensor.lokaal_weer_en_verkeer\", \"weatherDescription\"\
)\n | replace(\"km/uur\", \"kilometer per uur\")\n | replace(\"Dit weerbericht\
\ is geschreven door kunstmatige intelligentie op basis van data van openweathermap.\"\
, \"\")\n }}\n{% endif %}\n{{ iif(is_state(\"binary_sensor.knmi_waarschuwing\"\
, \"on\"), state_attr(\"binary_sensor.knmi_waarschuwing\", \"description\"\
), \"\") }}"
- alias: Wait till the message has finished
wait_for_trigger:
- trigger: state
entity_id: media_player.lg_soundbar
from: playing
to: idle
timeout:
minutes: 2
continue_on_timeout: true
- alias: Restore soundbar volume and source
action: shell_command.set_soundbar_source_and_volume
data:
ip: secret lg_soundbar_ip
source: 15
volume: 12
- id: notification_apk_golf_75
alias: 'Notificatie: APK Golf 7.5'
mode: single
triggers:
- platform: time
at: '14:00:00'
condition:
- condition: template
value_template: "{{\n now().date() == (states('sensor.golf_7_5_apk_expiration')\
\ | as_datetime | as_local - timedelta(days=60)).date()\n}}"
action:
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_algemeen
data:
embed:
author:
name: RDW
icon_url: https://brands.home-assistant.io/rdw/icon.png
title: 🚗 APK Golf 7.5
description: 'Tijd voor het inplannen van de APK, deze verloopt op {{ states(''sensor.golf_7_5_apk_expiration'')
}}
'
- id: track_golf_75
alias: Golf 7.5 - Update locatie
description: "This automation does update a car location.\nRequirements:\n - An\
\ iPhone\n - Focus while driving should be set, either automatically or via Bluetooth.\n\
\ - Shortcuts app should be installed and 2 automations should be created:\n\
\ 1. When focus Driving is turned on -> select Home Assistant event: GOLF_75_START\n\
\ 2. When focus Driving is turned off -> select Home Assistant event: GOLF_75_STOP\n\
Every {throttle_seconds} the location of the person who sent the start event is\
\ used as the car location. This is done until the stop event is sent.\nThis does\
\ only work if a defined Home Assistant person is driving the car, so no theft\
\ protection.\n"
mode: restart
triggers:
- trigger: event
event_type: GOLF_75_START
id: start
- trigger: event
event_type: GOLF_75_STOP
id: stop
- trigger: homeassistant
event: start
id: restore
variables:
device_tracker_id: golf_7_5
throttle_seconds: 30
actions:
- alias: Collect some variables
variables:
user_id: "{% if trigger.event.context is defined %}\n {{ trigger.event.context.user_id\
\ }}\n{% else %}\n null\n{% endif %}"
person: "{{\n states.person\n | selectattr(\"attributes.user_id\", \"eq\"\
, user_id)\n | map(attribute=\"entity_id\")\n | first\n | default(\"\
none\")\n}}"
- choose:
- alias: Start event, person should be set as well
conditions:
- '{{ person = "none" }}'
- condition: trigger
id: start
sequence:
- alias: Repeat location updates until the automation is triggered with a stop
event
repeat:
while: '{{ True }}'
sequence:
- alias: Set car location based on the location of the person
action: device_tracker.see
data:
dev_id: '{{ device_tracker_id }}'
gps:
- '{{ state_attr(person, "latitude")}}'
- '{{ state_attr(person, "longitude")}}'
gps_accuracy: '{{ state_attr(person, "gps_accuracy") }}'
- alias: Throttle updates
delay:
seconds: '{{ throttle_seconds }}'
- alias: Stop event, person should be set as well
conditions:
- '{{ person = "none" }}'
- condition: trigger
id: stop
sequence:
- alias: Set final car location based on the location of the person
action: device_tracker.see
data:
dev_id: '{{ device_tracker_id }}'
gps:
- '{{ state_attr(person, "latitude")}}'
- '{{ state_attr(person, "longitude")}}'
gps_accuracy: '{{ state_attr(person, "gps_accuracy") }}'
- alias: Restore event
conditions:
- condition: trigger
id: restore
sequence:
- alias: Set car location based on last known location from SQL sensor
action: device_tracker.see
data:
dev_id: '{{ device_tracker_id }}'
gps:
- '{{ states("sensor.golf_7_5_last_known_location").split(", ")[0] }}'
- '{{ states("sensor.golf_7_5_last_known_location").split(", ")[1] }}'
gps_accuracy: '{{ states("sensor.golf_7_5_last_known_location").split(",
")[2] }}'
- id: home_connect_dishwaser_delayed_start
alias: Vaatwasser - Uitgestelde start
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.bosch_sbv88tx36e_68a40e0cd8f6_bsh_common_status_doorstate
from: 'on'
to: 'off'
conditions:
- condition: state
entity_id: binary_sensor.bosch_sbv88tx36e_68a40e0cd8f6_bsh_common_status_remotecontrolstartallowed
state: 'on'
actions:
- alias: Start the dishwasher program delayed at 03:00
action: home_connect_alt.start_program
data:
device_id: '{{ device_id(''switch.bosch_sbv88tx36e_68a40e0cd8f6_bsh_common_setting_powerstate'')
}}'
options:
- key: BSH.Common.Option.StartInRelative
value: "{% set now = now() %} {% set target = now.replace(hour=3, minute=0,\
\ second=0, microsecond=0) %} {% if now >= target %}\n {% set target =\
\ target + timedelta(days=1) %}\n{% endif %} {{ (target - now).total_seconds()\
\ | int }}"
program_key: Dishcare.Dishwasher.Program.Auto2
validate: true
- id: home_connect_conversation_remaining_time
alias: 'Spraakassistent: Wanneer is de machine klaar'
mode: single
triggers:
- trigger: conversation
command:
- Wanneer is de {machine} klaar
actions:
- alias: Set repsonse
set_conversation_response: "{% if trigger.slots.machine == \"vaatwasser\" and\
\ states(\"sensor.vaatwasser_resterende_minuten\") != \"unavailable\" %}\n \
\ over {{ states(\"sensor.vaatwasser_resterende_minuten\") }}\n{% elif trigger.slots.machine\
\ == \"wasmachine\" and states(\"sensor.wasmachine_resterende_minuten\") !=\
\ \"unavailable\" %}\n over {{ states(\"sensor.wasmachine_resterende_minuten\"\
) }}\n{% elif trigger.slots.machine == \"oven\" and states(\"sensor.oven_resterende_minuten\"\
) != \"unavailable\" %}\n over {{ states(\"sensor.oven_resterende_minuten\"\
) }}\n{% else %}\n Ik weet het niet, staat de {{ trigger.slots.machine }} wel\
\ aan?\n{% endif %}"
- id: vacation_mode
alias: Vakantie modus - automatisch activeren en deactiveren
mode: single
triggers:
- trigger: state
entity_id: group.residents
to: not_home
for: '24:00:00'
id: aan
- trigger: state
entity_id: group.residents
to: home
actions:
- if:
- condition: trigger
id: aan
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
then:
- alias: Turn on vacation mode
action: input_boolean.turn_on
entity_id: input_boolean.vacation_mode
else:
- alias: Turn off vacation mode
action: input_boolean.turn_off
entity_id: input_boolean.vacation_mode
- id: vacation_mode_presence
alias: Vakantie modus - aanwezigheid nabootsen
mode: parallel
triggers:
- trigger: numeric_state
entity_id: sensor.epl_eettafel_illuminance
below: 2.2
for:
minutes: 30
id: woonkamer_avond
- trigger: time
at: '23:30:00'
id: tanden_poetsen
- trigger: time
at: 00:45:00
id: nacht_toilet
- trigger: time
at: 00:00:00
id: alles_uit
conditions:
- condition: state
entity_id: input_boolean.vacation_mode
state: 'on'
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
actions:
- choose:
- conditions:
- condition: trigger
id: woonkamer_avond
sequence:
- alias: Wait a little to randomize the behavior
delay:
minutes: '{{ range(0, 15) | random }}'
- alias: Turn on the light
action: light.turn_on
data:
xy_color:
- 0.459
- 0.408
brightness: 1
target:
entity_id: light.woonkamer_groot_2
- alias: Wait till a certain time
wait_for_trigger:
- trigger: time
at: '22:00:00'
- alias: Wait a little to randomize the behavior
delay:
minutes: '{{ range(0, 30) | random }}'
- alias: Turn off the light
action: light.turn_off
target:
entity_id: light.woonkamer_groot_2
- conditions:
- condition: trigger
id: tanden_poetsen
sequence:
- alias: Wait a little to randomize the behavior
delay:
minutes: '{{ range(0, 30) | random }}'
- alias: Turn on the light
action: scene.turn_on
target:
entity_id: scene.badkamer_helder
- alias: Wait a little to randomize the behavior
delay:
minutes: '{{ range(3, 5) | random }}'
- alias: Turn off the light
action: light.turn_off
target:
entity_id: light.badkamer
- conditions:
- condition: trigger
id: nacht_toilet
sequence:
- alias: Wait a little to randomize the behavior
delay:
minutes: '{{ range(0, 30) | random }}'
- alias: Turn on the light
action: scene.turn_on
target:
entity_id: scene.badkamer_ontspannen
- alias: Wait a little to randomize the behavior
delay:
minutes: '{{ range(1, 3) | random }}'
- alias: Turn off the light
action: light.turn_off
target:
entity_id: light.badkamer
- conditions:
- condition: trigger
id: alles_uit
sequence:
- alias: Make sure everything is off
action: script.everything_off
- id: auto_christmas_tree_light
alias: Kerst - Kerstboom automatisch aan/uit door aanwezigheid
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: binary_sensor.woonkamer_bezetting
to:
- 'on'
- 'off'
conditions:
- condition: not
conditions:
- condition: state
entity_id: light.kerstboom
state: unavailable
actions:
- choose:
- conditions:
- condition: time
after: 07:00:00
before: 00:00:00
- condition: state
entity_id: binary_sensor.woonkamer_bezetting
state: 'on'
sequence:
- alias: Set effect
action: mqtt.publish
data:
topic: zigbee2mqtt/Kerstboom/set
payload: "{\n \"effect\": {\n \"effect\": \"carnaval\",\n \
\ \"speed\": 50,\n \"colors\": [\n {\n \
\ \"r\": 255,\n \"g\": 0,\n \"b\":\
\ 0\n },\n {\n \"r\": 0,\n \
\ \"g\": 255,\n \"b\": 0\n },\n \
\ {\n \"r\": 0,\n \"g\": 0,\n \
\ \"b\": 255\n },\n {\n \
\ \"r\": 255,\n \"g\": 255,\n \"b\"\
: 0\n },\n {\n \"r\": 255,\n \
\ \"g\": 0,\n \"b\": 255\n },\n \
\ {\n \"r\": 255,\n \"g\": 165,\n\
\ \"b\": 0\n }\n ]\n }\n}"
- alias: Turn on the light
action: light.turn_on
target:
entity_id: light.kerstboom
default:
- alias: Turn off the light
action: light.turn_off
target:
entity_id: light.kerstboom
- id: christmas_keep_woonkamer_groot_2_off
alias: Kerst - Houdt de woonkamer groot 2 uit
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: light.woonkamer_groot_2
from: 'off'
to: 'on'
- trigger: state
entity_id: light.kerstboom
from: 'off'
to: 'on'
conditions:
- condition: not
conditions:
- condition: state
entity_id: light.kerstboom
state: unavailable
actions:
- alias: Turn off the light
action: light.turn_off
target:
entity_id: light.woonkamer_groot_2
- id: badkamer_klimaat
alias: Badkamer klimaat aan/uit door raam
use_blueprint:
path: golles/door-window-climate-control.yaml
input:
door_entity: binary_sensor.badkamerraam_contact
climate_entity: climate.badkamer
turn_off_delay: 300
- id: mechanische_ventilatie_douchen
alias: Mechanische ventilatie tijdens douchen
mode: restart
triggers:
- trigger: state
entity_id: binary_sensor.douche_beweging_occupancy
from: 'off'
to: 'on'
actions:
- alias: Set fan to extra high for 30 minutes
action: script.mechanical_ventilation_speed_timer
data:
speed: 4
timer: 30
- alias: Wait for occupancy to be off for 5 minutes
wait_for_trigger:
- trigger: state
entity_id: binary_sensor.douche_beweging_occupancy
from: 'on'
to: 'off'
for:
minutes: 5
timeout:
minutes: 45
continue_on_timeout: false
- alias: Set fan to high for 15 minutes
action: script.mechanical_ventilation_speed_timer
data:
speed: 3
timer: 15
- id: logeerkamer_awtrix_klok
alias: Logeerkamer Awtrix klok
use_blueprint:
path: golles/awtrix_clock.yaml
input:
light_entity: light.logeerkamer_klok_matrix
topic: awtrix_b92250
button_entity: binary_sensor.logeerkamer_klok_button_select
temp_entity: sensor.logeerkamer_temperatuur
weather_entity: weather.knmi_purmerend
occupancy_entity: binary_sensor.logeerkamer_bezetting
dishwasher_entity: sensor.vaatwasser_resterende_minuten
washing_machine_entity: sensor.wasmachine_resterende_minuten
- id: turn_off_klok_when_light_switch_pressed
alias: Turn off klok when light turn off switch is pressed
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: event.logeerkamer_schakelaar_button_4
actions:
- alias: Send the notification
action: light.turn_off
target:
entity_id: light.logeerkamer_klok_matrix
- id: notification_knmi
alias: 'Notificatie: KNMI waarschuwing'
triggers:
trigger: state
entity_id: binary_sensor.knmi_waarschuwing
from: 'off'
to: 'on'
actions:
- if:
- condition: state
entity_id: media_player.lg_c9
state: 'on'
then:
- alias: Sent a notification to the tv
action: notify.lg_c9
data:
message: '{{state_attr("binary_sensor.knmi_waarschuwing", "title")}} {{state_attr("binary_sensor.knmi_waarschuwing",
"description")}}'
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_weer
data:
embed:
author:
name: KNMI
icon_url: https://brands.home-assistant.io/knmi/icon.png
color: '{% set state = state_attr("binary_sensor.knmi_waarschuwing", "code")
%} {% if state == "groen" %} 3066993 {% elif state == "geel" %} 16776960
{% elif state == "oranje" %} 16753920 {% elif state == "rood" %} 15158332
{% else %} 16777215 {% endif %}'
title: ⚠️ {{state_attr("binary_sensor.knmi_waarschuwing", "title")}}
description: '{{state_attr("binary_sensor.knmi_waarschuwing", "description")}}
https://www.knmi.nl/nederland-nu/weer/waarschuwingen/noord-holland
'
- id: notification_leeghwaterbad_ticket
alias: 'Notificatie: Leeghwaterbad ticket'
mode: single
triggers:
- trigger: state
entity_id: person.sander
to: Leeghwaterbad
conditions:
- condition: template
value_template: "{{\n 0 <= as_timestamp(states(\"sensor.leeghwaterbad_volgende_bestelling\"\
), 0) - as_timestamp(now()) <= 60 * 60\n}}"
actions:
- action: notify.mobile_app_iphone_van_golles
data:
title: 🏊 Veel plezier met zwemmen
message: Klik voor de tickets
data:
tag: leeghwaterbad
image: '{{ state_attr("sensor.leeghwaterbad_volgende_bestelling", "ticket")}}'
url: '{{ state_attr("sensor.leeghwaterbad_volgende_bestelling", "ticket")}}'
- id: lgc9_turn_on_wol
alias: LG C9 - Turn on via Wake-On-LAN
mode: single
triggers:
- trigger: webostv.turn_on
entity_id: media_player.lg_c9
actions:
- action: wake_on_lan.send_magic_packet
data:
mac: secret webostv_mac
broadcast_address: secret webostv_ip
- id: ios_action_radio_qmusic
alias: iOS action - Qmusic
mode: single
max_exceeded: silent
triggers:
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Qmusic
actions:
- action: script.play_livingroom_radio
data:
stream: https://stream.qmusic.nl/qmusic/mp3
- id: ios_action_tv_ziggo
alias: iOS action - Ziggo
mode: single
max_exceeded: silent
triggers:
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Ziggo
actions:
- choose:
- conditions:
- condition: state
entity_id: media_player.mediabox
state: 'off'
sequence:
- action: script.lg_c9_source_ziggo
default:
- action: media_player.turn_off
entity_id: media_player.mediabox
- id: notification_meteoalarm
alias: 'Notificatie: MeteoAlarm waarschuwing'
triggers:
trigger: state
entity_id: binary_sensor.meteoalarm
from: 'off'
to: 'on'
conditions:
- '{{ state_attr(''binary_sensor.meteoalarm'', ''headline'') = None }}'
- '{{ state_attr(''binary_sensor.meteoalarm'', ''description'') = None }}'
- '{{ state_attr(''binary_sensor.meteoalarm'', ''instruction'') = None }}'
actions:
- if:
- condition: state
entity_id: media_player.lg_c9
state: 'on'
then:
- alias: Sent a notification to the tv
action: notify.lg_c9
data:
message: '{{state_attr("binary_sensor.meteoalarm", "description")}} {{state_attr("binary_sensor.meteoalarm",
"instruction")}}'
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_weer
data:
embed:
author:
name: MeteoAlarm
icon_url: https://brands.home-assistant.io/meteoalarm/icon.png
color: '{% set state = state_attr("binary_sensor.meteoalarm", "code") %}
{% if state == "2; yellow; Moderate" %} 16776960 {% elif state == "3;
orange; Severe" %} 16753920 {% elif state == "4; red; High" %} 15158332
{% else %} 3066993 {% endif %}'
title: ⚠️ {{state_attr("binary_sensor.meteoalarm", "headline")}}
description: '{{state_attr("binary_sensor.meteoalarm", "description")}}
{{state_attr("binary_sensor.meteoalarm", "instruction")}}
https://meteoalarm.org/nl/live/region/NL
'
- id: notification_ip_changed
alias: 'Notificatie: Externe IP veranderd'
mode: single
triggers:
- trigger: state
entity_id: sensor.myip
conditions:
- condition: template
value_template: '{{ trigger.to_state.state not in [trigger.from_state.state, "unknown",
"unavailable"] }}'
actions:
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_monitoring
data:
embed:
color: 16753920
title: 🌍 Externe IP gewijzigd
description: 'Nieuwe ip: {{ states(''sensor.myip'') }}
Check of de DDNS update gelukt is
'
- id: overloop_on_from_zolder
alias: Overloop lamp automatisch aandoen als iemand van zolder komt
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.zoldertrap_sensor_beweging
to: 'on'
conditions:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.zolder_beweging
state: 'on'
- condition: numeric_state
entity_id: sensor.overloop_sensor_2_licht
below: 10
- condition: or
conditions:
- condition: state
entity_id: light.overloop
state: 'off'
- condition: numeric_state
entity_id: light.overloop
attribute: brightness
below: 25
actions:
- action: light.turn_on
data:
entity_id: light.overloop_spot_2
profile: helder
transition: 1
- id: notification_p2000
alias: 'Notificatie: P2000 bericht in de buurt'
mode: single
triggers:
- trigger: state
entity_id: sensor.p2000_dichtbij
conditions:
- condition: template
value_template: '{{ trigger.to_state.state = trigger.from_state.state }}'
actions:
- if:
- condition: state
entity_id: media_player.lg_c9
state: 'on'
then:
- alias: Sent a notification to the tv
action: notify.lg_c9
data:
message: '{{ states("sensor.p2000_dichtbij") }}'
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_p2000
data:
embed:
color: '{% set state = state_attr("sensor.p2000_dichtbij", "discipline")
| lower %} {% if "ambulance" in state %} 16776960 {% elif "brandweer"
in state %} 15158332 {% elif "politie" in state %} 3447003 {% else %}
None {% endif %}'
title: '{% set state = state_attr("sensor.p2000_dichtbij", "discipline")
| lower %} {% if "ambulance" in state %} 🚑 {% elif "brandweer" in state
%} 🚒 {% elif "politie" in state %} 🚓 {% else %}🚨 {% endif %} P2000 melding'
description: '{{ states("sensor.p2000_dichtbij") }}
https://www.google.com/maps/search/?api=1&query={{ state_attr("sensor.p2000_dichtbij",
"latitude") }},{{ state_attr("sensor.p2000_dichtbij", "longitude") }}
'
- id: 3d_printer_lamp
alias: 3D printer lamp
mode: restart
max_exceeded: silent
triggers:
- alias: Room occupancy changes
trigger: state
entity_id: binary_sensor.zolder_bezetting
- alias: The printer comes online
trigger: state
entity_id: binary_sensor.p1s_01p00c480300533_online
to: 'on'
- alias: The printer is making a timelapse
trigger: state
entity_id: binary_sensor.p1s_01p00c480300533_recording_timelapse
to: 'on'
condition:
- alias: The printer should be online
condition: state
entity_id: binary_sensor.p1s_01p00c480300533_online
state: 'on'
actions:
- if:
- condition: or
conditions:
- alias: When the room is occupied
condition: state
entity_id: binary_sensor.zolder_bezetting
state: 'on'
- alias: When making a timelapse
condition: state
entity_id: binary_sensor.p1s_01p00c480300533_recording_timelapse
state: 'on'
then:
- alias: Turn the printer chamber light on
action: light.turn_on
entity_id: light.p1s_01p00c480300533_chamber_light
else:
- alias: Wait a bit
delay:
minutes: 2
- alias: Turn the printer chamber light off
action: light.turn_off
entity_id: light.p1s_01p00c480300533_chamber_light
- id: alarm_auto_on_off
alias: Alarm - Automatisch aan/uit bij aanwezigheid
mode: single
triggers:
- trigger: state
entity_id: group.residents
to:
- home
- not_home
actions:
- choose:
- conditions:
- condition: state
entity_id: group.residents
state: not_home
sequence:
- alias: Set the alarm to arm away
action: alarm_control_panel.alarm_arm_away
entity_id: alarm_control_panel.alarmo
default:
- alias: Disarm the alarm
action: alarm_control_panel.alarm_disarm
entity_id: alarm_control_panel.alarmo
- id: borg_webhook
alias: Borg backup webhook
mode: restart
triggers:
- trigger: webhook
webhook_id: borg
allowed_methods:
- POST
local_only: true
actions:
- action: input_text.set_value
data_template:
entity_id: input_text.borg
value: '{{ trigger.json.status }}'
- id: notification_borg_warning
alias: 'Notificatie: Borg backup waarschuwing'
mode: restart
triggers:
- trigger: state
entity_id: input_text.borg
for:
minutes: 30
conditions:
- '{{ states(''input_text.borg'') == ''Backup and/or Prune finished with errors''
}}'
actions:
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_monitoring
data:
embed:
color: 15158332
title: Borg backup
description: 'Backup is niet goed gegaan.
Laatste status: `{{ states(''input_text.borg'') }}`
'
- id: send_particulate_matter_data
alias: Fijnstofmeter data versturen naar externe services
mode: single
max_exceeded: silent
triggers:
- trigger: state
id: sds011
entity_id:
- sensor.particulate_matter_pm_10
- sensor.particulate_matter_pm_2_5
- trigger: state
id: bme280
entity_id:
- sensor.particulate_matter_humidity
- sensor.particulate_matter_pressure
- sensor.particulate_matter_temperature
conditions:
- condition: state
entity_id: switch.particulate_matter_standalone_mode
state: 'off'
actions:
- alias: Wait a second, to make sure all values are up-to-date
delay: 1
- alias: Which sensor group?
choose:
- conditions:
- condition: trigger
id: sds011
- not:
- condition: state
entity_id: sensor.particulate_matter_pm_10
state:
- unavailable
- unknown
- condition: state
entity_id: sensor.particulate_matter_pm_2_5
state:
- unavailable
- unknown
- condition: state
entity_id: sensor.particulate_matter_wifi_signal
state:
- unavailable
- unknown
sequence:
- alias: Post to Luftdaten
action: rest_command.post_luftdaten_sds011
- alias: Post to Madavi
action: rest_command.post_madavi_sds011
- alias: Post to openSenseMap
action: rest_command.post_opensensemap_sds011
- conditions:
- condition: trigger
id: bme280
- not:
- condition: state
entity_id: sensor.particulate_matter_humidity
state:
- unavailable
- unknown
- condition: state
entity_id: sensor.particulate_matter_pressure
state:
- unavailable
- unknown
- condition: state
entity_id: sensor.particulate_matter_temperature
state:
- unavailable
- unknown
- condition: state
entity_id: sensor.particulate_matter_wifi_signal
state:
- unavailable
- unknown
sequence:
- alias: Post to Luftdaten
action: rest_command.post_luftdaten_bme280
- alias: Post to Madavi
action: rest_command.post_madavi_bme280
- alias: Post to openSenseMap
action: rest_command.post_opensensemap_bme280
- id: rain_detected
alias: Regen gedetecteerd
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.regen_contact
from: 'off'
to: 'on'
actions:
- action: notify.sander
data:
title: 🌧️ Regen
message: Test bericht, het regent
data:
group: weather
url: /dashboard-buiten/weer
- id: keuken_rolgordijn_auto
alias: Keuken rolgordijn automatisch open/dicht
mode: single
max_exceeded: silent
triggers:
- alias: Close on calculated time
trigger: time
at: input_datetime.covers_down
- alias: For days when it turns dark early
trigger: numeric_state
entity_id: sensor.achtertuin_sensor_1_licht
below: 25
for:
minutes: 15
- alias: For days when it turns dark late
trigger: time
at: '19:30:00'
- alias: Time to open the cover
trigger: time
at: 08:30:00
id: open
actions:
- if:
- condition: trigger
id: open
then:
- alias: Open the cover
action: button.press
target:
entity_id: button.keuken_rolgordijn_voorkeurspositie
else:
- alias: Delay closing, so it doesn't close at the same time every day
delay:
minutes: '{{ range(0, 30) | random }}'
- alias: Close the cover, depending on the window state
action: script.close_cover_window_state
data:
wait_minutes: 240
cover_entity: cover.keuken
window_entity: binary_sensor.keukenraam_contact
- id: close_kledingkamer_cover
alias: Kledingkamer rolluik sluiten op tijd
mode: single
max_exceeded: silent
triggers:
- trigger: time
at: input_datetime.covers_down
actions:
- action: script.close_cover_window_state
data:
wait_minutes: 240
cover_entity: cover.kledingkamer
window_entity: binary_sensor.kledingkamerraam_contact
- id: rolluiken_open_niemand_thuis
alias: Rolluiken - open bij niemand thuis
mode: single
triggers:
- trigger: time
at: 09:00:00
conditions:
- condition: state
entity_id: group.residents
state: not_home
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
actions:
- alias: Open south facing covers based on temperature
action: script.open_south_facing_covers_based_on_weather
- action: button.press
target:
entity_id: button.logeerkamer_rolgordijn_voorkeurspositie
- id: switch_soundbar_source_and_volume_when_tv_on
alias: Automatisch soundbar source en volume zetten als de tv aan gaat
mode: single
triggers:
- trigger: state
entity_id: media_player.lg_c9
from: 'off'
to: 'on'
actions:
- alias: Set source and volume on the soundbar
action: shell_command.set_soundbar_source_and_volume
data:
ip: secret lg_soundbar_ip
source: 15
volume: 12
- id: electricity_low_today
alias: 'Notificatie: Elektriciteit laag tarief vandaag'
mode: single
triggers:
- trigger: time
at: '10:30:00'
- trigger: state
entity_id: group.residents
from: not_home
to: home
conditions:
- condition: state
entity_id: sensor.dsmr_meter_stats_electricity_tariff
state: low
- condition: state
entity_id: group.residents
state: home
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: time
after: 07:00:00
before: '23:00:00'
- condition: template
value_template: '{% from "automations.jinja" import last_triggered_longer_than
%} {{ last_triggered_longer_than("automation.notificatie_elektriciteit_laag_tarief_vandaag",
24 * 60 * 60) }}
'
actions:
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_meterstanden
data:
embed:
title: 🔌 Elektriciteit
description: Vandaag is de Elektriciteit de hele dag laag tarief
- id: system_monitoring_alert
alias: 'Notificatie: Systeem monitoring'
mode: parallel
triggers:
- trigger: numeric_state
entity_id: sensor.system_monitor_schijfgebruik
above: 80
variables:
alert_message: SSD1 is bijna vol, -STATE-%
resolved_message: SSD1 is weer OK, -STATE-%
resolved_threshold: 80
- trigger: numeric_state
entity_id: sensor.system_monitor_schijfgebruik_media
above: 80
variables:
alert_message: SSD2 is bijna vol, -STATE-%
resolved_message: SSD2 is weer OK, -STATE-%
resolved_threshold: 80
- trigger: numeric_state
entity_id: sensor.system_monitor_geheugengebruik
above: 80
for:
minutes: 5
variables:
alert_message: Geheugen gebruik is hoog, -STATE-%
resolved_message: Geheugen gebruik is weer OK, -STATE-%
resolved_threshold: 80
- trigger: numeric_state
entity_id: sensor.system_monitor_swap_usage
above: 80
for:
minutes: 5
variables:
alert_message: Swap gebruik is hoog, -STATE-%
resolved_message: Swap gebruik is weer OK, -STATE-%
resolved_threshold: 80
- trigger: numeric_state
entity_id: sensor.system_monitor_processor_use
above: 80
for:
minutes: 5
variables:
alert_message: Processor gebruik is hoog, -STATE-%
resolved_message: Processor gebruik is weer OK, -STATE-%
resolved_threshold: 80
- trigger: numeric_state
entity_id: sensor.system_monitor_processortemperatuur
above: 85
for:
minutes: 5
variables:
alert_message: Processor temperatuur is hoog, -STATE-°C
resolved_message: Processor temperatuur is weer OK, -STATE-°C
resolved_threshold: 85
actions:
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_monitoring
data:
embed:
color: 15158332
title: Systeem monitoring
description: ':x: - `{{ alert_message | replace(''-STATE-'', states(trigger.entity_id))
}}`
'
- alias: Wait a bit to see if the alert resolves
wait_template: "{{\n states(trigger.entity_id) | int < resolved_threshold | int\n\
}}"
timeout:
hours: 1
continue_on_timeout: false
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_monitoring
data:
embed:
color: 3066993
title: Systeem monitoring
description: ':white_check_mark: - `{{ resolved_message | replace(''-STATE-'',
states(trigger.entity_id)) }}`
'
- id: auto_day_night_theme
alias: Automatisch thema voor dag en nacht
mode: single
triggers:
- trigger: homeassistant
event: start
- trigger: state
entity_id: sun.sun
to:
- below_horizon
- above_horizon
actions:
- choose:
- conditions:
- condition: state
entity_id: sun.sun
state: below_horizon
sequence:
- action: frontend.set_theme
data:
name: Mushroom Shadow
mode: dark
default:
- action: frontend.set_theme
data:
name: Mushroom Shadow
mode: light
- id: trapkast_light_based_on_door
alias: trapkast verlichting automatisch aan en uit
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: binary_sensor.trapkastdeur_contact
to:
- 'on'
- 'off'
actions:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.trapkastdeur_contact
state: 'on'
sequence:
- action: light.turn_on
entity_id: light.trapkastlamp
- delay:
minutes: 10
- action: light.turn_off
entity_id: light.trapkastlamp
default:
- action: light.turn_off
entity_id: light.trapkastlamp
- id: trapkast_knop
alias: Trapkast knop
use_blueprint:
path: golles/zigbee2mqtt_xiaomi_switch.yaml
input:
switch: d6a97e023579c72e49cbdd8f5391df8b
single:
- alias: Toggle light
action: light.toggle
target:
entity_id: light.trapkastlamp
- id: ziggo_auto_off_when_tv_off
alias: Automatisch Ziggo uitzetten als de tv uit is
mode: single
triggers:
- trigger: state
entity_id: media_player.lg_c9
to: 'off'
for:
minutes: 1
conditions:
condition: not
conditions:
- condition: state
entity_id: media_player.mediabox
state: 'off'
actions:
- action: media_player.turn_off
entity_id: media_player.mediabox
- id: ups_state_change
alias: 'Notificatie: UPS status verandering'
mode: single
triggers:
- trigger: state
entity_id: sensor.ups_status
conditions:
- condition: not
conditions:
- condition: state
entity_id: sensor.ups_resultaat_zelftest
state: In progress
- condition: template
value_template: "{{\n trigger.from_state.state not in [\"unavailable\", \"Online\"\
, \"Online Battery Charging\"] and\n trigger.to_state.state not in [\"unavailable\"\
, \"Online\", \"Online Battery Charging\"]\n}}\n"
actions:
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_monitoring
data:
embed:
color: '{{ iif(is_state("sensor.ups_status", "Online"), "3066993", "15158332")
}}'
title: 🔋 UPS status
description: '{{ states("sensor.ups_status") }}
'
- id: post_daily_meter_values_at_midnight
alias: Meterstanden posten om middernacht
mode: single
triggers:
- trigger: time
at: 00:00:00
actions:
- alias: Post values
action: rest_command.post_daily_meter_values
- id: notification_monthly_meter_values
alias: 'Notificatie: Maandelijkse meterstanden'
triggers:
- trigger: time
at: 09:00:00
condition:
condition: template
value_template: '{{ now().day == 1 }}'
actions:
- action: rest_command.get_monthly_meter_values
response_variable: meter_response
- if: '{{ meter_response["status"] == 200 }}'
then:
- alias: Set variables
variables:
current_month: '{{ meter_response["content"][0] }}'
previous_month: '{{ meter_response["content"][1] }}'
jan1st_year: '{{ now().year - 1 if now().month == 1 else now().year }}'
previous_jan1st: '{{ meter_response["content"] | selectattr("date", "search",
jan1st_year ~ "-01-01 00:00:00") | list | first }}'
- alias: Send message
action: notify.discord
data:
message: ''
target: secret discord_meterstanden
data:
embed:
title: 🔌 Maandelijkse meterstanden
description: '{% from "nl.jinja" import month %}
**{{ now().day }} {{ month() }}:**
- Elektriciteit laag: {{ current_month["electricity_low"] }} kWh
- Elektriciteit hoog: {{ current_month["electricity_high"] }} kWh
- Warmte energie: {{ current_month["heat_energy"] }} GJ
- Warmte volume: {{ current_month["heat_volume"] }} m³
**Verbruik vorige maand:**
- Elektriciteit laag: {{ (current_month["electricity_low"] | int) -
(previous_month["electricity_low"] | int) }} kWh
- Elektriciteit hoog: {{ (current_month["electricity_high"] | int) -
(previous_month["electricity_high"] | int) }} kWh
- Warmte energie: {{ (current_month["heat_energy"] | int) - (previous_month["heat_energy"]
| int) }} GJ
- Warmte volume: {{ (current_month["heat_volume"] | int) - (previous_month["heat_volume"]
| int) }} m³
**Verbruik sinds 1 januari {{ jan1st_year }}:**
- Elektriciteit laag: {{ (current_month["electricity_low"] | int) -
(previous_jan1st["electricity_low"] | int) }} kWh
- Elektriciteit hoog: {{ (current_month["electricity_high"] | int) -
(previous_jan1st["electricity_high"] | int) }} kWh
- Warmte energie: {{ (current_month["heat_energy"] | int) - (previous_jan1st["heat_energy"]
| int) }} GJ
- Warmte volume: {{ (current_month["heat_volume"] | int) - (previous_jan1st["heat_volume"]
| int) }} m³
'
- id: badkamer_light_auto
alias: Badkamerlamp automatisch aan/uit door aanwezigheid
use_blueprint:
path: golles/motion-activated_scenes.yaml
input:
day_end_time: 00:00:00
motion_entity: binary_sensor.badkamer_beweging
cool_down: 120
light_entity: light.badkamer
illuminance_entity: sensor.badkamer_sensor_licht
illuminance_below: 15
day_start_time: 08:00:00
day_scene: scene.badkamer_helder
day_scene_before_off: scene.badkamer_gedimd
night_scene: scene.badkamer_ontspannen
night_scene_before_off: scene.badkamer_nachtlampje
no_motion_wait: 15
- id: badkamer_enable_automatic_lights
alias: Badkamerlamp weer op automatisch zetten
mode: single
triggers:
- trigger: state
entity_id: light.badkamer
from: 'on'
to: 'off'
conditions:
- condition: state
entity_id: automation.badkamerlamp_automatisch_aan_uit_door_aanwezigheid
state: 'off'
actions:
- action: automation.turn_on
entity_id: automation.badkamerlamp_automatisch_aan_uit_door_aanwezigheid
- id: notification_new_version
alias: 'Notificatie: Home Assistant versie update'
mode: single
triggers:
- trigger: state
entity_id: binary_sensor.docker_hub_update_available
from: 'off'
to: 'on'
for:
minutes: 90
actions:
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_updates
data:
embed:
author:
name: Home Assistant
icon_url: https://www.home-assistant.io/images/favicon-192x192-full.png
title: Update
description: 'Versie **{{ states("sensor.docker_hub") }}** is beschikbaar
De huidige versie is {{ states("sensor.current_version") }}.
{{ state_attr("sensor.home_assistant_website", "release_notes") }}
'
- id: someone_arrives_home
alias: Voortuin - verlichting aan als het donker is en iemand thuis komt
mode: single
triggers:
- trigger: state
entity_id:
- person.sander
from: not_home
to: home
conditions:
- condition: numeric_state
entity_id: sensor.achtertuin_sensor_1_licht
below: 10
actions:
- action: scene.turn_on
data:
transition: 2
target:
entity_id: scene.voortuin_helder
- wait_for_trigger:
- trigger: state
entity_id: binary_sensor.voordeur_contact
from: 'on'
to: 'off'
timeout:
minutes: 15
continue_on_timeout: true
- delay:
seconds: 5
- action: light.turn_off
data:
entity_id: light.voortuin
transition: 2
- id: automatic_frontgarden_lights
alias: Voortuin - verlichting aan bij voordeur open
mode: restart
triggers:
- trigger: state
entity_id: binary_sensor.voordeur_contact
from: 'off'
to: 'on'
conditions:
- condition: numeric_state
entity_id: sensor.achtertuin_sensor_1_licht
below: 10
actions:
- alias: Lights on
action: scene.turn_on
data:
transition: 2
target:
entity_id: scene.voortuin_helder
- alias: Wait for the door to be closed
wait_for_trigger:
- trigger: state
entity_id: binary_sensor.voordeur_contact
from: 'on'
to: 'off'
timeout:
minutes: 5
continue_on_timeout: true
- alias: Wait a little
delay:
seconds: 30
- alias: Turn the lights off
action: light.turn_off
data:
entity_id: light.voortuin
transition: 2
- id: washing_machine_door_open_when_done
alias: Wasmachine deur open als hij klaar is
mode: single
triggers:
- trigger: state
entity_id: sensor.bosch_wawh2643nl_68a40e31630b_bsh_common_status_operationstate
from: Afgerond
to: Klaar
conditions:
- condition: state
entity_id: binary_sensor.bosch_wawh2643nl_68a40e31630b_bsh_common_status_doorstate
state: 'on'
- condition: state
entity_id: binary_sensor.balkondeur_contact
state: 'off'
- condition: state
entity_id: binary_sensor.zolderraam_contact
state: 'off'
actions:
- choose:
- conditions:
- condition: numeric_state
entity_id: fan.mechanische_ventilatie_ventilatie
attribute: percentage
below: 51
sequence:
- alias: Turn on fan to reduce humidity
action: script.mechanical_ventilation_speed_timer
data:
speed: 3
timer: 30
- choose:
- conditions:
- condition: state
entity_id: climate.zolder
state: auto
- condition: numeric_state
entity_id: climate.zolder
attribute: temperature
below: 20
sequence:
- alias: Heat the room for a period of time to reduce humidity
action: tado.set_climate_timer
data:
entity_id: climate.zolder
time_period: 02:00:00
temperature: 23
- id: notification_washing_machine
alias: 'Notificatie: Wasmachine klaar (tv)'
mode: single
triggers:
- trigger: state
entity_id: sensor.bosch_wawh2643nl_68a40e31630b_bsh_common_status_operationstate
from: Loopt
to: Afgerond
conditions:
- condition: state
entity_id: media_player.lg_c9
state: 'on'
actions:
- alias: Notify tv watchers that the washing machine is done
action: notify.lg_c9
data:
message: Wasmachine is klaar
- id: ios_action_alarm_clock_off
alias: iOS action - Wekker uit
mode: single
max_exceeded: silent
triggers:
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Wekker uit
actions:
- variables:
user_id: '{{ trigger.event.context.user_id }}'
- choose:
- conditions:
- alias: Should be triggered by Sander
condition: template
value_template: '{{ is_state_attr("person.sander", "user_id", user_id) }}'
- alias: Sander should be home
condition: state
entity_id: person.sander
state: home
sequence: []
- id: ios_action_alarm_clock_snooze
alias: iOS action - Wekker gesnoozed
mode: single
max_exceeded: silent
triggers:
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Wekker gesnoozed
actions:
- variables:
user_id: '{{ trigger.event.context.user_id }}'
- choose:
- conditions:
- alias: Temperature should be higher than a certain value.
condition: numeric_state
entity_id: sensor.knmi_temperatuur
above: -2
- alias: Should be triggered by Sander
condition: template
value_template: '{{ is_state_attr("person.sander", "user_id", user_id) }}'
- alias: Sander should be home
condition: state
entity_id: person.sander
state: home
sequence:
- choose:
- conditions:
- alias: Slaapkamer should be closed.
condition: state
entity_id: cover.slaapkamer
state: closed
sequence:
- alias: Set slaapkamer to the preference position
action: button.press
target:
entity_id: button.slaapkamer_my_position
- choose:
- conditions:
- alias: Kledingkamer should be closed.
condition: state
entity_id: cover.kledingkamer
state: closed
sequence:
- alias: Set kledingkamer to the preference position
action: button.press
target:
entity_id: button.kledingkamer_my_position
- id: zigbee2mqtt_coordinator_update_notification
alias: 'Notificatie: Zigbee2MQTT coordinator versie update'
mode: restart
max_exceeded: silent
triggers:
- alias: When there is an update
trigger: state
entity_id: update.zigbee2mqtt_coordinator
from: 'off'
to: 'on'
actions:
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_updates
data:
embed:
author:
name: Zigbee2MQTT
icon_url: https://www.zigbee2mqtt.io/logo.png
title: Coordinator update
description: 'Versie **{{ states("sensor.zigbee2mqtt_coordinator_latest_version")
}}** is beschikbaar
De huidige versie is {{ states("sensor.zigbee2mqtt_bridge_coordinator_version")
}}.
https://github.com/Koenkk/Z-Stack-firmware/releases/latest
'
- id: notification_zigbee_devices_unavailable
alias: 'Notificatie: Zigbee apparaten niet bereikbaar'
mode: single
triggers:
- trigger: numeric_state
entity_id: sensor.count_zigbee_unavailable
below: 1
variables:
color: 3066993
message: Alle Zigbee apparaten zijn weer bereikbaar
- trigger: numeric_state
entity_id: sensor.count_zigbee_unavailable
above: 0
for:
hours: 3
variables:
color: 15158332
message: "De volgende Zigbee apparaten zijn niet bereikbaar:\n{{\n state_attr(\"\
sensor.count_zigbee_unavailable\", \"unavailable\")\n | map(\"regex_replace\"\
, \"^(.*)$\", \"- \\\\1\")\n | join(\"\\n\")\n}}\n"
conditions:
- alias: Prevent all triggers after reboot
condition: template
value_template: '{{ (now() - as_datetime(states("sensor.uptime"))).total_seconds()
> 300 }}
'
actions:
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_monitoring
data:
embed:
author:
name: Zigbee2MQTT
icon_url: https://github.com/Koenkk/zigbee2mqtt/raw/master/images/logo.png
color: '{{ color | int }}
'
description: '{{ message }}
'
- id: notification_ziggo_incidents
alias: 'Notificatie: Ziggo incidenten'
triggers:
- trigger: state
entity_id: sensor.ziggo_incidents
condition:
- condition: template
value_template: "{{\n state_attr(\"sensor.ziggo_incidents\", \"announcements\"\
) not in [None, []] and\n state_attr(\"sensor.ziggo_incidents\", \"outages\"\
) not in [None, []]\n}}"
actions:
- alias: Send the notification
action: notify.discord
data:
message: ''
target: secret discord_monitoring
data:
embed:
author:
name: Ziggo
icon_url: https://cdn.cookielaw.org/logos/02f2e6bc-5994-41d3-9b96-f6ab724d56c8/018e1992-075b-7323-8b0b-39f426570b05/93e69452-69c0-4cca-a40f-90acd60ebb16/ZIGGO-logo-800x800.png
color: 16026624
title: Storingen en onderhoud
description: '{{ state_attr("sensor.ziggo_incidents", "outages") }}
{{ state_attr("sensor.ziggo_incidents", "announcements") }}
'
- id: notification_arrived_home_after_visited_parents
alias: 'Notificatie: Komt thuis na bezoeken ouders'
description: Automation wanneer Sander thuis komt nadat hij bij zijn ouders is geweest.
mode: single
triggers:
- trigger: state
entity_id: person.sander
to: home
conditions:
- '{{ states(''sensor.visisted_parents'') | int > 0 }}'
- condition: template
value_template: '{% from "automations.jinja" import last_triggered_longer_than
%} {{ last_triggered_longer_than("automation.notificatie_komt_thuis_na_bezoeken_ouders",
24 * 60 * 60) }}
'
actions:
- action: notify.sander
data:
title: Welkom thuis
message: Je bent vandaag bij ouders geweest
data:
group: zone_ouders
shortcut:
name: Home Assistant - Ouders bericht
- id: ios_action_awning_command
alias: iOS action - Zonnescherm
mode: single
max_exceeded: silent
triggers:
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Zonnescherm dicht
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Zonnescherm open
- trigger: event
event_type: ios.action_fired
event_data:
actionName: Zonnescherm helemaal open
actions:
- variables:
action_name: '{{ trigger.event.data.actionName }}'
- choose:
- conditions:
- condition: template
value_template: '{{ action_name == "Zonnescherm dicht" }}'
sequence:
- alias: Close awning
action: cover.close_cover
target:
entity_id: cover.zonnescherm
- conditions:
- condition: template
value_template: '{{ action_name == "Zonnescherm open" }}'
sequence:
- alias: Open awning
action: button.press
target:
entity_id: button.zonnescherm_my_position
- conditions:
- condition: template
value_template: '{{ action_name == "Zonnescherm helemaal open" }}'
sequence:
- alias: My position for awning
action: cover.open_cover
target:
entity_id: cover.zonnescherm
- id: auto_close_awning
alias: Zonnescherm automatisch sluiten
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: sensor.zon_positie
from: Achter
to: Voor
- trigger: state
entity_id: sun.sun
to: below_horizon
- trigger: numeric_state
entity_id: sun.sun
attribute: elevation
below: 7
conditions:
- condition: state
entity_id: binary_sensor.zonnescherm_contact_contact
state: 'on'
actions:
- alias: Close the awning
action: cover.close_cover
target:
entity_id: cover.zonnescherm
- id: ios_action_awning_can_be_opened
alias: iOS action - Zonnescherm kan open
mode: single
max_exceeded: silent
triggers:
- trigger: numeric_state
entity_id: sensor.achtertuin_sensor_1_licht
above: 3800
- trigger: state
entity_id: sensor.zon_positie
from: Voor
to: Achter
conditions:
- condition: numeric_state
entity_id: sensor.achtertuin_sensor_1_licht
above: 3800
- condition: state
entity_id: sensor.zon_positie
state: Achter
- condition: numeric_state
entity_id: sensor.knmi_max_temperatuur_vandaag
above: 19
- condition: numeric_state
entity_id: sensor.knmi_neerslag_vandaag
below: 10
- condition: state
entity_id: binary_sensor.zonnescherm_contact_contact
state: 'off'
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
actions:
- alias: Set up variables for the actions
variables:
action_open: '{{ ''OPEN_'' ~ context.id }}'
- alias: Ask to close the awning
action: notify.all_phones
data:
message: De zon is achter, wil je het zonnescherm openen?
data:
tag: sun
actions:
- action: '{{ action_open }}'
title: Ja, open
- alias: Wait for a response
wait_for_trigger:
- trigger: event
event_type: mobile_app_notification_action
event_data:
action: '{{ action_open }}'
- alias: Perform the action
choose:
- conditions: '{{ wait.trigger.event.data.action == action_open }}'
sequence:
- action: button.press
target:
entity_id: button.zonnescherm_my_position
- alias: Clear this notification on all devices
action: notify.all_phones
data:
message: clear_notification
data:
tag: sun