AutomationDataset/bomkim-web/bomkim-web_automations.yaml

543 lines
15 KiB
YAML

- id: 656132f5-bee7-4691-8ae4-d7e41f462d5d
alias: Workday alarm
triggers:
- trigger: time
at: input_datetime.workday_alarm_time
conditions:
- condition: state
entity_id: person.bom
state: home
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
- condition: state
entity_id: input_boolean.alarm
state: 'on'
- condition: or
conditions:
- condition: template
value_template: '{{ (is_state(''input_boolean.monday_friday_alarm'', ''on''))}}'
- condition: template
value_template: '{{ (is_state(''input_boolean.monday_friday_alarm'', ''off'')
and now().strftime(''%w'') not in [''1'',''5'']) }}'
actions:
- action: media_player.volume_set
data:
volume_level: 0
target:
entity_id: media_player.bedroom_display
- action: media_player.play_media
data:
media_content_id: media-source://radio_browser/ea8059be-d119-4de3-b27b-0d9bd6aedb17
media_content_type: audio/mpeg
target:
entity_id: media_player.bedroom_display
- repeat:
count: 3
sequence:
- action: media_player.volume_set
data:
volume_level: '{{ repeat.index * 0.1 }}'
target:
entity_id: media_player.bedroom_display
- delay: 00:00:20
- id: c1154511-3a8e-4147-9e23-be6f21c1e3b6
alias: Turn on alarm next day if off
trigger:
- trigger: template
value_template: '{{ now().strftime(''%H:%M'') == state_attr(''input_datetime.workday_alarm_time'',
''timestamp'') + 5*60 | timestamp_custom(''%H:%M'', false) }}'
condition:
- condition: state
entity_id: input_boolean.alarm
state: 'off'
action:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.alarm
- id: 400c1781-149c-48d7-8042-e313509316f4
alias: Adaptive Light
triggers:
- trigger: template
value_template: '{{ now().strftime(''%H:%M'') == (state_attr(''input_datetime.workday_alarm_time'',
''timestamp'') - 30*60) | timestamp_custom(''%H:%M'', false) }}
'
conditions:
- condition: state
entity_id: person.bom
state: home
- condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
- condition: state
entity_id: input_boolean.alarm
state: 'on'
- condition: or
conditions:
- condition: template
value_template: '{{ (is_state(''input_boolean.monday_friday_alarm'', ''on''))}}'
- condition: template
value_template: '{{ (is_state(''input_boolean.monday_friday_alarm'', ''off'')
and now().strftime(''%w'') not in [''1'',''5'']) }}'
actions:
- repeat:
count: 30
sequence:
- action: light.turn_on
target:
entity_id:
- group.kitchen_lights
data:
brightness: '{{ 255 / 30 * repeat.index | int }}'
color_temp: '{{ 370 - (repeat.index * (120 / 30)) | int }}'
- delay: 00:01:00
- id: 84f5763d-7154-411d-8993-45088630ffec
alias: Turn on Alarm automations
triggers:
- trigger: template
value_template: '{{ now().strftime(''%H:%M'') == (state_attr(''input_datetime.workday_alarm_time'',
''timestamp'') + 5*60) | timestamp_custom(''%H:%M'', false) }}
'
actions:
- if:
- condition: state
entity_id: automation.adaptive_light_in_the_morning
state: 'off'
then:
- action: automation.turn_on
target:
entity_id: automation.adaptive_light_in_the_morning
- if:
- condition: state
entity_id: automation.workday_alarm
state: 'off'
then:
- action: automation.turn_on
target:
entity_id: automation.workday_alarm
- id: 266c2494-ea35-4d5b-9797-50c844b3ca9c
alias: Turn on appliances when the first person arrives home
triggers:
- trigger: state
entity_id: group.family_members
from: not_home
to: home
actions:
- action: light.turn_on
target:
entity_id:
- group.kitchen_lights
- light.bedroom_light
- id: f4fb78a0-c527-4189-a034-f9f30408d1da
alias: Turn off appliances when the last person leaves home
triggers:
- trigger: state
entity_id: group.family_members
from: home
to: not_home
actions:
- action: google_assistant_sdk.send_text_command
data:
command: Turn off air conditioner
- action: light.turn_off
target:
entity_id:
- group.kitchen_lights
- light.bath_1
- light.closet_1
- light.toilet_1
- light.bedroom_light
- action: switch.turn_off
target:
entity_id:
- switch.smart_plug
- switch.smart_plug_2
- action: media_player.media_pause
target:
entity_id: media_player.bedroom
- id: 972ddcfd-ef9b-4fbd-a0f5-3a17c7d70a8d
alias: Turn on air purifier when the first person arrives home
triggers:
- trigger: state
entity_id: group.family_members
from: not_home
to: home
actions:
- action: media_player.play_media
target:
entity_id: media_player.bom_s_echo_dot
data:
media_content_type: custom
media_content_id: ダイキンで空気清浄機を運転して
- id: f7ca8b68-2226-42d4-aca2-32b45d98bf19
alias: Turn off air purifier when the last person leaves home
triggers:
- trigger: state
entity_id: group.family_members
from: home
to: not_home
actions:
- action: media_player.play_media
target:
entity_id: media_player.bom_s_echo_dot
data:
media_content_type: custom
media_content_id: ダイキンで空気清浄機を消して
- id: f4fb78a0-c527-4189-a034-f9f30408d1da
alias: Turn off appliances
triggers:
- trigger: state
entity_id: group.family_members
from: home
to: not_home
actions:
- action: google_assistant_sdk.send_text_command
data:
command: Turn off bedroom air conditioner
- action: light.turn_off
target:
entity_id:
- group.kitchen_lights
- light.bath_1
- light.closet_1
- light.toilet_1
- light.bedroom_light
- action: switch.turn_off
target:
entity_id:
- switch.smart_plug
- switch.smart_plug_2
- action: media_player.media_pause
target:
entity_id: media_player.bedroom
- id: f7ca8b68-2226-42d4-aca2-32b45d98bf19
alias: Turn off air purifier
triggers:
- trigger: state
entity_id: group.family_members
from: home
to: not_home
actions:
- action: media_player.play_media
target:
entity_id: media_player.bom_s_echo_dot
data:
media_content_type: custom
media_content_id: ダイキンで空気清浄機を消して
- id: dd3d659f-1e44-4e95-9cff-93d7749a8baa
alias: Open the curtains
triggers:
- trigger: time
at: 09:00:00
conditions:
- condition: state
entity_id: group.family_members
state: home
- condition: state
entity_id: input_boolean.alarm
state: 'on'
actions:
- action: cover.open_cover
target:
entity_id: cover.windowcovering
- id: 1f115262-36f4-48c7-81f7-770e271908bc
alias: Close the curtains
triggers:
- trigger: sun
event: sunset
actions:
- action: cover.close_cover
target:
entity_id: cover.windowcovering
- id: 266c2494-ea35-4d5b-9797-50c844b3ca9c
alias: Turn on lights
triggers:
- trigger: state
entity_id: group.family_members
from: not_home
to: home
actions:
- action: light.turn_on
target:
entity_id:
- group.kitchen_lights
- light.bedroom_light
- id: 972ddcfd-ef9b-4fbd-a0f5-3a17c7d70a8d
alias: Turn on air purifier
triggers:
- trigger: state
entity_id: group.family_members
from: not_home
to: home
actions:
- action: media_player.play_media
target:
entity_id: media_player.bom_s_echo_dot
data:
media_content_type: custom
media_content_id: ダイキンで空気清浄機を運転して
- id: 40d066b5-1a17-43df-8494-ef79a77bba9e
alias: Air conditioner in warm mode
triggers:
trigger: state
entity_id: group.family_members
from: not_home
to: home
conditions:
- condition: template
value_template: '{{ states(''sensor.outdoor_temperature'') | float < states(''input_number.warm_temp'')
| float }}'
actions:
- action: google_assistant_sdk.send_text_command
data:
command: Turn on the heat
- delay: 00:00:03
- action: google_assistant_sdk.send_text_command
data:
command: Set the temperature to 22
- id: 591a2b37-7273-4115-accc-a8eee06d5f95
alias: Air conditioner in cool mode
triggers:
trigger: state
entity_id: group.family_members
from: not_home
to: home
conditions:
- condition: template
value_template: '{{ states(''sensor.qingping_air_monitor_lite_temperature'') |
float > states(''input_number.cool_temp'') | float }}'
actions:
- action: google_assistant_sdk.send_text_command
data:
command: Turn on the cooling
- delay: 00:00:03
- action: google_assistant_sdk.send_text_command
data:
command: Set the temperature to {{ states('input_number.cool_temp') | float
| round(0) }}
- id: a7a41029-3b03-4eb2-86e3-0474ac1c9d35
alias: Turn on bedroom light when the first person arrives home after sunset before
sunrise
triggers:
- trigger: state
entity_id: group.family_members
from: not_home
to: home
conditions:
- alias: Sun down
condition: state
entity_id: sun.sun
state: below_horizon
actions:
- action: light.turn_off
target:
entity_id:
- light.bedroom_light
- id: 2f02ff5e-12d4-4c9a-b2ec-bae05dceae5a
alias: Difference between today and tomorrow's temperature
triggers:
- trigger: time
at: '21:00:00'
actions:
- action: notify.mobile_app_boms_iphone
data:
title: '{{ states(''sensor.low_temperature_forecast_tomorrow'') | float | round(1)
}}° / {{ states(''sensor.temperature_forecast_tomorrow'') | float | round(1)
}}° '
message: '{%- set low_today = states(''sensor.low_temperature_forecast_today'')
| float %} {%- set low_tomorrow = states(''sensor.low_temperature_forecast_tomorrow'')
| float %} {%- set low_diff = low_tomorrow - low_today %} {%- set high_today
= states(''sensor.temperature_forecast_today'') | float %} {%- set high_tomorrow
= states(''sensor.temperature_forecast_tomorrow'') | float %} {%- set high_diff
= high_tomorrow - high_today %} {{ low_diff | round(1) }}° / {{ high_diff
| round(1) }}°'
- id: 4f4f3157-181b-4906-a1e8-7122b96c9f4f
alias: Rainy at workdays
triggers:
- trigger: time
at: input_datetime.workday_alarm_time
conditions:
- alias: It is workday
condition: state
entity_id: binary_sensor.workday_sensor
state: 'on'
- condition: template
value_template: '{{ states(''sensor.precipitation_forecast_today_work'') | float
| round(0) > 0 }}'
actions:
- action: notify.mobile_app_boms_iphone
data:
message: "Rain is forecast {{ states('sensor.precipitation_forecast_today_work')\
\ | float }}mm at work today. \n"
- id: 379575e2-5e5f-450f-9195-3367c293a041
alias: Someone opened the door
triggers:
- trigger: state
entity_id: binary_sensor.parasoll_door_window_sensor_door
to: 'on'
conditions:
- condition: state
entity_id: group.family_members
state: not_home
actions:
- action: notify.bom_devices
data:
message: Someone Opened the Door!
- id: 1a692303-ef8f-453d-8575-d1567b9feb07
alias: Away not triggered for long time
triggers:
- trigger: template
value_template: '{{ now() - state_attr(''automation.turn_off_appliances'', ''last_triggered'')
> timedelta(days=2) }}'
actions:
- action: notify.mobile_app_boms_iphone
data:
message: Away is not triggered for days. Please check the automation.
- id: 904bb658-7679-4a56-8ae4-74d1527016e6
alias: Away triggered
triggers:
- trigger: state
entity_id: group.family_members
to: not_home
conditions:
- condition: state
entity_id: automation.turn_off_appliances
state: 'on'
actions:
- action: notify.mobile_app_boms_iphone
data:
message: Away is triggered. Appliances are turned off.
- id: 02dc3052-96f8-4aec-a7d7-e9e5c2990376
alias: Turn on the lights when button short released before alarm
triggers:
- trigger: state
entity_id: event.rodret_dimmer_button
to: short_release
attribute: event_type
condition:
- condition: template
value_template: "{{ today_at(states('input_datetime.workday_alarm_time')) > now()\
\ }} \n"
actions:
- action: switch.turn_off
target:
entity_id: switch.smart_plug
- action: light.turn_on
target:
entity_id:
- group.kitchen_lights
data:
brightness: 255
color_temp: 250
- action: light.turn_on
target:
entity_id:
- light.bedroom_light
- action: automation.turn_off
target:
entity_id: automation.adaptive_light_in_the_morning
data:
stop_actions: true
- id: 1a4fd1e1-9506-4ca5-88e4-7020e282f64c
alias: Turn on the lights when button short released after alarm
triggers:
- trigger: state
entity_id: event.rodret_dimmer_button
to: short_release
attribute: event_type
condition:
- condition: template
value_template: '{{ today_at(states(''input_datetime.workday_alarm_time'')) <=
now() }}
'
actions:
- action: switch.turn_off
target:
entity_id: switch.smart_plug
- action: light.turn_on
target:
entity_id:
- group.kitchen_lights
data:
brightness: 255
color_temp: 250
- action: light.turn_on
target:
entity_id:
- light.bedroom_light
- if:
- condition: state
entity_id: media_player.bedroom_display
state: playing
then:
- action: media_player.media_stop
target:
entity_id: media_player.bedroom_display
- id: 2299b5c1-273a-42d7-9612-5c0f417d89ea
alias: Turn off the lights when button 2 short released
triggers:
- trigger: state
entity_id: event.rodret_dimmer_button_2
to: short_release
attribute: event_type
actions:
- action: light.turn_off
target:
entity_id:
- group.kitchen_lights
- light.bedroom_light
- light.closet_1
- action: switch.turn_off
target:
entity_id: switch.smart_plug_2
- action: media_player.media_pause
target:
entity_id: media_player.bedroom
- id: 42c48061-2974-49b6-b970-43b91fb863c9
alias: Toggle the smart plug when button 1 long-pressed
triggers:
- trigger: state
entity_id: event.rodret_dimmer_button
to: long_press
attribute: event_type
actions:
- action: switch.toggle
target:
entity_id: switch.smart_plug
- id: 7e70b56a-bde0-4659-b616-ed2ff15cf5d2
alias: Toggle the smart plug when button 2 long-pressed
triggers:
- trigger: state
entity_id: event.rodret_dimmer_button_2
to: long_press
attribute: event_type
actions:
- action: switch.toggle
target:
entity_id: switch.smart_plug
- id: eefda598-6363-43c3-b1b3-c04376ca6af1
alias: Open the curtain when button 1 long-pressed
triggers:
- trigger: state
entity_id: event.remote_2_button
to: long_press
attribute: event_type
actions:
- action: cover.open_cover
target:
entity_id: cover.windowcovering
- id: cbbc654d-3a84-4252-8026-cfe5596da866
alias: Close the curtain when button 2 long-pressed
triggers:
- trigger: state
entity_id: event.remote_2_button_2
to: long_press
attribute: event_type
actions:
- action: cover.close_cover
target:
entity_id: cover.windowcovering