AutomationDataset/g1bs0nsg/g1bs0nsg_automations.yaml

1154 lines
31 KiB
YAML

- id: 3dprinter_done
alias: 3D Print Done
initial_state: true
trigger:
trigger: state
entity_id: binary_sensor.octoprint_printing
from: 'on'
to: 'off'
action:
- action: secret telservice
data:
message: 3D Print Complete
- id: 3dprinter_poweroff_after_print
alias: 3D Printer Power Off After Print Finishes
initial_state: true
trigger:
trigger: state
entity_id: binary_sensor.octoprint_printing
from: 'on'
to: 'off'
for:
minutes: 20
condition:
condition: numeric_state
entity_id:
- sensor.octoprint_actual_bed_temp
- sensor.octoprint_actual_tool0_temp
below: 60
actions:
- action: switch.turn_off
entity_id: switch.3d_printer
- action: secret telservice
data:
message: 3D Printer has been idle for 20 minutes and is completely cooled down,
powering off
- id: 3dprinter_poweroff_idle
alias: 3D Printer Idle Power Off
initial_state: true
trigger:
trigger: state
entity_id: switch.3d_printer
to: 'on'
for:
minutes: 30
condition:
condition: not
conditions:
- condition: state
entity_id: binary_sensor.octoprint_printing
state: 'on'
actions:
- action: switch.turn_off
entity_id: switch.3d_printer
- action: secret telservice
data:
message: 3D Printer has been idle for 30 minutes, shutting down
- id: 3dprinter_error
alias: 3D Printer Error
initial_state: true
trigger:
trigger: state
entity_id: binary_sensor.octoprint_printing_error
to: 'on'
action:
- action: secret telservice
data:
message: 3D Printer has experienced an error and requires your attention
- id: Arrival_Lights_On
initial_state: true
alias: Lights On - Arriving Home
trigger:
trigger: state
entity_id: group.presence
from: not_home
to: home
condition:
condition: state
entity_id: sun.sun
state: below_horizon
actions:
- action: light.turn_on
entity_id:
- light.front_entry
- light.livingroom_lights
- light.diningroom
data:
brightness_pct: 100
- delay: 00:05:00
- action: light.turn_off
entity_id:
- light.front_entry
- light.diningroom
- action: light.turn_on
entity_id: light.livingroom_lights
data:
brightness_pct: 10
- alias: Bedtime
initial_state: true
trigger:
- trigger: state
entity_id: input_boolean.bedtime
to: 'on'
condition:
condition: state
entity_id: input_boolean.guest
state: 'off'
actions:
- action: script.turn_on
entity_id: script.bedtime
- delay: 00:00:05
- action: input_boolean.turn_off
entity_id: input_boolean.bedtime
- id: bedtime_tvoff
alias: Turn off TV at Bedtime
initial_state: true
trigger:
- trigger: state
entity_id: script.bedtime
from: 'off'
to: 'on'
condition:
condition: state
entity_id: input_boolean.guest
state: 'off'
action:
- delay: 00:20:00
- action: remote.turn_on
data:
entity_id: remote.living_room
activity: PowerOff
- id: Christmas_Tree_On
alias: Christmas Tree - On
initial_state: true
trigger:
- trigger: sun
event: sunset
condition:
condition: state
entity_id: group.presence
state: home
action:
action: switch.turn_on
entity_id: switch.christmas_tree
- id: Christmas_Tree_Off
alias: Christmas Tree - Off
initial_state: true
trigger:
trigger: sun
event: sunrise
offset: +00:45:00
condition:
- condition: state
entity_id: input_boolean.guest
state: 'off'
action:
action: switch.turn_off
entity_id: switch.christmas_tree
- id: basement_dehumidifier_tank_full
alias: Basement Dehumidifier Tank Full
initial_state: true
trigger:
trigger: state
entity_id: binary_sensor.151732606083492_tank_full
from: 'off'
to: 'on'
action:
- service: secret telservice
data:
message: Basement dehumidifier tank is full
- id: basement_dehumidifier_tank_warning
alias: Basement Dehumidifer Tank Warning
initial_state: true
trigger:
trigger: numeric_state
entity_id: sensor.151732606083492_tank
above: 50
action:
- service: secret telservice
data:
message: Time to empty the basement dehumidifier tank
- id: dehydrator_on
alias: Dehydrator On
initial_state: true
trigger:
- trigger: state
entity_id: switch.dehydrator
from: 'off'
to: 'on'
action:
- action: timer.start
data:
entity_id: timer.dehydrator
duration: 07:00:00
- id: dehydrator_reset
alias: Dehydrator Reset
initial_state: true
condition:
condition: or
conditions:
- condition: state
entity_id: timer.dehydrator
state: active
- condition: state
entity_id: switch.dehydrator
state: unavailable
triggers:
- trigger: state
entity_id: switch.dehydrator
from: 'on'
to: 'off'
- trigger: state
entity_id: switch.dehydrator
to: unavailable
actions:
- action: timer.cancel
entity_id: timer.dehydrator
- action: secret telservice
data:
message: Something has gone wrong, check the dehydrator
- id: dehydrator_timer_failed
alias: Dehydrator Timer Failed
initial_state: true
trigger:
- trigger: state
entity_id: timer.dehydrator
to: idle
for:
minutes: 1
condition:
condition: state
entity_id: switch.dehydrator
state: 'on'
action:
- action: secret telservice
data_template:
message: Dehydator timer has failed, it is now idle but dehydrator is still
powered on. Shut it down?
data:
inline_keyboard:
- Yes:/dehydratoroff,No:/removekeyboarddehydrator
- id: dehydrator_timer_done
alias: Ding Jerky Timer Done
initial_state: true
trigger:
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.dehydrator
actions:
- action: secret telservice
data_template:
message: Timer has expired and dehydator has been powered off. Is the Jerky
done?
data:
inline_keyboard:
- Give it another hour:/dehydratorextend,Yes:/removekeyboarddehydrator
- action: switch.turn_off
entity_id: switch.dehydrator
- id: acknowledge_dehydrator_alert
alias: Acknowledge Dehydrator Alert
initial_state: true
trigger:
trigger: event
event_type: telegram_callback
event_data:
data: /removekeyboarddehydrator
actions:
- action: telegram_bot.answer_callback_query
data_template:
callback_query_id: '{{ trigger.event.data.id }}'
message: Great, no further action needed then.
- action: notify.britt_ha_notifybot
data:
message: Great, no further action needed then.
- action: telegram_bot.edit_replymarkup
data_template:
message_id: '{{ trigger.event.data.message.message_id }}'
chat_id: '{{ trigger.event.data.chat_id }}'
inline_keyboard: []
- id: extend_dehydrator_time
alias: Extend Dehydrator Timer
initial_state: true
trigger:
trigger: event
event_type: telegram_callback
event_data:
data: /dehydratorextend
actions:
- action: telegram_bot.answer_callback_query
data_template:
callback_query_id: '{{ trigger.event.data.id }}'
message: Ok, timer extended 1 hour and dehydrator powered back on.
- action: secret telservice
data:
message: Ok, timer extended 1 hour and dehydrator powered back on.
- action: telegram_bot.edit_replymarkup
data_template:
message_id: '{{ trigger.event.data.message.message_id }}'
chat_id: '{{ trigger.event.data.chat_id }}'
inline_keyboard: []
- action: switch.turn_on
entity_id: switch.dehydrator
- action: timer.start
data:
entity_id: timer.dehydrator
duration: 01:00:00
- id: dogs_give_heatworm_flea_tick
alias: Dogs - Give Heartworm/Flea/Tick
initial_state: true
trigger:
- trigger: calendar
entity_id: calendar.trefynwed_gmail_com
event: start
condition:
- condition: template
value_template: '{{ ''Dogs - Flea/Tick/Heartworm'' in trigger.calendar_event.summary
}}'
actions:
- action: secret telservice
data_template:
message: Did you give the dogs their medicine?
data:
inline_keyboard: Yes:/dogsoff,Remind Me Later:/dogslater
- action: timer.start
data:
entity_id: timer.dogs
duration: 00:30:00
mode: queued
- id: dogs_off
alias: Dogs - Gave Heartworm/Flea/Tick
initial_state: true
trigger:
trigger: event
event_type: telegram_callback
event_data:
data: /dogsoff
actions:
- action: telegram_bot.answer_callback_query
data_template:
callback_query_id: '{{ trigger.event.data.id }}'
message: Ok, Dog reminder acknowledged
- action: telegram_bot.edit_replymarkup
data_template:
message_id: '{{ trigger.event.data.message.message_id }}'
chat_id: '{{ trigger.event.data.chat_id }}'
inline_keyboard: []
- action: timer.cancel
entity_id: timer.dogs
- id: dogs_remind_me_later
alias: Dogs - Remind Me Later
initial_state: true
trigger:
trigger: event
event_type: telegram_callback
event_data:
data: /dogslater
actions:
- action: telegram_bot.answer_callback_query
data_template:
callback_query_id: '{{ trigger.event.data.id }}'
message: Ok, I will remind you again in 30 minutes.
- action: telegram_bot.edit_replymarkup
data_template:
message_id: '{{ trigger.event.data.message.message_id }}'
chat_id: '{{ trigger.event.data.chat_id }}'
inline_keyboard: []
- action: timer.cancel
entity_id: timer.dogs
- action: timer.start
data:
entity_id: timer.dogs
duration: 00:30:00
- id: dogs_repeat_reminder
alias: Dogs - Repeat Reminder
initial_state: true
trigger:
trigger: event
event_type: timer.finished
event_data:
entity_id: timer.dogs
actions:
- action: secret telservice
data_template:
message: Did you give the Dogs their medicine?
data:
inline_keyboard: Yes:/dogsoff,Remind Me Later:/dogslater
- action: timer.start
data:
entity_id: timer.dogs
duration: 00:30:00
- id: dog_cam_snapshot
alias: Dog Camera Snapshot
initial_state: true
trigger:
- trigger: mqtt
topic: frigate/events
id: frigate-event-dogcam
payload: dog_cam
value_template: '{{ value_json["after"]["camera"] }}'
variables:
after_zones: '{{ trigger.payload_json["after"]["entered_zones"] }}'
before_zones: '{{ trigger.payload_json["before"]["entered_zones"] }}'
camera: '{{ trigger.payload_json["after"]["camera"] }}'
id: '{{ trigger.payload_json["after"]["id"] }}'
label: '{{ trigger.payload_json["after"]["label"] }}'
condition:
- condition: or
conditions:
- condition: template
value_template: '{{ trigger.payload_json[''type''] == ''new'' }}'
- condition: template
value_template: '{{ before_zones | length == 0 }}'
- condition: and
conditions:
- condition: state
entity_id: input_boolean.motion_alert
state: 'on'
- condition: state
entity_id: input_boolean.guest
state: 'off'
- condition: state
entity_id: group.presence
state: not_home
- condition: template
value_template: '{{ ["dcperson", "fpoverhead"]|select("in", trigger.payload_json["after"]["entered_zones"])|list|length
> 0 }}'
actions:
- action: telegram_bot.send_photo
data:
url: http://hass.sky.net:8123/api/frigate/notifications/{{ id }}/thumbnail.jpg
caption: '{{ label | title }} detected by {{ camera | replace("_", " ") | title
}}
'
target: secret tchatid1
- delay: 00:00:30
- action: telegram_bot.send_video
data:
url: http://hass.sky.net:8123/api/frigate/notifications/{{ id }}/{{ camera }}/clip.mp4
caption: 'Video of detection from {{ camera | replace("_", " ") | title }}
'
target: secret tchatid1
mode: single
max_exceeded: silent
- id: Doorbird Ring
alias: Doorbird_Ring
trigger:
trigger: event
event_type: doorbird_frontdoor_button_press
action:
- action: script.turn_on
entity_id: script.doorbell
- id: doorbird_snapshot
alias: Doorbird Camera Snapshot
initial_state: false
trigger:
- trigger: mqtt
topic: frigate/events
id: frigate-event-doorbird
payload: front_door
value_template: '{{ value_json["after"]["camera"] }}'
variables:
after_zones: '{{ trigger.payload_json["after"]["entered_zones"] }}'
before_zones: '{{ trigger.payload_json["before"]["entered_zones"] }}'
camera: '{{ trigger.payload_json["after"]["camera"] }}'
id: '{{ trigger.payload_json["after"]["id"] }}'
label: '{{ trigger.payload_json["after"]["label"] }}'
condition:
- condition: or
conditions:
- condition: template
value_template: '{{ trigger.payload_json[''type''] == ''new'' }}'
- condition: template
value_template: '{{ before_zones | length == 0 }}'
- condition: and
conditions:
- condition: state
entity_id: input_boolean.motion_alert
state: 'on'
- condition: state
entity_id: input_boolean.autolock
state: 'on'
- condition: state
entity_id: binary_sensor.front_door
state: 'off'
- condition: template
value_template: '{{ not (now() - states.binary_sensor.front_door.last_changed).total_seconds()
< 30 }}'
- condition: template
value_template: '{{ ["dbperson", "fpoverhead"]|select("in", trigger.payload_json["after"]["entered_zones"])|list|length
> 0 }}'
actions:
- action: telegram_bot.send_photo
data:
url: http://hass.sky.net:8123/api/frigate/notifications/{{ id }}/thumbnail.jpg
caption: '{{ label | title }} detected by {{ camera | replace("_", " ") | title
}}
'
target: secret tchatid1
- delay: 00:00:30
- action: telegram_bot.send_video
data:
url: http://hass.sky.net:8123/api/frigate/notifications/{{ id }}/{{ camera }}/clip.mp4
caption: 'Video of detection from {{ camera | replace("_", " ") | title }}
'
target: secret tchatid1
- condition: template
value_template: '{{ not (now() - states.automation.doorbird_ring.attributes.last_triggered).total_seconds()
< 60 }}'
- condition: template
value_template: '{{ not (now() - states.script.motion_alert.attributes.last_triggered).total_seconds()
< 60 }}'
- action: script.turn_on
entity_id: script.motion_alert
mode: single
max_exceeded: silent
- id: Exterior_Lights_On_Sunset
alias: Exterior Lights On - Sunset
initial_state: true
trigger:
- trigger: sun
event: sunset
condition:
condition: state
entity_id: group.presence
state: home
action:
- action: light.turn_on
data:
entity_id:
- light.front_porch_light
- light.back_porch_light
- id: freeze_warning
alias: Freeze Warning
initial_state: true
trigger:
- trigger: sun
event: sunset
condition:
- condition: numeric_state
entity_id: sensor.overnight_low
below: 35
action:
- action: secret telservice
data:
message: Freeze warning, cover outside spigots
- id: Frontdoor_IR_On
alias: Doorbird IR On at Night
initial_state: false
trigger:
- trigger: time_pattern
minutes: /2
condition:
condition: state
entity_id: sun.sun
state: below_horizon
action:
action: button.press
entity_id: button.frontdoor_ir
- id: front_porch_snapshot
alias: Front Porch Camera Snapshot
initial_state: false
trigger:
- trigger: mqtt
topic: frigate/events
id: frigate-event-frontporch
payload: front_porch
value_template: '{{ value_json["after"]["camera"] }}'
variables:
after_zones: '{{ trigger.payload_json["after"]["entered_zones"] }}'
before_zones: '{{ trigger.payload_json["before"]["entered_zones"] }}'
camera: '{{ trigger.payload_json["after"]["camera"] }}'
id: '{{ trigger.payload_json["after"]["id"] }}'
label: '{{ trigger.payload_json["after"]["label"] }}'
condition:
- condition: or
conditions:
- condition: template
value_template: '{{ trigger.payload_json[''type''] == ''new'' }}'
- condition: template
value_template: '{{ before_zones | length == 0 }}'
- condition: and
conditions:
- condition: state
entity_id: input_boolean.motion_alert
state: 'on'
- condition: state
entity_id: input_boolean.autolock
state: 'on'
- condition: state
entity_id: binary_sensor.front_door
state: 'off'
- condition: template
value_template: '{{ not (now() - states.binary_sensor.front_door.last_changed).total_seconds()
< 30 }}'
- condition: template
value_template: '{{ ["dbperson", "fpoverhead"]|select("in", trigger.payload_json["after"]["entered_zones"])|list|length
> 0 }}'
actions:
- action: telegram_bot.send_photo
data:
url: http://hass.sky.net:8123/api/frigate/notifications/{{ id }}/thumbnail.jpg
caption: '{{ label | title }} detected by {{ camera | replace("_", " ") | title
}}
'
target: secret tchatid1
- delay: 00:00:30
- action: telegram_bot.send_video
data:
url: http://hass.sky.net:8123/api/frigate/notifications/{{ id }}/{{ camera }}/clip.mp4
caption: 'Video of detection from {{ camera | replace("_", " ") | title }}
'
target: secret tchatid1
- condition: template
value_template: '{{ not (now() - states.automation.doorbird_ring.attributes.last_triggered).total_seconds()
< 60 }}'
- condition: template
value_template: '{{ not (now() - states.script.motion_alert.attributes.last_triggered).total_seconds()
< 60 }}'
- action: script.turn_on
entity_id: script.motion_alert
mode: single
max_exceeded: silent
- id: input_select_harmony_living_room
alias: Start Activity from Input Select
initial_state: true
trigger:
trigger: state
entity_id: input_select.living_room_tv
from: Select Activity
actions:
- action: "{% if is_state('input_select.living_room_tv', 'Netflix') %}\n script.netflix\n\
{% else %}\n remote.turn_on\n{% endif %}\n"
data_template:
entity_id: remote.living_room
activity: "{% if is_state('input_select.living_room_tv', 'Power Off') %}\n \
\ PowerOff\n{% elif is_state('input_select.living_room_tv', 'Watch TV') %}\
\ \n Watch TV\n{% elif is_state('input_select.living_room_tv', 'Watch Roku')\
\ %}\n Watch Roku\n{% elif is_state('input_select.living_room_tv', 'PS3')\
\ %}\n PS3\n{% else %} {% endif %}\n"
- action: input_select.select_option
entity_id: input_select.living_room_tv
data_template:
option: Select Activity
- id: hvac_filter_change
alias: Change HVAC Filter
initial_state: true
trigger:
- trigger: calendar
entity_id: calendar.trefynwed_gmail_com
event: start
condition:
- condition: template
value_template: '{{ ''Change HVAC Filter'' in trigger.calendar_event.summary }}'
actions:
- action: secret telservice
data_template:
message: Have you changed the HVAC filter?
data:
inline_keyboard: Yes:/hvacfilteroff
- action: timer.start
data:
entity_id: timer.hvacfilter
duration: 01:00:00
mode: queued
- id: hvacfilter_off
alias: HVAC Filter Changed
initial_state: true
trigger:
trigger: event
event_type: telegram_callback
event_data:
data: /hvacfilteroff
actions:
- action: telegram_bot.answer_callback_query
data_template:
callback_query_id: '{{ trigger.event.data.id }}'
message: Ok, HVAC filter channged
- action: telegram_bot.edit_replymarkup
data_template:
message_id: '{{ trigger.event.data.message.message_id }}'
chat_id: '{{ trigger.event.data.chat_id }}'
inline_keyboard: []
- action: timer.cancel
entity_id: timer.hvacfilter
- id: hvacfilter_repeat
alias: Repeat Change HVAC Filter
initial_state: true
trigger:
trigger: event
event_type: timer.finished
event_data:
entity_id: timer.hvacfilter
actions:
- action: secret telservice
data_template:
message: Have you changed the HVAC filter?
data:
inline_keyboard: Yes:/hvacfilteroff
- action: timer.start
data:
entity_id: timer.hvacfilter
duration: 01:00:00
- id: ifttt
alias: IFTTT
initial_state: true
trigger:
trigger: event
event_type: ifttt_webhook_received
event_data:
action: call_service
action:
action: '{{ trigger.event.data.service }}'
data_template:
entity_id: '{{ trigger.event.data.entity_id }}'
- id: Interior_Lights_On_Sunset
alias: Interior Lights On - Sunset
initial_state: false
triggers:
- trigger: sun
event: sunset
offset: -00:45:00
- trigger: state
entity_id: group.presence
to: home
condition:
condition: and
conditions:
- condition: sun
after: sunset
after_offset: -00:45:00
- condition: state
entity_id: group.presence
state: home
- condition: state
entity_id: input_boolean.guest
state: 'off'
action:
action: light.turn_on
data:
entity_id: light.livingroom_lights
brightness_pct: 1
- id: medicine_reminder
alias: Take Medicine
initial_state: true
triggers:
- trigger: time
at: 08:30:00
- trigger: time
at: '20:00:00'
actions:
- action: secret telservice
data_template:
message: Did you take your medicine?
data:
inline_keyboard: Yes:/medoff,Remind Me Later:/medlater
- action: timer.start
data:
entity_id: timer.medicine
duration: 00:30:00
- id: medicine_off
alias: Medicine Taken
initial_state: true
trigger:
trigger: event
event_type: telegram_callback
event_data:
data: /medoff
actions:
- action: telegram_bot.answer_callback_query
data_template:
callback_query_id: '{{ trigger.event.data.id }}'
message: Ok, Medicine reminder acknowledged
- action: telegram_bot.edit_replymarkup
data_template:
message_id: '{{ trigger.event.data.message.message_id }}'
chat_id: '{{ trigger.event.data.chat_id }}'
inline_keyboard: []
- action: timer.cancel
entity_id: timer.medicine
- id: medicine_remind_me_later
alias: Medicine - Remind Me Later
initial_state: true
trigger:
trigger: event
event_type: telegram_callback
event_data:
data: /medlater
actions:
- action: telegram_bot.answer_callback_query
data_template:
callback_query_id: '{{ trigger.event.data.id }}'
message: Ok, I will remind you again in 30 minutes.
- action: telegram_bot.edit_replymarkup
data_template:
message_id: '{{ trigger.event.data.message.message_id }}'
chat_id: '{{ trigger.event.data.chat_id }}'
inline_keyboard: []
- action: timer.cancel
entity_id: timer.medicine
- action: timer.start
data:
entity_id: timer.medicine
duration: 00:30:00
- id: medicine_repeat_reminder
alias: Medicine - Repeat Reminder
initial_state: true
trigger:
trigger: event
event_type: timer.finished
event_data:
entity_id: timer.medicine
actions:
- action: secret telservice
data_template:
message: Did you take your medicine?
data:
inline_keyboard: Yes:/medoff,Remind Me Later:/medlater
- action: timer.start
data:
entity_id: timer.medicine
duration: 00:30:00
- alias: Murdok Radio Volume Control
initial_state: true
trigger:
trigger: state
entity_id: input_number.murdok_radio
action:
- action: media_player.volume_set
data_template:
entity_id: media_player.googlehome_living_room
volume_level: '{{ states(''input_number.murdok_radio'') }}
'
- id: Nightlight_Off_Motion
alias: Nightlight Off - Motion
initial_state: true
trigger:
trigger: state
entity_id: binary_sensor.living_room_motion
to: 'off'
for:
minutes: 15
condition:
condition: and
conditions:
- condition: time
after: 06:00:00
before: '10:00:00'
- condition: state
entity_id: input_boolean.guest
state: 'off'
- condition: template
value_template: '{{ not is_state(''person.britt'',''home'') }}'
action:
action: light.turn_off
data:
entity_id:
- light.hallway
- light.front_entry
- light.back_entry
- light.kitchen
- id: Nightlight_Off_Sunrise
alias: Nightlight Off - Sunrise
initial_state: true
trigger:
trigger: sun
event: sunrise
offset: +00:45:00
condition:
- condition: state
entity_id: input_boolean.guest
state: 'off'
action:
action: light.turn_off
data:
entity_id:
- light.front_entry
- light.livingroom_lights
- light.diningroom
- id: Nightlight_Off_Time
alias: Nightlight Off - Time
initial_state: true
trigger:
trigger: time
at: '10:00:00'
action:
action: light.turn_off
data:
entity_id:
- light.livingroom_lights
- light.front_entry
- light.diningroom
- id: Nightlights On
initial_state: true
alias: Nightlights On
trigger:
trigger: state
entity_id: binary_sensor.living_room_motion
to: 'on'
condition:
condition: and
conditions:
- condition: time
after: 06:00:00
before: '10:00:00'
- condition: state
entity_id: input_boolean.guest
state: 'off'
actions:
- action: light.turn_on
data:
entity_id:
- light.front_entry
- light.back_entry
- light.hallway
brightness_pct: 1
- action: light.turn_on
data:
entity_id: light.pendant1
brightness_pct: 1
- id: toggle_office_roku
alias: Toggle Office Roku
initial_state: true
trigger:
- trigger: event
event_type: tag_scanned
event_data:
tag_id: fd63aff9-078c-4653-a47a-0ed42272fd8b
actions:
- action: remote.send_command
data:
entity_id: remote.office
command: power
- action: switch.turn_on
entity_id: switch.dog_cam
- action: rest_command.tasker_nfc_office
- id: Facial_Recognition
alias: Double Take Facial Recognition
initial_state: true
trigger:
- trigger: state
entity_id: sensor.double_take_britt
condition:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.motion_alert
state: 'on'
- condition: state
entity_id: input_boolean.autolock
state: 'on'
- condition: state
entity_id: binary_sensor.front_door
state: 'off'
- condition: template
value_template: '{{ not (now() - states.binary_sensor.front_door.last_changed).total_seconds()
< 30 }}'
- condition: template
value_template: '{{ trigger.to_state.attributes.id = trigger.from_state.attributes.id
}}'
action:
- action: telegram_bot.send_photo
data:
url: http://frigate.sky.net:3000/api/storage/matches/{{ trigger.to_state.attributes.match.filename
}}?box=true
caption: "{% if trigger.to_state.attributes.match is defined %}\n {{ trigger.to_state.attributes.match.name\
\ | title }} identified by {{trigger.to_state.attributes.camera | replace(\"\
_\", \" \") | title}} @ {{trigger.to_state.attributes.match.confidence}}%,\
\ took {{trigger.to_state.attributes.attempts}} attempt(s) @ {{trigger.to_state.attributes.duration}}\
\ sec\n{% endif %}"
target: secret tchatid1
mode: single
max_exceeded: silent
- id: record_away
alias: Enable Recording
initial_state: false
trigger:
trigger: state
entity_id: group.presence
from: home
to: not_home
condition:
- condition: state
entity_id: input_boolean.guest
state: 'off'
actions:
- action: switch.turn_on
entity_id:
- switch.dog_cam_detect
- switch.dog_cam_motion
- switch.dog_cam_recordings
- switch.dog_cam_snapshots
- action: secret telservice
data:
message: Nobody is at home, enabling camera recording
- id: record_stop
alias: Disable Recording
initial_state: true
triggers:
- trigger: state
entity_id:
- secret personentity1
from: not_home
to: home
- trigger: state
entity_id:
- secret personentity2
from: not_home
to: home
condition:
condition: or
conditions:
- condition: state
entity_id: switch.dog_cam_detect
state: 'on'
- condition: state
entity_id: switch.dog_cam_motion
state: 'on'
- condition: state
entity_id: switch.dog_cam_recordings
state: 'on'
- condition: state
entity_id: switch.dog_cam_snapshots
state: 'on'
actions:
- action: switch.turn_off
entity_id:
- switch.dog_cam_detect
- switch.dog_cam_motion
- switch.dog_cam_recordings
- switch.dog_cam_snapshots
- action: secret telservice
data:
message: Camera recording disabled.
mode: single
max_exceeded: silent
- id: record_frigate_restart
alias: Disable Recording on Frigate Restart
initial_state: true
trigger:
trigger: state
entity_id: camera.dog_cam
from: unavailable
condition:
condition: or
conditions:
- condition: state
entity_id: secret personentity1
state: home
- condition: state
entity_id: secret personentity2
state: home
action:
- action: switch.turn_off
entity_id:
- switch.dog_cam_detect
- switch.dog_cam_motion
- switch.dog_cam_recordings
- switch.dog_cam_snapshots
- alias: Netflix
initial_state: true
trigger:
- trigger: state
entity_id: input_boolean.netflix
to: 'on'
actions:
- action: script.turn_on
entity_id: script.netflix
- delay: 00:00:05
- action: input_boolean.turn_off
entity_id: input_boolean.netflix
- id: trash_put_out
alias: Put out the trash
initial_state: true
trigger:
- trigger: calendar
entity_id: calendar.trefynwed_gmail_com
event: start
condition:
- condition: template
value_template: '{{ ''Put out the trash'' in trigger.calendar_event.summary }}'
actions:
- action: secret telservice
data_template:
message: Did you put out the trash?
data:
inline_keyboard: Yes:/trashoff
- action: timer.start
data:
entity_id: timer.trash
duration: 00:30:00
mode: queued
- id: trash_off
alias: Trash put out
initial_state: true
trigger:
trigger: event
event_type: telegram_callback
event_data:
data: /trashoff
actions:
- action: telegram_bot.answer_callback_query
data_template:
callback_query_id: '{{ trigger.event.data.id }}'
message: Ok, trash reminder acknowledged
- action: telegram_bot.edit_replymarkup
data_template:
message_id: '{{ trigger.event.data.message.message_id }}'
chat_id: '{{ trigger.event.data.chat_id }}'
inline_keyboard: []
- action: timer.cancel
entity_id: timer.trash
- id: trash_repeat_put_out
alias: Repeat Put Out Trash
initial_state: true
trigger:
trigger: event
event_type: timer.finished
event_data:
entity_id: timer.trash
actions:
- action: secret telservice
data_template:
message: Did you put out the trash?
data:
inline_keyboard: Yes:/trashoff
- action: timer.start
data:
entity_id: timer.trash
duration: 00:30:00
- id: Hass_Update_Available
alias: Home Assistant Update Available
initial_state: true
trigger:
- trigger: state
entity_id: binary_sensor.home_assistant_website_update_available
from: 'off'
to: 'on'
action:
- action: secret telservice
data_template:
message: '{% set HassVer = states(''sensor.home_assistant_website'') %} {% set
HassNotes = state_attr(''sensor.home_assistant_website'', ''release_notes'')
%} Home Assistant version {{ HassVer }} is now available {{''\n''}}{{''\n''}}
{{ HassNotes }}
'