AutomationDataset/hmmbob/hmmbob_automations.yaml

3674 lines
108 KiB
YAML

- id: airco_kinderen_start_on_timer_start
alias: Start de airco van de kinderen als de timer start
description: Turn on the AC when the timer starts
triggers:
- trigger: event
event_type: timer.started
event_data:
entity_id: timer.airco_mini_sleeptimer
variables:
airco: climate.airco_slaapkamer_t
temp_sensor: sensor.xiaomi_temperature_humidity_sensor_3_temperature
- trigger: event
event_type: timer.started
event_data:
entity_id: timer.airco_puber_sleeptimer
variables:
airco: climate.airco_slaapkamer_m
temp_sensor: sensor.xiaomi_temperature_humidity_sensor_4_temperature
actions:
- action: climate.set_hvac_mode
target:
entity_id: '{{airco}}'
data:
hvac_mode: '{{ ''heat'' if (states(temp_sensor) | float(0)) < 21 else ''cool''
}}'
- id: airco_sleeptimer_kinderen
alias: Sleeptimer voor de aircos van de kinderen
description: Turn off AC at the end of the timer
triggers:
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.airco_mini_sleeptimer
variables:
entity: climate.airco_slaapkamer_t
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.airco_puber_sleeptimer
variables:
entity: climate.airco_slaapkamer_m
actions:
- action: climate.set_hvac_mode
target:
entity_id: '{{entity}}'
data:
hvac_mode: 'off'
- id: airco_automatisch_uit
alias: Zet airco automatisch uit einde avond
description: Turn off ACs automatically so we won't forget
triggers:
- trigger: time
at: '23:00:00'
variables:
target: airco_children
- trigger: time
at: input_datetime.time_turn_off_airco
variables:
target: climate.airco_woonkamer
actions:
- choose:
- conditions: '{{ target == ''airco_children'' }}'
sequence:
- if:
- '{{ states(''timer.airco_mini_sleeptimer'') != ''active'' }}'
then:
- action: climate.set_hvac_mode
target:
entity_id: climate.airco_slaapkamer_t
data:
hvac_mode: 'off'
- if:
- '{{ states(''timer.airco_puber_sleeptimer'') != ''active'' }}'
then:
- action: climate.set_hvac_mode
target:
entity_id: climate.airco_slaapkamer_m
data:
hvac_mode: 'off'
- conditions: '{{ target == ''climate.airco_woonkamer'' }}'
sequence:
- action: climate.set_hvac_mode
target:
entity_id: '{{target}}'
data:
hvac_mode: 'off'
- id: turn_off_when_away
alias: Zet de airco en verwarming uit als we weg zijn
description: 'Climate: Turn off heating when away'
triggers:
- trigger: state
entity_id: zone.home
to: '0'
for:
minutes: 30
actions:
- alias: Turn off Tado devices that are on (and leave others in current state)
action: climate.set_hvac_mode
data:
hvac_mode: auto
target:
entity_id: '{{ integration_entities(''tado'') | select(''is_state'', ''heat'')
| list }}'
- alias: Turn off A/Cs
action: climate.set_hvac_mode
data:
hvac_mode: 'off'
target:
entity_id:
- climate.airco_master_bedroom
- climate.airco_slaapkamer_m
- climate.airco_slaapkamer_t
- climate.airco_woonkamer
- id: airco_kinderen_limit_setpoint
alias: Zet airco kinderen automatisch op een normale temperatuur
description: Set the kid's AC automatically to a more normal temperature (to prevent
user error and save energy)
triggers:
- trigger: state
entity_id:
- climate.airco_slaapkamer_m
- climate.airco_slaapkamer_t
attribute: temperature
variables:
current_mode: '{{ states(trigger.entity_id) }}'
set_temp: '{{ state_attr(trigger.entity_id, ''temperature'') | float(0) }}'
condition: []
actions:
- choose:
- conditions: '{{ current_mode in [''cool'', ''dry''] and set_temp < 20 }}'
sequence:
- action: climate.set_temperature
target:
entity_id: '{{ trigger.entity_id }}'
data:
temperature: 22
- conditions: '{{ current_mode == ''heat'' and set_temp > 21 }}'
sequence:
- action: climate.set_temperature
target:
entity_id: '{{ trigger.entity_id }}'
data:
temperature: 19.5
- id: weerhuisje_update_air_quality_sensors
alias: Stuur Air Quality sensors van het weerhuisje door
mode: queued
triggers:
- trigger: time_pattern
minutes: /1
conditions:
not:
- '{{ states(''sensor.weerhuisje_particulate_matter_2_5_m_concentration'') in
[''unknown'',''unavailable''] }}'
- '{{ states(''sensor.weerhuisje_particulate_matter_10_0_m_concentration'') in
[''unknown'',''unavailable''] }}'
- '{{ states(''sensor.weerhuisje_temperature'') in [''unknown'',''unavailable'']
}}'
- '{{ states(''sensor.weerhuisje_humidity'') in [''unknown'',''unavailable'']
}}'
- '{{ states(''sensor.weerhuisje_pressure'') in [''unknown'',''unavailable'']
}}'
actions:
- alias: Send TPH to Luftdaten / Sensor.Community API
action: rest_command.send_luftdaten_tph
continue_on_error: true
- alias: Send data to OpenSenseMap
action: rest_command.post_opensensebox
continue_on_error: true
- alias: Send updates to Madavi.de for statistics.
action: rest_command.send_madavi
continue_on_error: true
- alias: Send PM to Luftdaten / Sensor.Community API
action: rest_command.send_luftdaten_pm
continue_on_error: true
- id: awtrix_turn_on_or_off
alias: Zet Awtrix aan of uit 🌛
description: Turn off the Awtrix screen at 20:30 and turn it back on at 08:00
triggers:
- alias: Ga sowieso uit om 20u30
trigger: time
at: '20:30:00'
id: turn_off
- alias: Ga weer aan om 8u
trigger: time
at: 08:00:00
id: turn_on
condition: []
actions:
- action: homeassistant.{{trigger.id}}
data:
entity_id:
- light.awtrix_6caff8_matrix
- id: awtrix_switch_between_clock_and_apps
alias: Schakel Awtrix tussen de klok en de apps
description: Set Awtrix to clock only by pressing the middle button or when I turn
off my monitor
mode: queued
triggers:
- trigger: state
entity_id: binary_sensor.awtrix_6caff8_button_select
to: 'on'
id: toggle
- trigger: numeric_state
entity_id: sensor.bureau_kantoor_power
above: 25
id: turn_on
- trigger: numeric_state
entity_id: sensor.bureau_kantoor_power
below: 25
for: 00:05:00
id: turn_off
condition: []
actions:
choose:
- alias: Do we need to turn on Awtrix?
conditions:
- '{{ trigger.id == ''turn_on'' }}'
sequence:
- alias: Start transition and set time color to white again
action: mqtt.publish
data:
topic: awtrix_6caff8/settings
payload: '{ "WD": true, "TMODE":"1", "TIME_COL": [255,255,255], "ABRI":
true, "ATRANS": true }'
- alias: Do we need to turn off Awtrix?
conditions:
- '{{ trigger.id == ''turn_off'' }}'
sequence:
- alias: Swith to time
action: mqtt.publish
data:
topic: awtrix_6caff8/switch
payload: '{"name":"Time"}'
- alias: Set low brightness and red color and fix to time app
action: mqtt.publish
data:
topic: awtrix_6caff8/settings
payload: '{ "WD": false, "TMODE":"0", "TIME_COL": [255,0,0], "BRI": 1, "ABRI":
false, "ATRANS": false }'
- alias: Do we need to toggle Awtrix?
conditions:
- '{{ trigger.id == ''toggle'' }}'
sequence:
- if:
- alias: 'Transition is on, so we are in day mode: toggle to night mode'
condition: state
entity_id: switch.awtrix_6caff8_transition
state: 'on'
then:
- alias: Swith to time
action: mqtt.publish
data:
topic: awtrix_6caff8/switch
payload: '{"name":"Time"}'
- alias: Set low brightness and red color and fix to time app
action: mqtt.publish
data:
topic: awtrix_6caff8/settings
payload: '{ "WD": false, "TMODE":"0", "TIME_COL": [255,0,0], "BRI": 1,
"ABRI": false, "ATRANS": false }'
else:
- alias: Start transition and set time color to white again
action: mqtt.publish
data:
topic: awtrix_6caff8/settings
payload: '{ "WD": true, "TMODE":"1", "TIME_COL": [255,255,255], "ABRI":
true, "ATRANS": true }'
- id: awtrix_start_custom_apps_on_reboot
alias: Start alle Awtrix apps na een reboot
description: Start custom apps on Awtrix reboot
mode: single
triggers:
- trigger: state
entity_id: switch.awtrix_6caff8_transition
from: 'off'
to: 'on'
condition: []
actions:
- action: automation.trigger
target:
entity_id:
- automation.awtrix_send_outside_temperature_to_awtrix
- delay: 5
- action: automation.trigger
target:
entity_id:
- automation.awtrix_solar_energy_monitor
- delay: 5
- action: automation.trigger
target:
entity_id:
- automation.awtrix_send_today_s_energy_production_to_awtrix
- delay: 5
- action: automation.trigger
target:
entity_id:
- automation.awtrix_send_ev_battery_level
- id: awtrix_temperature
alias: Stuur de buitentemperatuur naar Awtrix
description: Send outside temperature to Awtrix
mode: queued
triggers:
- trigger: state
entity_id: sensor.knmi_temperatuur
condition: []
actions:
- action: mqtt.publish
data:
topic: awtrix_6caff8/custom/outside_temp
payload: ' { "text": "{{ states(''sensor.knmi_temperatuur'') }}°C", "icon":
"56840", "color": "#f21f1f", "duration": 7 } '
- id: awtrix_production
alias: Stuur vandaags productie van de zonnepanelen naar Awtrix
description: 'Awtrix: Send today''s energy production to Awtrix'
mode: queued
triggers:
- trigger: state
entity_id: sensor.today_s_pv_generation
condition: []
actions:
- action: mqtt.publish
data:
topic: awtrix_6caff8/custom/production_today
payload: ' { "text": "{{ states(''sensor.todays_total_production_preserved'')
}} kWh", "icon": "52456", "color": "#7bf21f", "duration": 7} '
- id: awtrix_current_production
alias: Stuur de huidige opbrengst van de zonnepanelen naar Awtrix
description: This will show the current solar energy received.
mode: queued
variables:
device_topic: awtrix_6caff8/custom/current_production
power_sensor: sensor.pv_power
power_level: '{{ states[power_sensor].state | int(0) | abs }}'
threshold_low: 1500
threshold_high: 2500
power_level_icon: '{%- if power_level > threshold_high %}{{54156}}{%- endif %}
{%- if (power_level <= threshold_high) and (power_level > threshold_low) %}{{50557}}{%-
endif %} {%- if power_level <= threshold_low %}{{50546}}{%- endif %}'
power_level_color: '{%- if power_level > threshold_high %}{{"#04FE04"}}{%- endif
%} {%- if (power_level <= threshold_high) and (power_level > threshold_low)
%}{{"#FCFEFC"}}{%- endif %} {%- if power_level <= threshold_low %}{{"#FF4E1A"}}{%-
endif %}'
power_level_text: '{%- if power_level > 1000 %}{{ ((power_level | float(default=0))
/ 1000) | round(1)}} kW{%- else %}{{power_level | round(0)}} W{%- endif %}'
skip_if_zero_watts: true
skip_during_night_hours: true
payload: '{"icon":"{{ power_level_icon }}", "text": "{{ power_level_text }}", "color":
"{{ power_level_color }}"}'
night_start: '{{ as_timestamp(state_attr(''sun.sun'',''next_setting''))| timestamp_custom("%H:%M:%S")}}'
night_end: '{{ as_timestamp(state_attr(''sun.sun'',''next_rising''))| timestamp_custom("%H:%M:%S")}}'
triggers:
- trigger: time_pattern
minutes: /5
condition: []
actions:
- choose:
- alias: Skipping if it is night time
conditions:
- condition: template
value_template: '{% set now_time = now().strftime("%H:%M") %} {% set night_start
= night_start %} {% set night_end = night_end %} {{ (skip_during_night_hours
and ((now_time < night_end) or (now_time > night_start))) or (skip_if_zero_watts
and (power_level == 0)) }}
'
sequence:
- action: mqtt.publish
data:
topic: '{{ device_topic }}'
payload: '{}'
- alias: Not skipping when it is day time
conditions:
- condition: template
value_template: '{% set now_time = now().strftime("%H:%M") %} {% set night_start
= night_start %} {% set night_end = night_end %} {{ not((skip_during_night_hours
and ((now_time < night_end) or (now_time > night_start))) or (skip_if_zero_watts
and (power_level == 0))) }}
'
sequence:
- action: mqtt.publish
data:
topic: '{{ device_topic }}'
payload: '{{ payload }}
'
- id: awtrix_ev_battery
alias: Stuur het batterijniveau van de auto naar Awtrix
description: 'Awtrix: Send the battery level of my EV to Awtrix'
mode: queued
variables:
threshold_low: 30
threshold_high: 60
power_level: '{{ states(''sensor.tucson_ev_battery_level'') | int(default=0) }}'
power_level_color: '{%- if power_level > threshold_high %}{{"#04FE04"}}{%- endif
%} {%- if (power_level <= threshold_high) and (power_level > threshold_low)
%}{{"#FCFEFC"}}{%- endif %} {%- if power_level <= threshold_low %}{{"#FF4E1A"}}{%-
endif %}'
triggers:
- trigger: state
entity_id: sensor.tucson_ev_battery_level
condition: []
actions:
- action: mqtt.publish
data:
topic: awtrix_6caff8/custom/ev_battery
payload: ' { "text": "{{ states(''sensor.tucson_ev_battery_level'') }} %", "icon":
"2817", "color": "{{ power_level_color }}", "duration": 7} '
- id: battery_low_check
alias: Wekelijkse check voor lege batterijen
description: Check whether a battery is low
mode: single
triggers:
- trigger: time
at: '12:00:00'
weekday:
- sat
action:
- service: battery_notes.check_battery_low
- id: battery_low_notification
alias: Bericht over lege batterijen
description: Battery Low Notification with auto dismiss
mode: queued
variables:
title: '{{ trigger.event.data.device_name }}'
message: "\U0001FAAB {{ trigger.event.data.device_name }} {%- if trigger.event.data.battery_level\
\ is defined -%}\n heeft een batterijniveau van {{trigger.event.data.battery_level}}%.\n\
{%- else -%}\n is leeg.\n{%- endif %} Je hebt {{trigger.event.data.battery_quantity\
\ }}x {{trigger.event.data.battery_type }} nodig om de batterij te vervangen."
id: '{{ trigger.event.data.device_id }}'
navigate: /config/devices/device/{{id}}
triggers:
- trigger: event
event_type: battery_notes_battery_threshold
event_data:
battery_low: true
id: low
alias: Battery went low
- trigger: event
event_type: battery_notes_battery_threshold
event_data:
battery_low: false
id: high
alias: Battery went high
actions:
- choose:
- conditions:
- condition: trigger
id: low
sequence:
- action: notify.mobile_app_sm_a556b
data:
title: '{{title}}'
message: '{{message}}'
data:
notification_icon: mdi:battery-alert-variant
clickAction: '{{navigate}}'
tag: '{{id}}'
- action: persistent_notification.create
data:
title: '{{title}}'
notification_id: '{{id}}'
message: '{{message}} {{ ''
'' -}} [Link naar apparaat pagina]({{navigate}})'
- conditions:
- condition: trigger
id: high
sequence:
- action: notify.mobile_app_sm_a556b
data:
message: clear_notification
data:
tag: '{{id}}'
- action: persistent_notification.dismiss
data:
notification_id: '{{id}}'
- id: battery_replaced
alias: Batterijen vervangen
mode: queued
triggers:
- trigger: event
event_type: battery_notes_battery_increased
actions:
- action: battery_notes.set_battery_replaced
data:
device_id: '{{ trigger.event.data.device_id }}'
source_entity_id: '{{ trigger.event.data.source_entity_id }}'
- action: persistent_notification.create
data:
title: '{{ trigger.event.data.device_name }} Battery Increased
'
message: 'The device has increased its battery level, I''ve marked it as replaced
'
- alias: Verwijder fietsenhok alert
id: clear_bikeshed_door_alert
trigger:
- platform: state
entity_id: alert.bikeshed_door
from: 'on'
to:
- idle
- 'off'
action:
- service: notify.mobile_devices_adults
data:
message: clear_notification
data:
tag: bikeshed_door_alert
- alias: Verwerk actie om alert uit te zetten
id: mute_door_alerts
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: mute_alert_bikeshed
action:
- service: alert.turn_off
target:
entity_id: alert.bikeshed_door
- id: schuur_fietslader
alias: Fietsaccu lader in de schuur uitschakelen na laden
description: Fietsaccu lader in de schuur uitschakelen na laden
mode: single
triggers:
- trigger: numeric_state
entity_id: sensor.fietslader_links_power
for:
minutes: 5
below: 5
variables:
switch: switch.fietslader_links
- trigger: numeric_state
entity_id: sensor.fietslader_rechts_power
for:
minutes: 5
below: 5
variables:
switch: switch.fietslader_rechts
conditions:
- alias: Please, not on restarts
condition: template
value_template: '{{ trigger.from_state.state | is_number }}'
actions:
- alias: Lader uitschakelen
action: switch.turn_off
target:
entity_id: '{{ switch }}'
- alias: Sending push notification
action: notify.mobile_app_sm_a556b
data:
title: Fietslader uitgeschakeld
message: De {{ state_attr(switch, 'friendly_name') }} is automatisch uitgeschakeld
({{ now().strftime('%H:%M') }})
data:
notification_icon: mdi:bicycle-electric
ttl: 0
priority: high
clickAction: /lovelace/other
- id: deurbel_met_ai_beschrijving
alias: Deurbel met AI beschrijving
description: Stuur een notificatie met beschrijving als iemand aanbelt
variables:
group: deurbel_camera
tag: '{{ group + int(as_timestamp(now()))|string }}'
title: De deurbel gaat
triggers:
- trigger: state
entity_id: binary_sensor.voordeur_bezoeker
from: 'off'
to: 'on'
conditions:
- condition: state
entity_id: input_boolean.enable_deurbel
state: 'on'
actions:
- alias: Analyze event
action: llmvision.image_analyzer
response_variable: response
data:
image_entity:
- camera.voordeur_vloeiend
provider: 01JDVWVP7N8E70XMH6HMYWBCAN
model: gemini-2.0-flash
message: 'Dit is een foto van mijn voordeur camera. Help me door te beschrijven
of dit een bezorger of bezoeker is. Beschrijf de scène niet! Als de persoon
een pakje of doos vast heeft is het vrijwel zeker een bezorger. Als je denkt
dat het een bezorger is probeer dan in te schatten van welk bedrijf de bezorger
is. Als de persoon kleding met oranje accenten aan heeft is het een PostNL
bezorger. Heeft de persoon gele bovenkleding dan is het een DHL bezorger.
Heeft de persoon rode kleding aan en in plaats van een pakje of doos plastic
tassen in zijn/haar hand, dan is het een bezorger van Picnic. Misschien zie
je een bestelauto in de foto: PostNL bezorgers rijden vaak in een witte bestelbus,
terwijl DHL bezorgers vaak een gele bestelwagen rijden. Wij rijden zelf een
kleine gele personenauto, verwar die niet met een bestelbus. Weet je niet
zeker van welk bedrijf het is? Zeg dat dan. Antwoord met een korte zin in
het Nederlands.'
remember: false
include_filename: false
max_tokens: 25
temperature: 0.1
expose_images: true
- repeat:
for_each: "{{\n (expand(state_attr('zone.home', 'persons'))\n | map(attribute='attributes.source')\n\
\ | map('replace', 'device_tracker.', 'notify.mobile_app_')\n | list + ['notify.mobile_app_sm_a556b'])\n\
\ | unique | list\n}}\n"
sequence:
- alias: Update notification to notify devices
action: '{{ repeat.item }}'
data:
title: '{{ title }}'
message: '{{ response.response_text }}'
data:
image: '{{response.key_frame.replace(''/config/www/'',''/local/'') }}'
clickAction: /lovelace/camera
tag: '{{ tag }}'
group: '{{ group }}'
notification_icon: mdi:doorbell-video
priority: high
timeout: 60
ttl: 0
visibility: public
- id: deurbel_stream_to_kiosk
alias: Stream de deurbel naar de kiosks
triggers:
- trigger: state
entity_id: binary_sensor.voordeur_bezoeker
from: 'off'
to: 'on'
conditions:
- condition: state
entity_id: input_boolean.enable_deurbel
state: 'on'
actions:
- action: browser_mod.popup
data:
dismissable: true
autoclose: false
browser_id:
- kiosk1
- kiosk2
timeout: 60000
size: fullscreen
content:
type: custom:advanced-camera-card
cameras:
- camera_entity: camera.voordeur_vloeiend
- action: number.set_value
data:
value: '255'
target:
entity_id:
- number.kiosk1_schermhelderheid
- number.kiosk2_schermhelderheid
- id: deurbel_turn_off_chime
alias: Zet de deurbel boven uit na bepaalde tijd
description: Zet de deurbel boven uit na bepaalde tijd
mode: single
triggers:
- trigger: time
at: '21:00:00'
id: 'off'
- trigger: time
at: 09:00:00
id: hophop
conditions: []
actions:
- action: select.select_option
data:
option: '{{ trigger.id }}'
target:
entity_id: select.reolink_chime_boven_beltoon_bij_bezoeker
- id: ev_handle_automatic_cheapest_charge
alias: Laad de auto tijdens de goedkoopste uren
description: Automatically charge my car in the cheapest hours
mode: single
triggers:
- trigger: state
entity_id: sensor.ev_smart_charging_charging
to: 'on'
id: ev_cheapest_charge_start
- trigger: state
entity_id: sensor.ev_smart_charging_charging
to: 'off'
id: ev_cheapest_charge_stop
actions:
- alias: Choose to start or stop charging
choose:
- conditions:
- condition: trigger
id: ev_cheapest_charge_start
- not:
- condition: state
entity_id: select.smartevse_6360_mode
state: Smart
sequence:
- alias: Select SMART charging option
action: select.select_option
target:
entity_id: select.smartevse_6360_mode
data:
option: Smart
- alias: Sending push notification
action: notify.mobile_app_sm_a556b
data:
title: Automatic cheapest EV charging started
message: Automatisch laden van de auto is gestart. ({{ now().strftime('%H:%M')
}}).
data:
notification_icon: mdi:ev-station
ttl: 0
priority: high
clickAction: /lovelace/car
- conditions:
- condition: trigger
id: ev_cheapest_charge_stop
- not:
- condition: state
entity_id: select.smartevse_6360_mode
state: 'Off'
sequence:
- alias: Select charging option OFF
action: select.select_option
target:
entity_id: select.smartevse_6360_mode
data:
option: 'Off'
- alias: Sending push notification
action: notify.mobile_app_sm_a556b
data:
title: Automatic cheapest EV charging stopped
message: Automatisch laden van de auto is gestopt ({{ now().strftime('%H:%M')
}})
data:
notification_icon: mdi:ev-station
ttl: 0
priority: high
clickAction: /lovelace/car
- alias: Stel in of de auto verbonden is
id: ev_set_smart_charging_connected_sensor
description: Set Smart Charging EV connected sensor
mode: single
triggers:
- trigger: state
entity_id: sensor.smartevse_6360_evplugstate
actions:
- if:
- condition: state
entity_id: sensor.smartevse_6360_evplugstate
state: Connected
then:
- action: switch.turn_on
target:
entity_id: switch.ev_smart_charging_ev_connected
else:
- if:
- condition: state
entity_id: sensor.smartevse_6360_evplugstate
state: Disconnected
then:
- action: switch.turn_off
target:
entity_id: switch.ev_smart_charging_ev_connected
- id: ev_create_monthly_total_notification
alias: Stuur een maandelijks overzicht van de laadkosten van de auto
description: Create a monthly overview of the amount of energy charged for billing
purposes
mode: single
variables:
title: EV charging monthly total
message: 'This month you have charged your EV with a total of {{ states(''sensor.smartevse_monthly_total'')
| round(1) }} kWh. The total meter reading at {{now().strftime("%d-%m-%Y %H:%M")}}
was {{ states(''sensor.smartevse_6360_evtotalenergycharged'') | round(1) }}
kWh.
'
triggers:
- trigger: time
at: '23:59:45'
conditions:
- alias: Only on last day of the month
condition: template
value_template: '{{ (now() + timedelta(days=1)).strftime(''%-d'') == ''1'' }}'
actions:
- alias: Create a persistant notification with the monthly charged totals
action: persistent_notification.create
data:
notification_id: ev_monthly_total
title: '{{ title }}'
message: '{{ message }}'
- alias: Send an email with the monthly charged totals
action: notify.email
data:
title: '{{ title }}'
message: '{{ message }}'
- id: ev_force_update_while_charging
alias: Forceer nieuwe Hyundai informatie tijdens het laden
description: Force update the values of the Hyundai component while charging
mode: single
triggers:
- trigger: time_pattern
minutes: /15
conditions:
- alias: Only when we are actually charging
condition: state
entity_id: sensor.smartevse_6360_state
state: Charging
actions:
- action: kia_uvo.force_update
data:
device_id: 5a94e1b7fbce614053e4f5b8dfd6209b
- id: garden_turn_on
alias: Zet de tuinverlichting aan of uit
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: sensor.garden_lights
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
conditions:
- alias: Do we have a valid state
condition: template
value_template: '{{ states(''sensor.garden_lights'') not in [''unknown'',''unavailable'',''none'']
}}'
- alias: Only continue if not overridden
condition: state
entity_id: input_boolean.garden_lights_override
state: 'off'
actions:
- action: homeassistant.turn_{{ states('sensor.garden_lights') }}
target:
entity_id:
- light.verlichting_tuin
- id: garden_turn_on_tree_lights
alias: Zet de boomverlichting aan of uit
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: sensor.tree_lights
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
conditions:
- alias: Do we have a valid state
condition: template
value_template: '{{ states(''sensor.tree_lights'') not in [''unknown'',''unavailable'',''none'']
}}'
- alias: Only continue if not overridden
condition: state
entity_id: input_boolean.garden_lights_override
state: 'off'
actions:
- action: homeassistant.turn_{{ states('sensor.tree_lights') }}
target:
entity_id:
- light.tuin_spot_boom
- id: garden_turn_on_coming_home
alias: Zet de tuinverlichting aan als ik thuis kom
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: binary_sensor.poort_contact
from: 'off'
to: 'on'
conditions:
- alias: Are the lights off?
condition: state
entity_id: light.verlichting_tuin
state: 'off'
- alias: Is the sun down?
condition: state
entity_id: sun.sun
state: below_horizon
actions:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.garden_lights_override
- action: homeassistant.turn_on
target:
entity_id: light.verlichting_tuin
- delay: 00:03:00
- action: input_boolean.turn_off
target:
entity_id: input_boolean.garden_lights_override
- action: automation.trigger
target:
entity_id: automation.lights_garden_turn_on
- id: backgate_alert
alias: Waarschuw als iemand door de poort komt of het fietsenhok opent
description: Alert when someone enters the backgate of our garden or opens the bike
shed
mode: single
max_exceeded: silent
trace:
stored_traces: 20
triggers:
- trigger: state
entity_id:
- binary_sensor.poort_contact
- binary_sensor.fietsenhok_contact
from: 'off'
to: 'on'
actions:
- alias: Turn on speaker
action: switch.turn_on
target:
entity_id: switch.alarmspeaker_alarm
- alias: Do nothing for 1 minute to prevent bouncing triggers
delay: 00:01:00
- id: achtertuin_stream_to_kiosk
alias: Stream de achtertuin naar de kiosks
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id: binary_sensor.achtertuin_persoon
from: 'off'
to: 'on'
actions:
- action: browser_mod.popup
data:
dismissable: true
autoclose: true
browser_id:
- kiosk1
- kiosk2
timeout: 90000
size: fullscreen
content:
type: custom:advanced-camera-card
cameras:
- camera_entity: camera.achtertuin_vloeiend
- action: number.set_value
data:
value: '255'
target:
entity_id:
- number.kiosk1_schermhelderheid
- number.kiosk2_schermhelderheid
- alias: Do nothing for 92 seconds to prevent bouncing triggers
delay: 00:01:32
- id: notification_benzine_price_changed
alias: Verstuur melding dat de benzineprijzen gewijzigd zijn
triggers:
- trigger: state
entity_id:
- sensor.benzine
- input_number.benzineprijs_esso
not_from:
- unknown
- unavailable
- none
not_to:
- unknown
- unavailable
- none
variables:
station: '{{ ''Tinq'' if trigger.entity_id == ''sensor.benzine'' else ''Esso''
}}'
conditions:
- alias: Check if price really changed
condition: template
value_template: '{{ trigger.to_state.state = trigger.from_state.state }}'
- condition: state
entity_id: input_boolean.vacation_mode_away
state: 'off'
actions:
- action: notify.mobile_app_sm_a556b
data:
title: '{{ iif(trigger.to_state.state < trigger.from_state.state, "Benzine wordt
goedkoper", "Benzine wordt duurder") }}'
message: '⛽ De {{ station }} benzineprijs is {{ iif(trigger.to_state.state <
trigger.from_state.state, "gezakt.", "gestegen.") }} Nieuwe prijs: {{ trigger.to_state.state
}}. Oude prijs: {{ trigger.from_state.state }}.'
data:
tag: benzine
channel: benzine
notification_icon: mdi:gas-station
- id: update_benzineprijs
alias: Werk de Esso benzine prijs bij
triggers:
trigger: time
at:
- 06:45:00
- '18:45:00'
conditions: []
actions:
- delay: '{{ range(30*60) | random }}'
alias: Random delay between now and 30mins
- action: downloader.download_file
data:
overwrite: true
url: secret scrape_url_esso
filename: esso.png
- action: llmvision.data_analyzer
data:
provider: 01JDVWVP7N8E70XMH6HMYWBCAN
message: Wat kost Euro95 bij dit tankstation? Geef me alleen de prijs, zonder
het euroteken en verdere tekst - echt alleen de prijs. Gebruik een . als decimaalteken.
image_file: /config/downloads/esso.png
sensor_entity: input_number.benzineprijs_esso
include_filename: true
max_tokens: 1000
response_variable: response
- id: set_google_home_volume
alias: Stel de Google Home volumes in
description: 'Volume: Set Google Home Volume'
triggers:
- trigger: time
id: time
at:
- 07:00:00
- 09:00:00
- '19:30:00'
- '20:30:00'
- trigger: homeassistant
event: start
id: ha_start
actions:
- alias: Check if this is triggered by HA restart
if:
condition: trigger
id: ha_start
then:
- delay:
minutes: 1
- alias: Checking what time it is...
choose:
- alias: It's between 7hrs and 09:00
conditions:
- condition: time
after: 06:59:59
before: 09:00:00
sequence:
- action: media_player.volume_set
data:
entity_id:
- media_player.kiosk1_fkb
- media_player.nest_hub_woonkamer
volume_level: 0.7
- alias: It's between 09:00 and 19hrs
conditions:
- condition: time
after: 08:59:59
before: '19:00:00'
sequence:
- action: media_player.volume_set
data:
entity_id:
- media_player.slaapkamer_t
- media_player.zolder
volume_level: 0.6
- action: media_player.volume_set
data:
entity_id: media_player.kantoor
volume_level: 0.2
- alias: It's between 19hrs and 20:30
conditions:
- condition: time
after: '18:59:59'
before: '20:30:00'
sequence:
- action: media_player.volume_set
data:
entity_id:
- media_player.kiosk1_fkb
- media_player.nest_hub_woonkamer
volume_level: 0.6
- action: media_player.volume_set
data:
entity_id:
- media_player.slaapkamer_t
- media_player.zolder
volume_level: 0.2
- alias: It's between 20:30 and 7hrs
conditions:
- condition: time
after: '20:29:59'
before: 07:00:00
sequence:
- action: media_player.volume_set
data:
entity_id:
- media_player.kiosk1_fkb
- media_player.nest_hub_woonkamer
volume_level: 0.4
- action: media_player.volume_set
data:
entity_id: media_player.kantoor
volume_level: 0.1
- id: notification_kid_left_location
alias: Verstuur een melding dat een kind van een locatie vertrekt
mode: parallel
triggers:
- trigger: zone
entity_id: device_tracker.sm_a236b
event: leave
zone: zone.school
variables:
name: '{{states(''input_text.naam_mini'')}}'
location: school
- trigger: zone
entity_id: device_tracker.sm_a236b
event: leave
zone: zone.mc
variables:
name: '{{states(''input_text.naam_mini'')}}'
location: MC
- trigger: zone
entity_id: device_tracker.sm_a236b
event: leave
zone: zone.scouting
variables:
name: '{{states(''input_text.naam_mini'')}}'
location: scouting
- trigger: zone
entity_id: device_tracker.schaduwspeler
event: leave
zone: zone.school
variables:
name: '{{states(''input_text.naam_puber'')}}'
location: school
- trigger: zone
entity_id: device_tracker.schaduwspeler
event: leave
zone: zone.scouting
variables:
name: '{{states(''input_text.naam_puber'')}}'
location: scouting
actions:
- choose:
- conditions:
- or:
- and:
- '{{ location == "school" }}'
- not:
- condition: time
after: '12:00:00'
before: '17:30:00'
weekday:
- mon
- tue
- wed
- thu
- fri
- and:
- '{{ location == "scouting" }}'
- not:
- or:
- condition: time
after: '12:00:00'
before: '14:00:00'
weekday:
- sat
- condition: time
after: '21:00:00'
before: '22:00:00'
weekday:
- mon
sequence:
- stop: Likely false positive, stopping sequence
default:
- action: notify.mobile_devices_adults
data:
title: ♥ {{ name }} is op weg naar huis!
message: '{{ name }} is rond {{now().strftime("%H:%M")}} van {{ location }}
vertrokken.
'
data:
clickAction: /lovelace-map/map
ttl: 0
priority: high
notification_icon: mdi:map-marker-radius
- id: notification_kids_battery_low_parents
alias: Verstuur een melding dat batterij van kind bijna leeg is
mode: parallel
triggers:
- trigger: numeric_state
entity_id: sensor.sm_a236b_battery_level
below: 15
variables:
name: '{{states(''input_text.naam_mini'')}}'
- trigger: numeric_state
entity_id: sensor.schaduwspeler_batterijniveau
below: 15
variables:
name: '{{states(''input_text.naam_puber'')}}'
variables:
target: '{% if trigger.entity_id == "sensor.schaduwspeler_batterijniveau" %}notify.mobile_app_schaduwspeler
{% elif trigger.entity_id == "sensor.sm_a236b_battery_level" %}notify.mobile_app_sm_a236b
{% else %}notify.bogus {% endif %}
'
conditions:
or:
- and:
- '{{ trigger.entity_id == ''sensor.schaduwspeler_batterijniveau'' }}'
- '{{ not is_state(''device_tracker.schaduwspeler'', ''home'') }}'
- and:
- '{{ trigger.entity_id == ''sensor.sm_a236b_battery_level'' }}'
- '{{ not is_state(''device_tracker.sm_a236b'', ''home'') }}'
actions:
- action: notify.mobile_devices_adults
data:
title: 🔋 Batterijwaarschuwing
message: 'De telefoon van {{ name }} is bijna leeg. Updates van zijn locatie
zullen snel stoppen.
'
data:
ttl: 0
priority: high
notification_icon: mdi:battery-alert-variant
- action: '{{ target }}'
data:
message: command_high_accuracy_mode
data:
command: turn_off
priority: high
ttl: 0
- action: '{{ target }}'
data:
title: 🔋 Batterijwaarschuwing
message: 'Je moet je telefoon even opladen....
'
data:
ttl: 0
priority: high
notification_icon: mdi:battery-alert-variant
- alias: Schakel high accuracy mode in of uit
id: kids_turn_gps_on_or_off
mode: queued
triggers:
- trigger: state
entity_id:
- device_tracker.schaduwspeler
- device_tracker.sm_a236b
to:
- not_home
id: leave
- trigger: state
entity_id:
- device_tracker.schaduwspeler
- device_tracker.sm_a236b
not_to:
- not_home
- unavailable
id: enter
variables:
target: '{% if trigger.entity_id == "device_tracker.schaduwspeler" %}notify.mobile_app_schaduwspeler
{% elif trigger.entity_id == "device_tracker.sm_a236b" %}notify.mobile_app_sm_a236b
{% else %}notify.bogus {% endif %}
'
actions:
- action: '{{ target }}'
data:
message: command_high_accuracy_mode
data:
command: '{{ ''turn_on'' if trigger.id == ''leave'' else ''turn_off'' }}'
priority: high
ttl: 0
- id: kiosk_screensaver
alias: Schakel de screensaver van de kiosks in of uit
mode: parallel
triggers:
- trigger: state
entity_id: switch.kiosk1_screensaver
variables:
device: kiosk1
brightness: number.kiosk1_schermhelderheid
path: /tsv-dashboards/tsv1
- trigger: state
entity_id: switch.kiosk2_screensaver
variables:
device: kiosk2
brightness: number.kiosk2_schermhelderheid
path: /tsv-dashboards/tsv2
actions:
- choose:
- conditions: '{{ trigger.to_state.state == ''on'' }}'
sequence:
- alias: Schakel de screensaver in
action: browser_mod.navigate
data:
path: /tsv-dashboards/screensaver
browser_id:
- '{{ device }}'
- action: number.set_value
data:
value: 10
target:
entity_id: '{{ brightness }}'
- conditions: '{{ trigger.to_state.state == ''off'' }}'
sequence:
- alias: Schakel de screensaver uit
action: browser_mod.navigate
data:
path: '{{ path }}'
browser_id:
- '{{ device }}'
- action: number.set_value
data:
value: '{{255 if is_state(''sun.sun'', ''above_horizon'') else 125}}'
target:
entity_id: '{{ brightness }}'
- id: kiosk1_screen
alias: Schakel het scherm van kiosk 1 in of uit
trigger:
- alias: Schakel uit als we de lampen uitzetten
trigger: state
entity_id: light.verlichting_woonkamer
to: 'off'
id: turn_off
- alias: Ga sowieso uit om 23:00
trigger: time
at: '23:00:00'
id: turn_off
- alias: Ga weer aan om 06:30
trigger: time
at: 06:30:00
id: turn_on
actions:
- alias: Checking what to do
choose:
- alias: Do we need to turn off the screen for the night?
conditions:
- '{{ trigger.id == ''turn_off'' }}'
- condition: time
after: '21:00:00'
sequence:
- delay: 00:00:10
- action: homeassistant.turn_off
data:
entity_id:
- switch.kiosk1_bewegingsdetectie
- switch.kiosk1_scherm
- alias: Do we need to turn on the screen?
conditions:
- '{{ trigger.id == ''turn_on'' }}'
sequence:
- action: homeassistant.turn_on
data:
entity_id:
- switch.kiosk1_bewegingsdetectie
- switch.kiosk1_scherm
- action: homeassistant.turn_off
data:
entity_id:
- switch.kiosk1_screensaver
- id: kiosk2_screen
alias: Schakel het scherm van kiosk 2 in of uit
trigger:
- trigger: numeric_state
entity_id: sensor.bureau_kantoor_power
above: 25
id: turn_on
- trigger: numeric_state
entity_id: sensor.bureau_kantoor_power
below: 25
for: 00:05:00
id: turn_off
actions:
- alias: Checking what to do
choose:
- alias: Do we need to turn on the screen?
conditions:
- '{{ trigger.id == ''turn_on'' }}'
sequence:
- action: homeassistant.turn_on
data:
entity_id:
- switch.kiosk2_bewegingsdetectie
- switch.kiosk2_scherm
- alias: Do we need to turn off the screen?
conditions:
- '{{ trigger.id == ''turn_off'' }}'
sequence:
- action: homeassistant.turn_off
data:
entity_id:
- switch.kiosk2_bewegingsdetectie
- switch.kiosk2_scherm
- action: homeassistant.turn_off
data:
entity_id:
- switch.kiosk2_screensaver
- id: kiosk_restart_at_9
alias: Kiosk herstart browser om 09:00 of bij HA herstart
triggers:
- trigger: time
at: 08:59:30
- trigger: homeassistant
event: start
actions:
- delay: 00:00:30
- action: script.kiosk_restart_browser
- id: lights_t_remote_control
alias: Mini's afstandsbediening
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: event.drukknop_t_action
not_from:
- unavailable
- unknown
variables:
event: '{{ trigger.to_state.attributes.event_type | default(''unknown'', true)
}}'
actions:
- choose:
- conditions: '{{ event == ''on'' }}'
sequence:
- action: scene.turn_on
target:
entity_id: scene.plafondlamp_t_kleurige_verlichting
- delay:
seconds: 2
- action: light.turn_on
target:
entity_id: light.ledstrip_bureau_mini
data:
rgb_color:
- 89
- 255
- 0
- action: light.turn_on
target:
entity_id:
- light.plafondlamp_t_1
- light.plafondlamp_t_2
- light.plafondlamp_t_3
data:
effect: colorloop
- conditions: '{{ event == ''off'' }}'
sequence:
- action: light.turn_off
target:
entity_id:
- light.plafondlamp_t
- light.ledstrip_bureau_mini
- id: lights_t_lightswitch
alias: Lichtschakelaar mini
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: event.lichtschakelaar_t_action
not_from:
- unavailable
- unknown
variables:
event: '{{ trigger.to_state.attributes.event_type | default(''unknown'', true)
}}'
actions:
- choose:
- conditions: '{{ event == ''single_left'' }}'
sequence:
- choose:
- conditions: '{{ is_state(''light.ledstrip_bed_mini'', ''on'') }}'
sequence:
- action: light.turn_off
target:
entity_id: light.ledstrip_bed_mini
- conditions: '{{ is_state(''light.ledstrip_bed_mini'', ''off'') }}'
sequence:
- action: light.turn_on
data:
color_temp_kelvin: 2500
target:
entity_id: light.ledstrip_bed_mini
- conditions: '{{ event == ''single_right'' }}'
sequence:
- choose:
- conditions: '{{ is_state(''light.plafondlamp_t'', ''on'') }}'
sequence:
- action: light.turn_off
target:
entity_id: light.plafondlamp_t
- conditions: '{{ is_state(''light.plafondlamp_t'', ''off'') }}'
sequence:
- action: scene.turn_on
target:
entity_id: scene.plafondlamp_t_wit
- conditions: '{{ event == ''single_both'' }}'
sequence: []
- conditions: '{{ event == ''double_left'' }}'
sequence:
- action: light.turn_on
data:
rgb_color:
- 0
- 255
- 30
brightness_pct: 100
target:
entity_id: light.ledstrip_bed_mini
- conditions: '{{ event == ''double_right'' }}'
sequence:
- action: scene.turn_on
target:
entity_id: scene.plafondlamp_t_kleurige_verlichting
- delay:
seconds: 2
- action: light.turn_on
target:
entity_id:
- light.plafondlamp_t_1
- light.plafondlamp_t_2
- light.plafondlamp_t_3
data:
effect: colorloop
- conditions: '{{ event == ''double_both'' }}'
sequence: []
- id: lights_gang
alias: Zet de gangverlichting aan of uit
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: binary_sensor.pir_gang
from: 'off'
to: 'on'
conditions:
- condition: state
entity_id: input_boolean.enable_pir_gang_automations
state: 'on'
- condition: numeric_state
entity_id: sun.sun
attribute: elevation
below: 5
actions:
- alias: Gang lamp aan...
action: switch.turn_on
target:
entity_id: switch.gang
- alias: Wacht tot er geen motion meer is...
wait_for_trigger:
- trigger: state
entity_id: binary_sensor.pir_gang
from: 'on'
to: 'off'
- alias: Lamp uit..
action: switch.turn_off
target:
entity_id: switch.gang
- id: set_lights_before_sunset
alias: Zet de verlichting aan bij zonsondergang
triggers:
trigger: sun
event: sunset
offset: -00:45:00
conditions:
and:
- condition: state
entity_id: input_boolean.enable_woonkamer_sunset_automations
state: 'on'
- condition: state
entity_id: group.all_adults
state: home
actions:
- action: light.turn_on
data:
brightness_pct: 20
target:
entity_id: light.spots_vaas
- id: salon_remote_control
alias: Schakelaar salon
description: 'Control some lights with an Aqara H1 double wireless remote switch
(WRS-R02 / WXKG15LM)
'
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: event.schakelaar_salon_action
not_from:
- unavailable
- unknown
variables:
event: '{{ trigger.to_state.attributes.event_type | default(''unknown'', true)
}}'
actions:
- choose:
- conditions: '{{ event == ''single_left'' }}'
sequence:
- action: light.toggle
target:
entity_id: light.sfeerverlichting_salon
- conditions: '{{ event == ''single_right'' }}'
sequence:
- action: light.toggle
target:
entity_id:
- light.tv_kastje
- conditions: '{{ event == ''single_both'' }}'
sequence: []
- conditions: '{{ event == ''double_left'' }}'
sequence:
- action: light.turn_on
target:
entity_id: light.salon
data:
brightness_pct: 100
- conditions: '{{ event == ''double_right'' }}'
sequence:
- action: light.turn_on
target:
entity_id: light.salon
data:
brightness_pct: 25
- conditions: '{{ event == ''double_both'' }}'
sequence: []
- conditions: '{{ event == ''triple_left'' }}'
sequence: []
- conditions: '{{ event == ''triple_right'' }}'
sequence: []
- conditions: '{{ event == ''triple_both'' }}'
sequence: []
- conditions: '{{ event == ''hold_left'' }}'
sequence: []
- conditions: '{{ event == ''hold_right'' }}'
sequence: []
- conditions: '{{ event == ''hold_both'' }}'
sequence: []
- id: lights_frontdoor
alias: Zet de voordeurlamp aan of uit
triggers:
- trigger: sun
event: sunset
offset: -00:10:00
variables:
action: turn_on
- trigger: sun
event: sunrise
variables:
action: turn_off
actions:
- action: switch.{{ action }}
target:
entity_id: switch.voordeur
- id: lights_mbr_inloopkast
alias: Zet de verlichting van de inloopkast op de MBR aan of uit
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: binary_sensor.pir_inloopkast_occupancy
to: 'on'
from: 'off'
variables:
action: turn_on
- trigger: state
entity_id: binary_sensor.pir_inloopkast_occupancy
to: 'off'
from: 'on'
variables:
action: turn_off
conditions:
- condition: state
entity_id: input_boolean.enable_pir_inloopkast_automations
state: 'on'
actions:
- alias: Inloopkast lamp bedienen...
action: switch.{{ action }}
target:
entity_id: switch.inloopkast
- id: warn_power_usage_after_bedtime_minicave
alias: Waarschuwing dat de minicave nog stroom verbruikt
mode: queued
triggers:
- trigger: numeric_state
entity_id: sensor.mini_cave_power
above: 80
id: PC
- trigger: state
entity_id: binary_sensor.minicave_tv
to: 'on'
id: TV
conditions:
- condition: state
entity_id: input_boolean.notify_power_use_minicave
state: 'on'
- condition: time
after: input_datetime.time_poweruse_minicave
actions:
- action: notify.mobile_devices_adults
data:
title: Minicave {{ trigger.id }}
message: "{% if trigger.id == \"PC\" %}\n De computer van de mini staat nog\
\ aan... ({{ now().strftime('%H:%M') }}).\n{% else %}\n De TV van de mini\
\ staat nog aan... ({{ now().strftime('%H:%M') }}).\n{% endif %}"
data:
tag: minicave
notification_icon: mdi:home-lightning-bolt
ttl: 0
priority: high
- id: warn_pc_time_over_minicave
alias: Waarschuwing dat de mini te lang op de PC zit
mode: queued
triggers:
- trigger: numeric_state
entity_id: sensor.minicave_pc_on_today
above: input_number.mini_pc_time_weekday
id: weekday
- trigger: numeric_state
entity_id: sensor.minicave_pc_on_today
above: input_number.mini_pc_time_weekend
id: weekend
- trigger: time
at: input_datetime.time_maxi_gametime_over
id: all_days
conditions:
- or:
- and:
- '{{ trigger.id == "weekday" }}'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- and:
- '{{ trigger.id == "weekend" }}'
- condition: time
weekday:
- sat
- sun
- and:
- '{{ trigger.id == "all_days" }}'
- condition: state
entity_id: binary_sensor.minicave_pc
state: 'on'
actions:
- parallel:
- sequence:
- action: light.turn_on
target:
entity_id:
- light.ledstrip_bureau_mini
- light.plafondlamp_t
data:
color_name: red
- delay:
seconds: 2
- repeat:
count: 10
sequence:
- action: light.toggle
data: {}
target:
entity_id:
- light.ledstrip_bureau_mini
- light.plafondlamp_t
- delay:
seconds: 1
milliseconds: 500
- action: tts.microsoft_say
data:
entity_id: media_player.slaapkamer_t
message: Je tijd is op. Sluit je af?
- action: notify.mobile_app_sm_a236b
data:
title: Tijd is om
message: Je tijd is op. Sluit je af?
data:
tag: mini_pc
notification_icon: mdi:desktop-classic
priority: high
ttl: 0
- action: notify.mobile_devices_adults
data:
title: Mini's gametijd
message: De Mini heeft nu lang genoeg achter de PC gezeten ({{ now().strftime('%H:%M')
}}).
data:
tag: mini_pc
notification_icon: mdi:desktop-classic
priority: high
ttl: 0
- id: morning_briefing
alias: Verstuur ochtendbriefing
description: 'Notifications: Morning briefing'
triggers:
trigger: time
at: input_datetime.time_morning_briefing
conditions:
- condition: state
entity_id: input_boolean.vacation_mode_away
state: 'off'
actions:
- action: notify.mobile_devices_papa_and_mini
data:
title: Good morning sunshine!
message: Vandaag komt de zon op om {{ as_timestamp(state_attr('sun.sun', 'next_rising')) |
timestamp_custom("%H:%M") }} en wordt het {{ states('sensor.knmi_max_temperatuur_vandaag',
with_unit=True)}}. Momenteel is het {{ states('sensor.knmi_temperatuur', with_unit=True)
}} en {{ states('sensor.knmi_omschrijving') | lower}}. {{ states('sensor.knmi_weersverwachting')
}}.
data:
tag: morning-brief
notification_icon: mdi:weather-sunset-up
- alias: Melding met de goedkoopste uren om de vaatwasser te gebruiken
id: vaatwasser_melding
triggers:
- trigger: time
at: input_datetime.time_dishwasher_notification
conditions:
- alias: Do we want notifications?
condition: state
entity_id: input_boolean.notify_dishwasher
state: 'on'
- alias: Don't send when we're not at home
condition: state
entity_id: input_boolean.vacation_mode_away
state: 'off'
actions:
- alias: Sending push notification
action: notify.mobile_app_sm_a556b
data:
title: Vaatwasser
message: Het beste start je de vaatwasser om {{states('sensor.vaatwasser_goedkoopste_tijd')}}
data:
channel: notification-dishwasher
tag: notification-dishwasher
notification_icon: mdi:dishwasher
ttl: 0
importance: low
clickAction: /lovelace/energy
- id: picnic_order_window_closing
alias: 'Picnic: Order window closing'
mode: single
max_exceeded: silent
description: Send a notification when there are 2 hours left to submit the current
order
trigger:
- platform: template
value_template: "{% if states('sensor.picnic_maximale_besteltijd_voor_het_geselecteerde_tijdslot')\
\ not in ['unknown','unavailable','none'] %}\n {{ 14400 > (as_timestamp(states('sensor.picnic_maximale_besteltijd_voor_het_geselecteerde_tijdslot'))\
\ - as_timestamp(now(), 0)) > 0}}\n{% endif %}"
variables:
message: De Picnic bestelling is nog niet verzonden! Na {{ as_timestamp(states("sensor.picnic_maximale_besteltijd_voor_het_geselecteerde_tijdslot"))
| timestamp_custom("%H:%M") }} kan het niet meer.
- platform: template
value_template: "{% if states('sensor.picnic_max_order_time_of_last_order') not\
\ in ['unknown','unavailable','none'] %}\n {{ 14400 > (as_timestamp(states('sensor.picnic_max_order_time_of_last_order'))\
\ - as_timestamp(now(), 0)) > 0}}\n{% endif %}"
variables:
message: Wil je nog iets toevoegen aan je volgende Picnic bestelling? Na {{
as_timestamp(states("sensor.picnic_max_order_time_of_last_order")) | timestamp_custom("%H:%M")
}} kan het niet meer.
action:
- alias: Schakel bewegingsdetectie & eventuele screensaver uit
action: homeassistant.turn_off
data:
entity_id:
- switch.kiosk1_bewegingsdetectie
- switch.kiosk2_bewegingsdetectie
- switch.kiosk1_screensaver
- switch.kiosk2_screensaver
- alias: Schakel screensaver timeout uit
action: number.set_value
data:
value: 0
target:
entity_id:
- number.kiosk1_screensaver_timer
- number.kiosk2_screensaver_timer
- alias: Zet schermhelderheid op goed leesbaar niveau
action: number.set_value
data:
value: '{{255 if is_state(''sun.sun'', ''above_horizon'') else 125}}'
target:
entity_id:
- number.kiosk1_schermhelderheid
- number.kiosk2_schermhelderheid
- alias: Laat dashboard zien op kiosk
action: browser_mod.navigate
data:
path: /tsv-dashboards/picnic-order-closing
browser_id:
- kiosk1
- kiosk2
- action: timer.start
target:
entity_id: timer.picnic
data:
duration: 00:30:00
- id: picnic_delivery_known
alias: 'Picnic: Delivery soon'
mode: single
max_exceeded: silent
description: Send a notification when the short window of the picnic delivery is
near
trigger:
- platform: template
value_template: "{% if states('sensor.picnic_verwacht_begin_van_de_volgende_bestelling')\
\ not in ['unknown','unavailable','none'] %}\n {{ 901 > (as_timestamp(states('sensor.picnic_verwacht_begin_van_de_volgende_bestelling'),\
\ 0) - as_timestamp(now(), 0)) > 840}}\n{% endif %}"
action:
- if:
- alias: Check if push message should be sent
condition: state
entity_id: input_boolean.notify_picnic_push
state: 'on'
then:
- service: notify.mobile_devices_adults
data:
title: Picnic komt eraan!
message: 'Picnic bezorgt tussen {{ states(''sensor.picnic_next_delivery_eta_start_time'')
}} en {{ states(''sensor.picnic_next_delivery_eta_end_time'') }}!
'
data:
clickAction: app://com.picnic.android
icon_url: https://d2jxuf8ovdiw8x.cloudfront.net/uploads/sites/18/2020/11/logo.svg
notification_icon: mdi:cart
tag: picnic_alert
timeout: 1800
color: '#eb4034'
ttl: 0
priority: high
- alias: Schakel bewegingsdetectie uit
action: homeassistant.turn_off
data:
entity_id:
- switch.kiosk1_bewegingsdetectie
- switch.kiosk2_bewegingsdetectie
- switch.kiosk1_screensaver
- switch.kiosk2_screensaver
- alias: Schakel screensaver timeout uit
action: number.set_value
data:
value: 0
target:
entity_id:
- number.kiosk1_screensaver_timer
- number.kiosk2_screensaver_timer
- alias: Zet schermhelderheid op goed leesbaar niveau
action: number.set_value
data:
value: '{{255 if is_state(''sun.sun'', ''above_horizon'') else 125}}'
target:
entity_id:
- number.kiosk1_schermhelderheid
- number.kiosk2_schermhelderheid
- alias: Laat dashboard zien op kiosk
action: browser_mod.navigate
data:
path: /tsv-dashboards/picnic-eta
browser_id:
- kiosk1
- kiosk2
- action: timer.start
target:
entity_id: timer.picnic
data:
duration: 00:30:00
- id: picnic_delivery_complete
alias: 'Picnic: Delivery completed'
triggers:
- trigger: state
entity_id: sensor.picnic_status_van_de_laatste_bestelling
to: COMPLETED
from: CURRENT
actions:
- action: timer.finish
target:
entity_id: timer.picnic
- id: picnic_reset_view
alias: 'Kiosk: terug vanaf Picnic naar startscherm'
mode: queued
triggers:
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.picnic
actions:
- alias: Ga weer terug naar startscherm
action: browser_mod.navigate
data:
path: /tsv-dashboards/tsv1
browser_id:
- kiosk1
- kiosk2
- alias: Schakel bewegingsdetectie in
action: homeassistant.turn_on
data:
entity_id:
- switch.kiosk1_bewegingsdetectie
- switch.kiosk2_bewegingsdetectie
- alias: Schakel screensaver timeout in
action: number.set_value
data:
value: 120
target:
entity_id:
- number.kiosk1_screensaver_timer
- number.kiosk2_screensaver_timer
- id: picnic_update_eta
alias: 'Picnic: update ETA'
mode: single
max_exceeded: silent
description: Update Picnic sensors more frequently if delivery is near
trigger:
- platform: time_pattern
minutes: /2
condition:
- '{{ 2100 > (as_timestamp(states(''sensor.picnic_verwacht_einde_van_de_volgende_bestelling''),
0) - as_timestamp(now(), 0)) > 0}}'
action:
- service: homeassistant.update_entity
entity_id:
- sensor.picnic_verwacht_begin_van_de_volgende_bestelling
- sensor.picnic_status_van_de_laatste_bestelling
- postcodeloterij_package:
rest_command:
postcodeloterij:
url: https://www.postcodeloterij.nl/public/rest/drawresults/winnings/NPL/P_{{
'E' if extra | default(false) | bool(false) else 'M' }}T_P{{ month | default((now().replace(day=1)
- timedelta(days=1)).strftime("%Y%m")) }}/?resultSize=10
method: POST
payload: secret postcodeloterij_postcode
headers:
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
template:
- trigger:
- trigger: time
at: '18:00'
- trigger: event
event_type: update_postcodeloterij_prizes
id: manual
condition:
- condition: template
value_template: '{{ trigger.id == ''manual'' or now().day in [1,2,3] }}'
action:
- variables:
month: "{{\n trigger.event.data.month | int\n if\n trigger.platform\
\ == 'event'\n and trigger.event.data is defined\n and 'month' in\
\ trigger.event.data\n else\n (now().replace(day=1) - timedelta(days=1)).strftime(\"\
%Y%m\") | int\n}}\n"
month_formatted: '{% set months = [''januari'', ''februari'', ''maart'',
''april'', ''mei'', ''juni'', ''juli'', ''augustus'', ''september'', ''october'',
''november'', ''december''] %} {{ months[month % 100 -1] ~ '' '' ~ month
// 100 }}
'
- action: rest_command.postcodeloterij
data:
month: '{{ month }}'
response_variable: prizes
- action: rest_command.postcodeloterij
data:
extra: true
month: '{% set y = month // 100 %} {% set m = month % 100 %} {% set mapping
= {6: 13, 12: 14} %} {{ y * 100 + mapping[m] | default(m) }}
'
response_variable: prizes_extra
- variables:
prizecount: '{{ prizes.content.prizeCount }}'
prizes: "{% set ns = namespace(prizes=[]) %} {% for p in prizes.content.wonPrizes\
\ %}\n {% set ns.prizes = ns.prizes + [p.description ~ ' (€ ' ~'{:.2f}'.format(p.prizeValue\
\ / 100) ~ ')'] %}\n{% endfor %} {{ ns.prizes }}\n"
prize_text: "{% if prizecount > 0 %}\n {% set m = 'prijs' if prizecount\
\ == 1 else (prizecount ~ ' prijzen') %}\n {{ m }} in de trekking van\
\ {{ month_formatted }}: {{ prizes | join(', ') }}\n{% endif %}\n"
prizecount_extra: '{{ prizes_extra.content.prizeCount }}'
prizes_extra: "{% set ns = namespace(prizes=[]) %} {% for p in prizes_extra.content.wonPrizes\
\ %}\n {% set ns.prizes = ns.prizes + [p.description ~ ' (€ ' ~'{:.2f}'.format(p.prizeValue\
\ / 100) ~ ')'] %}\n{% endfor %} {{ ns.prizes }}\n"
prize_text_extra: "{% if prizecount_extra > 0 %}\n {% set m = 'prijs' if\
\ prizecount_extra == 1 else (prizecount_extra ~ ' prijzen') %}\n {{\
\ m }} in de extra trekking: {{ prizes_extra | join(', ') }}\n{% endif\
\ %}\n"
prizecount_total: '{{ prizecount + prizecount_extra }}'
prize_text_full: 'We hebben {{ [prize_text, prize_text_extra] | select()
| join('' en '') }}
'
- if: "{{\n prizecount_total | default(0) > 0\n and month_formatted = state_attr('sensor.postcodeloterij',\
\ 'month')\n}}\n"
then:
- alias: Send notification
action: notify.mobile_devices_adults
data:
title: 🎁 Winnen doe je bij...
message: '{{ prize_text_full }}'
data:
channel: LotteryPrize
ttl: 0
priority: high
notification_icon: mdi:gift
tag: LotteryPrize
sensor:
- name: Postcodeloterij
unique_id: 12f71395-3d76-434a-a3d0-9f01a03b834c
icon: '{{ ''mdi:gift'' if prizecount > 0 else ''mdi:emoticon-cry'' }}'
state: '{{ prizecount + prizecount_extra }}'
attributes:
prizes: '{{ prizes }}'
month: '{{ month_formatted }}'
extra: '{{ month % 100 in [6, 12] }}'
prizes_extra: '{{ prizes_extra }}'
last_updated: '{{ now().strftime(''%d-%m-%Y %H:%M'') }}'
- id: warn_pc_time_duration_pubercave
alias: Waarschuwing dat de puber te lang op de PC zit
mode: queued
triggers:
- trigger: numeric_state
entity_id: sensor.pubercave_pc_on_today
above: input_number.maxi_pc_time_weekday
id: weekday
- trigger: numeric_state
entity_id: sensor.pubercave_pc_on_today
above: input_number.maxi_pc_time_weekend
id: weekend
conditions:
- or:
- and:
- '{{ trigger.id == "weekday" }}'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- and:
- '{{ trigger.id == "weekend" }}'
- condition: time
weekday:
- sat
- sun
actions:
- action: tts.microsoft_say
data:
entity_id: media_player.zolder
message: Je tijd is op. Sluit je af?
- action: notify.mobile_devices_adults
data:
title: Puber PC
message: De puber heeft vandaag lang genoeg achter de PC gezeten ({{ now().strftime('%H:%M')
}}).
data:
tag: puber_pc
notification_icon: mdi:desktop-classic
priority: high
ttl: 0
- action: notify.mobile_app_schaduwspeler
data:
title: Gametijd
message: Je zit vandaag al lang genoeg achter de PC ({{ now().strftime('%H:%M')
}}).
data:
tag: puber_pc
notification_icon: mdi:desktop-classic
priority: high
ttl: 0
- action: automation.trigger
target:
entity_id: automation.knipper_de_lampen_als_de_puber_pc_tijd_over_is
- id: flash_lights_pc_time_over_pubercave
alias: Knipper de lampen als de puber PC tijd over is
mode: queued
triggers:
- trigger: time
at: input_datetime.time_maxi_gametime_over
conditions:
- condition: state
alias: Check if PC is on
entity_id: binary_sensor.pubercave_pc
state: 'on'
actions:
- action: scene.create
data:
scene_id: snapshot_pubercave
snapshot_entities:
- light.sonoff_l1
- light.battletron_ball_light_m
- delay:
seconds: 5
- action: light.turn_on
target:
entity_id:
- light.sonoff_l1
data:
color_name: red
effect: DIY Pulse
brightness_pct: 100
- action: light.turn_on
target:
entity_id:
- light.battletron_ball_light_m
data:
color_name: red
- delay:
seconds: 1
milliseconds: 200
- repeat:
count: 5
sequence:
- action: light.toggle
data: {}
target:
entity_id:
- light.battletron_ball_light_m
- delay:
seconds: 1
milliseconds: 200
- action: light.toggle
data: {}
target:
entity_id:
- light.battletron_ball_light_m
- delay:
seconds: 1
milliseconds: 200
- delay:
seconds: 5
- action: scene.turn_on
data:
entity_id: scene.snapshot_pubercave
- id: warn_power_usage_after_bedtime_attic
alias: Waarschuwing dat de pubercave nog stroom verbruikt
description: 'Reading light: the kid shouldn''t be reading after bedtime, so we
track the power usage of his bedside light with an always on switch Pubercave:
mancave for the adolescent kid. It has a TV that obviously shouldn''t be on after
bedtime... So let''s trigger a notification if it is :)'
mode: queued
triggers:
- trigger: numeric_state
entity_id: sensor.leeslampje_zolder_power
above: 3
for:
minutes: 2
id: Leeslampje
- trigger: numeric_state
entity_id: sensor.pubercave_tv_power
above: 25
id: TV
- trigger: state
entity_id: binary_sensor.schoollaptop_m
to: 'on'
for:
minutes: 2
id: Schoollaptop
conditions:
- condition: state
entity_id: input_boolean.notify_power_use_attic
state: 'on'
- condition: time
after: input_datetime.time_leeslampje_attic
actions:
- action: notify.mobile_devices_adults
data:
title: Pubercave {{ trigger.id }}
message: "{% if trigger.id == \"Leeslampje\" %}\n Het lampje op zolder staat\
\ nog aan... ({{ now().strftime('%H:%M') }}).\n{% elif trigger.id == \"Schoollaptop\"\
\ %}\n De schoollaptop op zolder staat nog aan... ({{ now().strftime('%H:%M')\
\ }}).\n{% else %}\n De TV op zolder staat nog aan... ({{ now().strftime('%H:%M')\
\ }}).\n{% endif %}"
data:
tag: pubercave
notification_icon: mdi:home-lightning-bolt
ttl: 0
priority: high
- id: power_logging_attic
alias: Log stroomverbruik in de pubercave
description: Because the switch is always on and only used for power tracking, we
need another way to track this switch in the logbook. We use 25 watts as crossover
point, because the PS4 sometimes charges the controllers and thus consumes a bit
of power.
mode: queued
triggers:
- trigger: numeric_state
entity_id: sensor.pubercave_tv_power
above: 25
id: pubercave
- trigger: numeric_state
entity_id: sensor.pubercave_tv_power
below: 25
id: pubercave
- trigger: numeric_state
entity_id: sensor.leeslampje_zolder_power
above: 3
id: leeslampje
- trigger: numeric_state
entity_id: sensor.leeslampje_zolder_power
below: 3
id: leeslampje
actions:
- choose:
- conditions:
condition: trigger
id: pubercave
sequence:
- action: logbook.log
data:
name: Pubercave zolder
entity_id: sensor.pubercave_tv_power
message: '{{ iif(states(''sensor.pubercave_tv_power'') | float(0) > 25,
"is aan", "is uit" )}}'
- conditions:
condition: trigger
id: leeslampje
sequence:
- action: logbook.log
data:
name: Leeslampje zolder
entity_id: sensor.leeslampje_zolder_power
message: '{{ iif(states(''sensor.leeslampje_zolder_power'') | float(0) >
3, "is aan", "is uit" )}}'
- id: lights_schuur
alias: Zet de verlichting van de schuur aan of uit
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: binary_sensor.pir_schuur_occupancy
to: 'on'
from: 'off'
variables:
action: turn_on
- trigger: state
entity_id: binary_sensor.pir_schuur_occupancy
to: 'off'
from: 'on'
variables:
action: turn_off
conditions: []
actions:
- alias: Lamp schuur bedienen...
action: switch.{{ action }}
target:
entity_id: switch.schuur
- id: wakeup_light_mini
alias: Wakeup light mini
mode: single
triggers:
- trigger: time
at: sensor.home_mini_slaapkamer_t_alarms
conditions: []
actions:
- delay: 00:00:01
- action: light.turn_on
data:
brightness_pct: 5
target:
entity_id:
- light.ledstrip_bed_mini
- delay: 00:00:02
- repeat:
sequence:
- service: light.turn_on
data:
entity_id: light.ledstrip_bed_mini
brightness: '{{ state_attr(''light.ledstrip_bed_mini'', ''brightness'')
| int + 15 }}'
- delay: 2
until:
condition: or
conditions:
- condition: template
value_template: '{{ state_attr(''light.ledstrip_bed_mini'', ''brightness'')
| int >= 191 }}'
- condition: state
entity_id: light.ledstrip_bed_mini
state: 'off'
- delay: 00:10:00
- action: light.turn_off
target:
entity_id: light.ledstrip_bed_mini
- id: turn_off_lights_t_when_starting_google_home_sleeping_sounds
alias: Lampen slaapkamer T uit als 'zomerse nachtgeluiden' beginnen
mode: queued
triggers:
- trigger: state
entity_id: media_player.slaapkamer_t
attribute: app_id
to: 9731D581
for: 00:00:02
conditions: null
actions:
- action: media_player.volume_set
data:
entity_id: media_player.slaapkamer_t
volume_level: 0.4
- if:
- condition: state
entity_id: light.ledstrip_bed_mini
state: 'on'
then:
- action: light.turn_off
target:
entity_id: light.ledstrip_bed_mini
data:
transition: 5
- delay: 00:40:00
- action: media_player.volume_set
data:
entity_id: media_player.slaapkamer_t
volume_level: 0.3
- delay: 00:05:00
- action: media_player.volume_set
data:
entity_id: media_player.slaapkamer_t
volume_level: 0.1
- action: media_player.turn_off
data:
entity_id: media_player.slaapkamer_t
- id: solar_upload_to_pvoutput
alias: Stuur solar informatie naar PVOutput
description: Upload values to PVOutput
triggers:
- trigger: time_pattern
minutes: /5
seconds: '0'
conditions:
- condition: state
entity_id: sensor.work_mode
state: Normal
actions:
- action: rest_command.update_pvoutput
data: {}
mode: single
- id: solar_handle_pv_off
alias: Zet de zonnepanelen uit
description: Automation to automatically turn off my solar system when electricity
prices are below 0. This can be done automatically or by time schedule based on
input_datetime. It works by setting the "grid_export_limit" in the GoodWe integration
to 0%, effectively instructing the inverter that it isn't allowed to export (produce)
any power. Setting it back to 100% restarts the production again to the maximum
capacity of the inverter.
triggers:
- trigger: state
entity_id:
- binary_sensor.negatieve_stroomprijs
attribute: position
to: below
from: above
id: automatic_start
variables:
message: Je zonnepanelen zijn automatisch uitgeschakeld omdat de stroomprijs
negatief is.
- trigger: state
entity_id:
- binary_sensor.negatieve_stroomprijs
attribute: position
to: above
from: below
id: automatic_stop
variables:
message: Je zonnepanelen zijn weer ingeschakeld omdat de stroomprijs positief
is.
- trigger: time
at: input_datetime.solar_pv_off_start
id: scheduled_start
variables:
message: Je zonnepanelen zijn uitgeschakeld op basis van je schedule.
- trigger: time
at: input_datetime.solar_pv_off_end
id: scheduled_stop
variables:
message: Je zonnepanelen zijn weer ingeschakeld op basis van je schedule.
conditions:
- alias: Check if inverter is actually working
condition: state
entity_id: sensor.work_mode
state: Normal
actions:
- alias: Choose what to execute
choose:
- conditions:
- condition: trigger
id: automatic_start
sequence:
- if:
- alias: Check if we enabled automatic turning on/off
condition: state
entity_id: input_boolean.solar_pv_off_automatic
state: 'on'
then:
- alias: Set grid export limit to 0% to turn off PV production
action: number.set_value
target:
entity_id: number.grid_export_limit
data:
value: '0'
else:
- stop: Stopping because automatic turning on/off is not enabled
- conditions:
- condition: trigger
id: automatic_stop
sequence:
- if:
- alias: Check if we enabled automatic turning on/off
condition: state
entity_id: input_boolean.solar_pv_off_automatic
state: 'on'
then:
- alias: Set grid export limit to 100% to turn on PV production
action: number.set_value
target:
entity_id: number.grid_export_limit
data:
value: '100'
else:
- stop: Stopping because automatic turning on/off is not enabled
- conditions:
- condition: trigger
id: scheduled_start
sequence:
- if:
- alias: Check if we enabled scheduled turning on/off
condition: state
entity_id: input_boolean.solar_pv_off_schedule
state: 'on'
then:
- alias: Set grid export limit to 0% to turn off PV production
action: number.set_value
target:
entity_id: number.grid_export_limit
data:
value: '0'
else:
- stop: Stopping because scheduled turning on/off is not enabled
- conditions:
- condition: trigger
id: scheduled_stop
sequence:
- if:
- alias: Check if we enabled scheduled turning on/off
condition: state
entity_id: input_boolean.solar_pv_off_schedule
state: 'on'
then:
- alias: Set grid export limit to 100% to turn on PV production
action: number.set_value
target:
entity_id: number.grid_export_limit
data:
value: '100'
- alias: Disable PV off schedule
action: input_boolean.turn_off
target:
entity_id: input_boolean.solar_pv_off_schedule
else:
- stop: Stopping because scheduled turning on/off is not enabled
- alias: Sending push notification
action: notify.mobile_app_sm_a556b
data:
title: Zonnepanelen update
message: '{{ message }}'
data:
tag: notification-solar
notification_icon: mdi:solar-power-variant
ttl: 0
priority: high
clickAction: /lovelace-admin/solar
- id: set_theme
alias: Stel thema in
triggers:
- trigger: homeassistant
event: start
- trigger: state
entity_id: sun.sun
actions:
- if: '{{ is_state(''sun.sun'', ''above_horizon'')}}'
then:
- action: frontend.set_theme
data:
name: Hmmbob light theme
mode: dark
else:
- action: frontend.set_theme
data:
name: Hmmbob dark theme
mode: dark
- id: ui_set_end_date
alias: Stel de datum van het eindveld op dezelfde dag in als de begindatum
description: 'System: Fix the UI - set date of end field to date of start field'
triggers:
- trigger: state
entity_id: input_datetime.solar_pv_off_start
variables:
end_entity_id: input_datetime.solar_pv_off_end
actions:
- alias: Set date of desired end field
action: input_datetime.set_datetime
target:
entity_id: '{{ end_entity_id }}'
data:
date: '{{states(trigger.entity_id) | truncate(10, ''False'', '''') }}'
- alias: Stuur een melding dat er een nieuwe Home Assistant versie is
id: system_update_available_notification
description: Send notification on Home Assistant update available
triggers:
- trigger: state
entity_id: sensor.latest_version
not_to:
- unknown
- unavailable
- none
conditions:
- condition: template
value_template: '{{ states(''sensor.latest_version'') != states(''sensor.current_version'')
}}
'
actions:
- action: notify.mobile_app_sm_a556b
data:
title: Upgrade time!
message: 'There is an upgrade for Home Assistant container pending! Version
{{ states(''sensor.latest_version'') }} just got released!
'
data:
tag: System
channel: System
notification_icon: mdi:cellphone-arrow-down
actions:
- action: URI
title: Open Changelog
uri: https://github.com/home-assistant/core/releases/tag/{{states('sensor.latest_version')}}
- alias: Verstuur melding welk afval opgehaald wordt
id: afval_meldingen
triggers:
- trigger: time
at: input_datetime.time_trash_warning_today
id: vandaag
- trigger: time
at: input_datetime.time_trash_warning_tomorrow
id: morgen
variables:
sensor: sensor.afvalinfo_home_{{ trigger.id }}
trash_descr:
PBD: plastic
GFT: GFT
Restafval: restafval
Papier: oud papier
PBD, Papier: plastic en oud papier
Papier, PBD: plastic en oud papier
afval: '{{ trash_descr.get(states(sensor), "onbekend") }}
'
conditions:
- alias: Do we want notifications?
condition: state
entity_id: input_boolean.notify_trash
state: 'on'
- alias: Do we have a valid state
condition: template
value_template: '{{ states(sensor) not in [''unknown'',''unavailable'',''none'',''geen'']
}}'
- condition: state
entity_id: input_boolean.vacation_mode_away
state: 'off'
actions:
- if:
- '{{trigger.id == "morgen" }}'
then:
- alias: New round of notifications, so resetting helper for next round
action: input_boolean.turn_off
target:
entity_id: input_boolean.trash_outside
- if:
- '{{trigger.id == "vandaag" }}'
- alias: Check if trash is outside already
condition: state
entity_id: input_boolean.trash_outside
state: 'on'
then:
- stop: Stopping notification sequence as trash is already outside
else:
- alias: Sending push notification
action: notify.mobile_app_sm_a556b
data:
title: Afvalinzameling
message: '{{ trigger.id | capitalize }} wordt het {{ afval }} opgehaald.'
data:
tag: notification-trash
notification_icon: mdi:delete
actions:
- action: trash_outside
title: Jep, staat buiten
ttl: 0
priority: high
- alias: Check if TTS should be played
condition: state
entity_id: input_boolean.notify_trash_voice
state: 'on'
- action: media_player.volume_set
data:
entity_id: media_player.kiosk1_fkb
volume_level: 0.9
- alias: Play TTS
action: tts.microsoft_say
entity_id: media_player.kiosk1_fkb
data:
message: '{{ trigger.id }} wordt het {{ afval }} opgehaald.'
- action: browser_mod.popup
data:
dismissable: true
autoclose: false
browser_id:
- kiosk1
- kiosk2
timeout: 60000
size: fullscreen
content:
type: picture
image: '{{ states(''input_text.trash_url_'' ~ states(sensor).replace(''
'', '''')) }}'
card_mod:
style:
ha-dialog$: "div.mdc-dialog .mdc-dialog__container .mdc-dialog__surface\
\ {\n background: black important;\n border: none important;\n border-style:\
\ solid important;\n border-color: black important;\n}\n"
- alias: Verwerk dat het afval buitengezet is
id: afval_process_reminder_status
triggers:
- trigger: event
event_type: mobile_app_notification_action
event_data:
action: trash_outside
actions:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.trash_outside
- id: update_waze_to_home
alias: Werk Waze reistijd bij
description: 'Update: Waze travel time to home'
triggers:
- trigger: time_pattern
minutes: /5
seconds: 0
actions:
- action: homeassistant.update_entity
entity_id: sensor.reistijd_bob_naar_huis
- id: location_ask_to_send_notification_hmmbob_left
alias: Vraag of we een melding moeten versturen dat Bob vertrekt
triggers:
- trigger: state
entity_id: binary_sensor.sm_a556b_android_auto
from: 'off'
to: 'on'
conditions:
- not:
- or:
- condition: zone
entity_id: device_tracker.sm_a556b
zone: zone.home
- condition: zone
entity_id: device_tracker.sm_a556b
zone: zone.breda
- condition: zone
entity_id: device_tracker.sm_a556b
zone: zone.vkl
- condition: zone
entity_id: device_tracker.sm_a556b
zone: zone.adr
- condition: zone
entity_id: device_tracker.sm_a556b
zone: zone.amc
- alias: Don't run if we already sent a message
condition: state
entity_id: input_boolean.location_bob_travelling_home
state: 'on'
actions:
- alias: Sending push notification
action: notify.mobile_app_sm_a556b
data:
title: Reistijd
message: Wil je een melding versturen?
data:
car_ui: true
notification_icon: mdi:car-side
actions:
- action: send_traveltime
title: Ja
tag: ask-waze
ttl: 0
priority: high
- id: location_notification_hmmbob_left_work
alias: Verstuur melding dat Bob van het werk vertrekt
triggers:
- trigger: event
event_type: mobile_app_notification_action
event_data:
action: send_traveltime
- trigger: zone
entity_id: device_tracker.sm_a556b
event: leave
zone: zone.breda
- trigger: zone
entity_id: device_tracker.sm_a556b
event: leave
zone: zone.vkl
- trigger: zone
entity_id: device_tracker.sm_a556b
event: leave
zone: zone.adr
- trigger: zone
entity_id: device_tracker.sm_a556b
event: leave
zone: zone.amc
conditions:
- condition: time
after: '14:00:00'
before: '19:00:00'
weekday:
- mon
- tue
- wed
- thu
- fri
actions:
- alias: Register that Bob is travelling home
action: input_boolean.turn_on
target:
entity_id: input_boolean.location_bob_travelling_home
- alias: Update Waze sensor (it doesn't update automatically)
action: homeassistant.update_entity
entity_id: sensor.reistijd_bob_naar_huis
- alias: Wait for the update to finish
delay:
seconds: 10
- alias: Ok, let's tell the people!
action: notify.mobile_devices_adults
data:
title: ♥ Bob is op weg naar huis!
message: 'Waze denkt dat hij om {{ (now() + timedelta(minutes=(3 + states("sensor.reistijd_bob_naar_huis")
| int))).strftime("%H:%M") }} thuis is.
'
data:
alert_once: true
car_ui: true
clickAction: /lovelace/locations
notification_icon: mdi:car-side
persistent: true
priority: high
sticky: true
tag: waze
ttl: 0
- action: notify.mobile_app_sm_a556b
data:
message: clear_notification
data:
tag: ask-waze
ttl: 0
priority: high
- action: automation.turn_on
target:
entity_id: automation.update_waze_travel_time_to_home
- id: location_update_traveltime_notification_hmmbob
alias: Werk reistijd notificatie bij met nieuwe gegevens
triggers:
- trigger: state
entity_id: sensor.reistijd_bob_naar_huis
conditions:
- alias: Check if we still think he's travelling home
condition: state
entity_id: input_boolean.location_bob_travelling_home
state: 'on'
actions:
- alias: Estimated time of arrival is updated, let's inform the people
action: notify.mobile_devices_adults
data:
title: ♥ Bob is op weg naar huis!
message: 'Waze denkt dat hij om {{ (now() + timedelta(minutes=(3 + states("sensor.reistijd_bob_naar_huis")
| int))).strftime("%H:%M") }} thuis is.
'
data:
alert_once: true
car_ui: true
clickAction: /lovelace/locations
notification_icon: mdi:car-side
persistent: true
priority: high
sticky: true
tag: waze
ttl: 0
- id: location_clear_traveltime_notification
alias: Verwijder reistijd notificatie als ik weer thuis ben
triggers:
- trigger: zone
entity_id: device_tracker.sm_a556b
event: enter
zone: zone.home
conditions:
- alias: Check if we still think he's travelling home
condition: state
entity_id: input_boolean.location_bob_travelling_home
state: 'on'
actions:
- action: input_boolean.turn_off
target:
entity_id: input_boolean.location_bob_travelling_home
- action: notify.mobile_devices_adults
data:
message: clear_notification
data:
tag: waze
ttl: 0
priority: high
- action: automation.turn_off
target:
entity_id: automation.update_waze_travel_time_to_home
- id: location_send_ev_charger_status
alias: Verstuur een melding om te laten weten of de laadpaal vrij is
triggers:
- trigger: zone
entity_id: device_tracker.sm_a556b
event: enter
zone: zone.laadpaal_waarschuwing
actions:
- variables:
laadpalen_werk:
- sensor.laadpaal_werk_1
- sensor.laadpaal_werk_2
laadpalen_extra:
- sensor.laadpaal_werk_3
- sensor.laadpaal_werk_4
message: "{{'Er is een laadpaal vrij bij het station!' if (laadpalen_werk |\
\ select('is_state', 'Available') | list | count > 0) \n else 'Er is een\
\ laadpaal vrij in de wijk!' if (laadpalen_extra | select('is_state', 'Available')\
\ | list | count > 0) \n else 'Helaas, geen laadpaal vrij.'}}"
- alias: Sending push notification
action: notify.mobile_app_sm_a556b
data:
title: Laadpaal
message: '{{ message }}'
data:
car_ui: true
notification_icon: mdi:ev-station
tag: charger_available
ttl: 0
priority: high
- id: ups_notification
alias: Verstuur een melding als we op de UPS draaien
mode: single
max_exceeded: silent
triggers:
- trigger: state
entity_id:
- sensor.ups_battery_charge
- sensor.ups_status_data
variables:
runtime_left: '{% set runtime = states("sensor.ups_battery_runtime") | int %}
{% set hours = runtime // 3600 %} {% set minutes = (runtime % 3600) // 60 %}
{{ ''%du'' % hours if hours else '''' }}{{ ''%dm'' % minutes if minutes else
'''' }}
'
conditions:
- alias: Previous state of triggers is not unavailable or unkown
condition: template
value_template: '{{ trigger.from_state.state not in [''unavailable'', ''unknown'']
}}'
actions:
- alias: Choose our status
choose:
- conditions:
- alias: If we are On Battery DISCHaRGing
condition: state
entity_id: sensor.ups_status_data
state: OB DISCHRG
sequence:
- alias: We're running on battery!
action: notify.mobile_app_sm_a556b
data:
title: 🪫 UPS ingeschakeld!
message: 'De servers draaien op UPS. Er is nog {{ runtime_left }} runtime
over.
'
data:
tag: UPS
alert_once: true
sticky: true
persistent: true
ttl: 0
priority: high
notification_icon: mdi:home-battery-outline
car_ui: true
- conditions:
- alias: If we are On Line CHaRGing
condition: state
entity_id: sensor.ups_status_data
state: OL CHRG
sequence:
- alias: We're back online, charging the UPS battery!
action: notify.mobile_app_sm_a556b
data:
title: 🔋 UPS weer online & aan het opladen!
message: 'Er is weer stroom. De UPS laadt weer op en is {{ states("sensor.ups_battery_charge")
}}% vol.
'
data:
tag: UPS
alert_once: true
sticky: true
persistent: true
ttl: 0
priority: high
notification_icon: mdi:power-plug-battery-outline
car_ui: true
- conditions:
- alias: If we are back OnLine
condition: state
entity_id: sensor.ups_status_data
state: OL
sequence:
- action: notify.mobile_app_sm_a556b
data:
message: clear_notification
data:
tag: UPS
- id: warn_for_power_fail
alias: Stuur notificatie als een van de fases wegvalt
mode: parallel
triggers:
- trigger: state
entity_id:
- binary_sensor.slimmelezer_power_failure_l1
- binary_sensor.slimmelezer_power_failure_l2
- binary_sensor.slimmelezer_power_failure_l3
to: 'on'
from: 'off'
conditions: []
actions:
- alias: Power failure
action: notify.mobile_app_sm_a556b
data:
title: Power failure
message: '{{ state_attr(trigger.entity_id, ''friendly_name'') }}
'
data:
tag: power_failure
ttl: 0
priority: high
notification_icon: mdi:transmission-tower-off
car_ui: true
- id: lights_bijkeuken
alias: Zet de verlichting in de bijkeuken aan of uit
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: binary_sensor.pir_bijkeuken_occupancy
to: 'on'
from: 'off'
variables:
action: turn_on
- trigger: state
entity_id: binary_sensor.pir_bijkeuken_occupancy
to: 'off'
from: 'on'
variables:
action: turn_off
conditions:
- condition: state
entity_id: input_boolean.enable_pir_bijkeuken_automations
state: 'on'
actions:
- alias: Bijkeuken lamp bedienen...
action: switch.{{ action }}
target:
entity_id: switch.bijkeuken
- id: vacation_turn_on_time
alias: Zet de verlichting aan tijdens vakantie
initial_state: true
triggers:
trigger: time
at: input_datetime.time_vacation_lights_start
conditions:
- condition: state
entity_id: input_boolean.vacation_mode_away
state: 'on'
actions:
- delay: '{{ range(30*60) | random }}'
alias: Random delay between now and 30mins
- action: homeassistant.turn_on
entity_id:
- light.spots_woonkamer
- light.spots_eetkamer
- action: logbook.log
data:
name: Vacation
message: Lights turned on at {{ now().strftime('%H:%M') }}.
domain: light
- action: notify.mobile_app_sm_a556b
data:
message: I turned your vacation lights on at {{ now().strftime('%H:%M') }}.
title: Vacation lights
data:
ttl: 0
priority: high
- id: vacation_turn_off_time
alias: Zet de verlichting uit tijdens vakantie
triggers:
trigger: time
at: input_datetime.time_vacation_lights_end
conditions:
- condition: state
entity_id: input_boolean.vacation_mode_away
state: 'on'
actions:
- delay: '{{ range(15*60) | random }}'
alias: Random delay between now and 30mins
- action: homeassistant.turn_off
entity_id:
- light.spots_woonkamer
- light.spots_eetkamer
- action: logbook.log
data:
name: Vacation
message: Lights turned off at {{ now().strftime('%H:%M') }}.
domain: light
- action: notify.mobile_app_sm_a556b
data:
message: I turned your lights off at {{ now().strftime('%H:%M') }}.
title: Vacation lights
data:
ttl: 0
priority: high
- id: vacation_movement_inside
alias: Beweging gedetecteerd tijdens vakantie
trigger:
- platform: state
entity_id:
- binary_sensor.fietsenhok_contact
- binary_sensor.pir_bijkeuken_occupancy
- binary_sensor.pir_gang_kapstok_motion_detection
- binary_sensor.pir_gang_meterkast_motion_detection
- binary_sensor.pir_inloopkast_occupancy
- binary_sensor.poort_contact
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: input_boolean.vacation_mode_away
state: 'on'
action:
- service: notify.mobile_app_sm_a556b
data:
message: Er is beweging gedetecteerd door {{ trigger.from_state.attributes.friendly_name
}} ({{ now().strftime('%H:%M') }})
title: Movement in the house
data:
ttl: 0
priority: high
notification_icon: mdi:shield-home
- service: logbook.log
data:
name: Vacation
message: Er is beweging gedetecteerd door {{ trigger.from_state.attributes.friendly_name
}}.
domain: binary_sensor
- alias: Vraag of Rocky moet stofzuigen
id: vacuum_ask_to_run
variables:
notification_service: '{% if is_state("device_tracker.sm_a566b", "home") and is_state("device_tracker.sm_a556b",
"home") %}notify.mobile_devices_adults {% elif is_state("device_tracker.sm_a566b",
"home") %}notify.mobile_app_sm_a566b {% elif is_state("device_tracker.sm_a556b",
"home") %}notify.mobile_app_sm_a556b {% else %}notify.bogus {% endif %}
'
triggers:
- trigger: time
at: input_datetime.vacuum_ask_for_cleaning_time
conditions:
- condition: state
entity_id: input_boolean.vacuum_enable_ask_for_cleaning
state: 'on'
- '{{ as_timestamp(now()) - as_timestamp(states(''sensor.rocky_last_clean_start''))
> 86100 }}'
- condition: state
entity_id: input_boolean.vacation_mode_away
state: 'off'
actions:
- alias: Vraag of Rocky een rondje moet doen
action: '{{ notification_service }}'
data:
message: Zal ik gaan stofzuigen? 🧹🧹
title: Rocky
data:
tag: vacuum
actions:
- action: vacuum_start_yes
title: 🧹 Ja, graag!
- action: vacuum_start_no
title: Nee, dank je.
ttl: 0
priority: high
notification_icon: mdi:robot-vacuum
- alias: Wacht op antwoord...
wait_for_trigger:
- trigger: event
event_type: mobile_app_notification_action
event_data:
action: vacuum_start_yes
timeout: 01:00:00
continue_on_timeout: false
- alias: Start Rocky na bevestiging
action: vacuum.start
target:
entity_id: vacuum.rocky
- alias: Stuur Rocky naar de vuilnisbak
id: vacuum_drive_to_trash
initial_state: 'on'
triggers:
- trigger: state
entity_id: vacuum.rocky
from: cleaning
to: returning
actions:
- alias: Stop Rocky before sending goto command
action: vacuum.stop
entity_id: vacuum.rocky
- delay: 00:00:02
- alias: Send Rocky to the trash can
action: vacuum.send_command
data:
command: app_goto_target
params:
- 30301
- 29421
target:
entity_id: vacuum.rocky
- alias: Wait for Rocky to arrive at trash can
wait_for_trigger:
- trigger: state
entity_id: vacuum.rocky
to: idle
timeout: 00:05:00
continue_on_timeout: false
- action: notify.mobile_devices_adults
data:
message: 🧹 Hi! Ik moet geleegd worden en sta al bij de prullenbak. Druk na het
legen op mijn 🏠 toets en ik ga terug naar mijn dock.
title: Rocky
data:
tag: vacuum
actions:
- action: vacuum_return_to_dock
title: Keer terug naar je dock
ttl: 0
priority: high
notification_icon: mdi:robot-vacuum
- alias: Stuur Rocky terug naar het dock
id: vacuum_return_to_dock
initial_state: 'on'
triggers:
- trigger: event
event_type: mobile_app_notification_action
event_data:
action: vacuum_return_to_dock
actions:
- action: vacuum.return_to_base
alias: Returning to dock
target:
entity_id: vacuum.rocky
- alias: Melding dat Rocky aan het stofzuigen is
id: vacuum_notification_cleaning_started
initial_state: 'on'
triggers:
- trigger: state
entity_id: vacuum.rocky
from: docked
to: cleaning
actions:
- action: notify.mobile_app_sm_a556b
data:
title: Rocky
message: Rocky doet zijn rondje! 🧹🧹
data:
tag: vacuum
notification_icon: mdi:robot-vacuum
- alias: Verwijder notificaties van Rocky
id: vacuum_clear_messages
initial_state: 'on'
triggers:
- trigger: state
entity_id: sensor.rocky_vacuum_error
to: none
- trigger: state
entity_id: vacuum.rocky
from: returning
to: docked
actions:
- action: notify.mobile_devices_adults
data:
message: clear_notification
data:
tag: vacuum
ttl: 0
priority: high
- alias: Melding dat Rocky in foutmodus staat
id: vacuum_notification_error
initial_state: 'on'
variables:
notification_service: '{% if is_state("device_tracker.sm_a566b", "home") and is_state("device_tracker.sm_a556b",
"home") %}notify.mobile_devices_adults {% elif is_state("device_tracker.sm_a566b",
"home") %}notify.mobile_app_sm_a566b {% elif is_state("device_tracker.sm_a556b",
"home") %}notify.mobile_app_sm_a556b {% else %}notify.bogus {% endif %}
'
triggers:
- trigger: state
entity_id: sensor.rocky_vacuum_error
conditions:
- condition: not
conditions:
- condition: state
entity_id: sensor.rocky_vacuum_error
state: none
- condition: state
entity_id: sensor.rocky_vacuum_error
state: unavailable
actions:
- action: '{{ notification_service }}'
data:
title: Rocky heeft een probleem
message: 'Foutmelding: {{state_translated(''sensor.rocky_vacuum_error'')}}'
data:
tag: vacuum
ttl: 0
priority: high
notification_icon: mdi:robot-vacuum
- alias: Waarschuw als Rocky onderhoud nodig heeft
id: vacuum_consumable_warning
initial_state: 'on'
mode: queued
variables:
consumables:
- sensor: sensor.rocky_filter_time_left
button: button.rocky_reset_air_filter_consumable
name: filter
- sensor: sensor.rocky_main_brush_time_left
button: button.rocky_reset_main_brush_consumable
name: hoofd borstel
- sensor: sensor.rocky_sensor_time_left
button: button.rocky_reset_sensor_consumable
name: sensor
- sensor: sensor.rocky_side_brush_time_left
button: button.rocky_reset_side_brush_consumable
name: zijborstel
trigger:
- platform: numeric_state
entity_id:
- sensor.rocky_filter_time_left
- sensor.rocky_main_brush_time_left
- sensor.rocky_sensor_time_left
- sensor.rocky_side_brush_time_left
below: 0
action:
- variables:
triggered_sensor: '{{ trigger.entity_id }}'
consumable: '{{ consumables | selectattr(''sensor'', ''eq'', triggered_sensor)
| list | first }}'
- service: notify.mobile_app_sm_a556b
data:
title: Rocky onderhoud nodig
message: De {{ consumable.name }} van Rocky moet worden vervangen of schoongemaakt.
Wil je de teller resetten?
data:
tag: rocky_maintenance
notification_icon: mdi:robot-vacuum
actions:
- action: reset_consumable
title: Reset teller
- action: ignore
title: Later
ttl: 0
priority: high
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: reset_consumable
timeout: 01:00:00
continue_on_timeout: false
- choose:
- conditions: '{{ wait.trigger is not none }}'
sequence:
- service: button.press
target:
entity_id: '{{ consumable.button }}'
- conditions: '{{ wait.trigger is none }}'
sequence:
- service: persistent_notification.create
data:
title: Rocky onderhoud niet gereset
message: De {{ consumable.name }} teller is niet gereset. Vergeet het niet
als je onderhoud hebt gedaan!
notification_id: rocky_maintenance_{{ consumable.name }}
- id: ventilation_handle_button
alias: Start de ventilatie timer als we op een knop drukken
triggers:
- trigger: state
entity_id:
- event.drukknop_badkamer_action
- event.drukknop_badkamer_zolder_action
- event.drukknop_bijkeuken_action
to: null
variables:
event: '{{ trigger.to_state.attributes.event_type | default(''unknown'', true)
}}'
conditions:
- '{{ event not in [''unknown'',''unavailable''] }}'
actions:
- action: timer.start
target:
entity_id: timer.fan_runtime
data:
duration: '{{''01:00:00'' if event in [''brightness_move_up'',''1_long_press'']
else ''00:30:00''}}'
- id: ventilation_boost_speed
alias: Stel een hogere ventilatiesnelheid in als de timer start
triggers:
- trigger: event
event_type: timer.started
event_data:
entity_id: timer.fan_runtime
actions:
- alias: Boost ventilation on request
action: fan.set_percentage
target:
entity_id: fan.open_air_mini
data:
percentage: 80
- id: ventilation_set_speed
alias: Stel de ventilatiesnelheid in
mode: queued
triggers:
- trigger: time
id: time
at:
- 07:00:00
- 09:00:00
- '21:15:00'
- trigger: homeassistant
event: start
id: ha_start
- trigger: event
event_type: automation_reloaded
id: automation_reload
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.fan_runtime
actions:
- alias: Check if this is triggered by HA restart
if:
condition: trigger
id: ha_start
then:
- delay:
minutes: 1
- alias: Cancel any running timers
action: timer.cancel
target:
entity_id: timer.fan_runtime
- alias: Checking what time it is...
choose:
- alias: It's between 7hrs and 09:00 and on a working day
conditions:
- condition: time
after: 06:59:59
before: 09:00:00
- condition: state
entity_id: binary_sensor.werkdag
state: 'on'
sequence:
- alias: Boost during morning hours because of showering
action: fan.set_percentage
target:
entity_id: fan.open_air_mini
data:
percentage: 70
- alias: It's between 09hrs and 21hrs
conditions:
- condition: time
after: 08:59:59
before: '21:00:00'
sequence:
- alias: Run at half speed during the day
action: fan.set_percentage
target:
entity_id: fan.open_air_mini
data:
percentage: 50
- alias: It's between 21hrs and 7hrs
conditions:
- condition: time
after: '20:59:59'
before: 07:00:00
sequence:
- alias: Sleep tight
action: fan.set_percentage
target:
entity_id: fan.open_air_mini
data:
percentage: 20
- id: wakeup_light_maxi
alias: Wakeup light maxi
mode: single
triggers:
- trigger: time
at: sensor.zolder_alarms
conditions: []
actions:
- action: light.turn_on
data:
brightness_pct: 100
color_temp_kelvin: 3500
target:
entity_id: light.sonoff_l1
- action: light.turn_on
target:
entity_id: light.battletron_ball_light_m
- delay: 00:05:00
- service: light.turn_off
entity_id:
- light.battletron_ball_light_m
- light.sonoff_l1
- id: lights_wc_beneden
alias: Zet de verlichting van de WC beneden aan of uit
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: binary_sensor.pir_wc_beneden_occupancy
to: 'on'
from: 'off'
variables:
action: turn_on
- trigger: state
entity_id: binary_sensor.pir_wc_beneden_occupancy
to: 'off'
from: 'on'
for: 00:01:00
variables:
action: turn_off
conditions: []
actions:
- alias: Lamp WC beneden bedienen...
action: switch.{{ action }}
target:
entity_id: switch.wc_beneden
- id: ventilation_wc_beneden
alias: Ventilatie aan als iemand lang op de WC beneden zit
triggers:
- trigger: state
entity_id: switch.wc_beneden
to: 'on'
for: 00:03:00
conditions:
- alias: Als de ventilatie timer nog niet loopt
condition: state
entity_id: timer.fan_runtime
state: idle
actions:
- alias: Afzuiging aanzetten
action: timer.start
target:
entity_id: timer.fan_runtime
data:
duration: 00:10:00
- id: lights_wc_boven
alias: Zet de verlichting van de WC boven aan of uit
mode: restart
max_exceeded: silent
triggers:
- trigger: state
entity_id: binary_sensor.pir_wc_boven_occupancy
to: 'on'
from: 'off'
id: turn_on
- trigger: state
entity_id: binary_sensor.pir_wc_boven_occupancy
to: 'off'
from: 'on'
id: turn_off
conditions: []
actions:
- alias: Checking what to do
choose:
- alias: Do we need to turn on the lights?
conditions:
- '{{ trigger.id == ''turn_on'' }}'
sequence:
- if:
- alias: Is het tijdens de donkere uren?
condition: time
after: '22:30:00'
before: 06:45:00
then:
- alias: Lamp WC boven gedimd aan...
action: light.turn_on
target:
entity_id: light.wc_boven
data:
brightness: 80
else:
- alias: Lamp WC boven voluit aan...
action: light.turn_on
target:
entity_id: light.wc_boven
data:
brightness: 255
- alias: Do we need to turn off the lights?
conditions:
- '{{ trigger.id == ''turn_off'' }}'
sequence:
- alias: Lamp WC boven uitzetten...
action: light.turn_off
target:
entity_id: light.wc_boven
- id: ventilation_wc_boven
alias: Ventilatie aan als iemand lang op de WC zit
triggers:
- trigger: state
entity_id: light.wc_boven
to: 'on'
for: 00:03:00
conditions:
- alias: Als de ventilatie timer nog niet loopt
condition: state
entity_id: timer.fan_runtime
state: idle
actions:
- alias: Afzuiging aanzetten
action: timer.start
target:
entity_id: timer.fan_runtime
data:
duration: 00:10:00
- id: rotate_turns
alias: Wissel de beurt voor het tafeldekken
triggers:
- trigger: time
at:
- 00:01:00
weekday:
- mon
actions:
- action: input_select.select_next
target:
entity_id: input_select.tafeldekken_beurt