AutomationDataset/pjaspers/pjaspers_automations.yaml

459 lines
11 KiB
YAML

- id: badkamer_remote_on
alias: 'Strybar: Badkamerlicht aan'
description: Badkamer licht aan met afstandsbediening
trigger:
- platform: event
event_type: deconz_event
event_data:
id: strybar
event: 1002
condition: []
action:
- service: homeassistant.toggle
data:
entity_id: light.badkamer
mode: single
- id: badkamer_remote_off
alias: 'Strybar: Badkamerlicht uit'
description: Badkamer licht uit met afstandsbediening
trigger:
- platform: event
event_type: deconz_event
event_data:
id: strybar
event: 2002
condition: []
action:
- service: homeassistant.toggle
data:
entity_id: light.badkamer
mode: single
- id: poezenfontein_on
alias: 'Strybar: poezenfontein aan'
description: Poezenfontein aan met afstandsbediening
trigger:
- platform: event
event_type: deconz_event
event_data:
id: strybar
event: 3002
condition: []
action:
- service: homeassistant.toggle
data:
entity_id: switch.kerstboom_stopcontact
mode: single
- id: poezenfontein_off
alias: 'Strybar: poezenfontein uit'
description: Poezenfontein uit met afstandsbediening
trigger:
- platform: event
event_type: deconz_event
event_data:
id: strybar
event: 4002
condition: []
action:
- service: homeassistant.toggle
data:
entity_id: switch.kerstboom_stopcontact
mode: single
- id: poezenfontein
alias: Turn off poezenfontein after 5 minutes of Franz drinking
description: Turn off poezenfontein after 5 minutes of Franz drinking
trigger:
- platform: state
entity_id: switch.kerstboom_stopcontact
from: 'off'
to: 'on'
for:
minutes: 5
action:
- service: homeassistant.toggle
data:
entity_id: switch.kerstboom_stopcontact
- id: elf_remote_center
alias: 'Elf: toggle the gate'
description: Garage deur
trigger:
- platform: event
event_type: deconz_event
event_data:
id: elf
event: 1002
condition: []
action:
- service: cover.toggle
data:
entity_id: cover.garage_door
mode: single
- id: elf_remote_up
alias: 'Elf: Open the gate'
description: Garage toe
trigger:
- platform: event
event_type: deconz_event
event_data:
id: elf
event: 2002
condition: []
action:
- service: cover.open_cover
data:
entity_id: cover.garage_door
mode: single
- id: elf_remote_down
alias: 'Elf: Lower the gate'
description: Garage open
trigger:
- platform: event
event_type: deconz_event
event_data:
id: elf
event: 3002
condition: []
action:
- service: cover.close_cover
data:
entity_id: cover.garage_door
mode: single
- id: living spots A
alias: Shakelaar voor voorste spotjes.
triggers:
- trigger: state
entity_id: switch.living_spots_front_switch_0
not_from:
- unknown
- unavailable
not_to:
- unknown
- unavailable
action:
- service: light.toggle
data:
entity_id: light.living_spots
mode: single
- id: automation_spots_b
alias: Shakelaar voor achterse spotjes.
triggers:
- trigger: state
entity_id: switch.living_spots_back_switch_0
not_from:
- unknown
- unavailable
not_to:
- unknown
- unavailable
actions:
- action: light.toggle
target:
entity_id: light.living_back_spots
mode: single
- id: on-location-change
alias: Send location
description: ''
trigger:
- platform: state
entity_id:
- device_tracker.oranje
attribute: latitude
action:
service: shell_command.send_location
- alias: loc. Arm the outside
id: arm-the-outside
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.home_piet_distance
above: 200
action:
- service: input_boolean.turn_on
entity_id: input_boolean.pj_outside_zone
- alias: loc. Notify about being away
id: notify-arm
mode: single
triggers:
- trigger: state
entity_id: person.piet_jaspers
to: away
actions:
- action: notify.mobile_app_oranje
data:
message: pjaspers has left the building
- alias: loc. pj arrived home
id: pj-arrived-home
mode: single
trigger:
- trigger: state
entity_id: person.piet_jaspers
from: not_home
to: home
action:
- event: x-pj-returned-home
- alias: loc. ch arrived home
id: ch-arrived-home
mode: single
trigger:
- trigger: state
entity_id: person.christine
from: not_home
to: home
action:
- event: x-ch-returned-home
- id: pj-returned-home
alias: Piet returning home
triggers:
- trigger: event
event_type: x-pj-returned-home
conditions:
- condition: state
entity_id: input_boolean.pj_automatic_garage_opener
state: 'on'
actions:
- service: notify.mobile_app_oranje
data:
title: You returned home!
message: Opening the pod bay doors (because you asked me)
- action: input_boolean.turn_off
data:
entity_id: input_boolean.pj_automatic_garage_opener
- action: cover.open_cover
data:
entity_id: cover.garage_door
- id: ch-returned-home
alias: Christine returning home
triggers:
- trigger: event
event_type: x-ch-returned-home
conditions:
- condition: state
entity_id: input_boolean.ch_automatic_garage_opener
state: 'on'
actions:
- service: notify.mobile_app_stienfoon
data:
title: Je bent thuis!
message: Ik open de garage (omdat je dat wou)
- action: input_boolean.turn_off
data:
entity_id: input_boolean.ch_automatic_garage_opener
- action: cover.open_cover
data:
entity_id: cover.garage_door
- id: nighty-night
alias: Turn off the lights at night
description: ''
trigger:
- at: input_datetime.go_to_bed_house
platform: time
condition: []
action:
- service: scene.turn_on
data:
entity_id: scene.night
transition: 10
- id: evening-mode
alias: Turn on lights an hour before sunset
description: ''
trigger:
- event: sunset
offset: -01:00:00
platform: sun
condition: []
action:
- service: scene.turn_on
data:
entity_id: scene.sunset
transition: 10
mode: single
- id: day-mode
alias: Turn off lights at 9
description: No need for lights during the day
trigger:
- platform: time
at: 09:00
condition: []
action:
- service: script.turn_on
entity_id: script.turn_off_downstairs
- service: light.turn_off
entity_id: light.badkamer_hal
- id: light-submarine
alias: Make the hallway use red light at night
trigger:
- platform: time
at: input_datetime.submarine_house
action:
- service: light.turn_on
entity_id: light.badkamer_hal
data:
brightness: 50
color_name: red
- id: presence-leave
alias: Turn off things when leaving
trigger:
- platform: state
entity_id: person.piet_jaspers
to: not_home
action:
- service: notify.mobile_app_proteus
data:
title: You not here
message: You left
- id: morning-mode
alias: Make waking up less of a hassle
trigger:
- platform: time
at: input_datetime.wake_up_house
action:
- service: scene.turn_on
data:
entity_id: scene.morning
transition: 10
- id: '1606908289501'
alias: Turn on basement light when there is movement
trigger:
- platform: state
entity_id: binary_sensor.presence_2
from: 'off'
to: 'on'
action:
- service: homeassistant.turn_on
data:
entity_id: switch.kelder_stopcontact
- id: '1606908325908'
alias: Turn off basement light 10 minutes after last movement
trigger:
- platform: state
entity_id: binary_sensor.presence_2
from: 'on'
to: 'off'
for:
minutes: 5
action:
- service: homeassistant.turn_off
data:
entity_id: switch.kelder_stopcontact
- alias: Background light on when camera on
trigger:
platform: state
entity_id: binary_sensor.pj_mini_camera_in_use
from: 'off'
to: 'on'
for: 0:00:02
action:
service: homeassistant.turn_on
entity_id: light.bureau
- alias: Background light off when camera off
trigger:
platform: state
entity_id: binary_sensor.pj_mini_camera_in_use
from: 'on'
to: 'off'
for: 0:00:02
action:
service: homeassistant.turn_off
entity_id: light.bureau
- id: auto-close-garage
alias: Close the garage door if someone leaves it open
trigger:
- trigger: state
entity_id: cover.garage_door
to: open
for:
minutes: '{{ states(''input_number.garage_door_duration_minutes'') | float }}'
- trigger: state
entity_id: binary_sensor.garage
to: open
for:
minutes: '{{ states(''input_number.garage_door_duration_minutes'') | float }}'
action:
- action: cover.close_cover
data:
entity_id: cover.garage_door
- x-actions: &id001
- event: pj.wake-girls.prepare
event_data:
weekday: true
- delay: 10
- event: pj.wake-girls.fire
event_data:
weekday: true
- delay: 3600
- event: pj.wake-girls.teardown
event_data:
weekday: true
- id: wake-girls-weekdays
alias: Wake up the girls during the week
trigger:
- platform: template
value_template: '{{ states(''sensor.time'') == ((states.input_datetime.alarm_clock_girls.attributes.timestamp
| int) | timestamp_custom(''%H:%M'', False)) }}'
condition:
condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
action: *id001
- id: wake-girls-weekend
alias: Wake up the girls during the weekend
trigger:
- platform: template
value_template: '{{ states(''sensor.time'') == ((states.input_datetime.alarm_clock_girls_weekend.attributes.timestamp
| int) | timestamp_custom(''%H:%M'', False)) }}'
condition:
condition: state
entity_id: binary_sensor.workday_sensor
state: 'off'
action: *id001
- id: wake-girls-prepare
alias: Wake girls prepare
trigger:
- platform: event
event_type: pj.wake-girls.prepare
action:
- service: scene.create
data:
scene_id: girls_before_wake
snapshot_entities:
- light.dollhousefran
- light.wled_roos
- group.switches_girls
- service: light.turn_off
entity_id:
- light.wled_roos
- light.dollhousefran
- id: wake-girls-now
alias: Wake girls now
trigger:
- platform: event
event_type: pj.wake-girls.fire
action:
- service: light.turn_on
entity_id:
- light.wled_roos
- light.dollhousefran
data:
rgb_color:
- 119
- 187
- 65
brightness_pct: 90
- service: homeassistant.turn_on
entity_id: group.switches_girls
- id: wake-girls-after
alias: Wake girls after
trigger:
- platform: event
event_type: pj.wake-girls.teardown
action:
- service: homeassistant.turn_off
entity_id: group.switches_girls
- service: scene.turn_on
target:
entity_id: scene.girls_before_wake
- delay: 20
- service: light.turn_off
entity_id:
- light.wled_roos
- light.dollhousefran