mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-05 08:44:24 +00:00
88 lines
2.5 KiB
YAML
88 lines
2.5 KiB
YAML
input_boolean:
|
|
routine_welcome_home:
|
|
name: Coming home · Say welcome
|
|
initial: on
|
|
icon: mdi:account-plus-outline
|
|
|
|
script:
|
|
routine_coming_home:
|
|
alias: Routine · Coming home
|
|
sequence:
|
|
- service: light.turn_on
|
|
entity_id:
|
|
- light.hallway_entrance_lights
|
|
- light.bed_led
|
|
- service: script.security_camera_off
|
|
- service: script.routine_coming_home_after_sunset
|
|
- service: script.sonos_join_bedroom
|
|
- service: script.routine_coming_home_welcome_home
|
|
|
|
routine_coming_home_after_sunset:
|
|
alias: Routine · Coming home · After sunset
|
|
sequence:
|
|
- condition: state
|
|
entity_id: sun.sun
|
|
state: "below_horizon"
|
|
- service: light.turn_on
|
|
entity_id: light.on_after_dark
|
|
data:
|
|
brightness_pct: 100
|
|
|
|
routine_coming_home_welcome_home:
|
|
alias: Routine · Coming home · Welcome home
|
|
sequence:
|
|
- condition: state
|
|
entity_id: input_boolean.routine_welcome_home
|
|
state: "on"
|
|
- service: script.say
|
|
data_template:
|
|
partials:
|
|
- !include ../../templates/partials/greeting.yaml
|
|
- !include ../../templates/partials/time.yaml
|
|
# - "Here's the current status:" // TODO: figure out if there will be anything to say?
|
|
- !include ../../templates/partials/window_suggestions.yaml
|
|
- wait_template: "{{ is_state('input_boolean.sarah_talking', 'off') }}"
|
|
timeout: 00:02:00
|
|
- delay: 00:00:01
|
|
|
|
- service: script.say
|
|
data_template:
|
|
message: >-
|
|
|
|
{{
|
|
[
|
|
"I'll put some music on.",
|
|
"I'll play some music.",
|
|
"Here's some music."
|
|
] | random
|
|
}}
|
|
- delay: 00:00:02
|
|
|
|
- service: script.music_play
|
|
|
|
automation:
|
|
- alias: Routine · Coming home · Left work
|
|
trigger:
|
|
platform: event
|
|
event_type: telegram_callback
|
|
event_data:
|
|
command: "/leaving_work_to_home"
|
|
action:
|
|
- service: telegram_bot.edit_replymarkup
|
|
data_template:
|
|
message_id: "last"
|
|
chat_id: "{{ trigger.event.data.chat_id }}"
|
|
inline_keyboard:
|
|
- service: notify.telegram
|
|
data_template:
|
|
title: "🏠 *Presence Module · Leaving Work*"
|
|
message: >-
|
|
|
|
{{
|
|
[
|
|
"Okay, I'll be expecting you!",
|
|
"Awesome! I'm prepping for your arrival",
|
|
"Cool, I'll be ready!"
|
|
] | random
|
|
}}
|