mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-09-07 10:18:44 +00:00
Add telegram automation for leaving work
This commit is contained in:
@@ -8,22 +8,24 @@ cards:
|
|||||||
show_header_toggle: false
|
show_header_toggle: false
|
||||||
entities:
|
entities:
|
||||||
- entity: input_boolean.routine_welcome_home
|
- entity: input_boolean.routine_welcome_home
|
||||||
- entity: automation.presence_arrival_detection
|
|
||||||
- entity: automation.security_door_opened_while_away
|
- entity: automation.security_door_opened_while_away
|
||||||
|
- entity: automation.presence_arrival_detection
|
||||||
- entity: automation.coming_home
|
- entity: automation.coming_home
|
||||||
|
- entity: automation.leaving_work_to_home
|
||||||
- entity: automation.leaving_home
|
- entity: automation.leaving_home
|
||||||
- entity: automation.master_bedroom_bedside_light_on_bedside_switch_single_click
|
- entity: automation.master_bedroom_bedside_light_on_bedside_switch_single_click
|
||||||
|
- entity: automation.sleep_toggle_on_switch_tap
|
||||||
- entity: automation.cube_knock
|
- entity: automation.cube_knock
|
||||||
- entity: automation.cube_shake
|
- entity: automation.cube_shake
|
||||||
- entity: automation.enable_guest_mode
|
- entity: automation.enable_guest_mode
|
||||||
- entity: automation.disable_guest_mode
|
- entity: automation.disable_guest_mode
|
||||||
- entity: automation.sleep_toggle_on_switch_tap
|
|
||||||
- entity: automation.enable_sleep_mode
|
- entity: automation.enable_sleep_mode
|
||||||
- entity: automation.disable_sleep_mode
|
- entity: automation.disable_sleep_mode
|
||||||
- entity: automation.domestina_automate_start
|
- entity: automation.domestina_automate_start
|
||||||
- entity: automation.domestina_start
|
- entity: automation.domestina_start
|
||||||
- entity: automation.domestina_automate_end
|
- entity: automation.domestina_automate_end
|
||||||
- entity: automation.domestina_end
|
- entity: automation.domestina_end
|
||||||
|
- entity: speech_telegram_do_nothing
|
||||||
- entity: automation.camera_turn_off_on_startup
|
- entity: automation.camera_turn_off_on_startup
|
||||||
- entity: automation.system_announce_start
|
- entity: automation.system_announce_start
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ automation:
|
|||||||
entity_id: input_boolean.georgi_home
|
entity_id: input_boolean.georgi_home
|
||||||
state: "off"
|
state: "off"
|
||||||
action:
|
action:
|
||||||
- service: script.telegram_say
|
- service: notify.telegram
|
||||||
data:
|
data:
|
||||||
title: "🏠 *Presence Module · Arrival detection*"
|
title: "🏠 *Presence Module · Arrival detection*"
|
||||||
message: "Device marked as home. Waiting for door to open!"
|
message: "Device marked as home. Waiting for door to open!"
|
||||||
@@ -74,7 +74,7 @@ automation:
|
|||||||
timeout: 00:15:00
|
timeout: 00:15:00
|
||||||
- service: input_boolean.turn_on
|
- service: input_boolean.turn_on
|
||||||
entity_id: input_boolean.georgi_home
|
entity_id: input_boolean.georgi_home
|
||||||
- service: script.telegram_say
|
- service: notify.telegram
|
||||||
data:
|
data:
|
||||||
title: "🏠 *Presence Module · Arrival detection*"
|
title: "🏠 *Presence Module · Arrival detection*"
|
||||||
message: "✅ Hey, I've marked you as home now!"
|
message: "✅ Hey, I've marked you as home now!"
|
||||||
@@ -88,7 +88,7 @@ automation:
|
|||||||
to: "not_home"
|
to: "not_home"
|
||||||
action:
|
action:
|
||||||
- service: script.routine_leaving_home
|
- service: script.routine_leaving_home
|
||||||
- service: script.telegram_say
|
- service: notify.telegram
|
||||||
data:
|
data:
|
||||||
title: "🏠 *Presence Module · Leaving Home*"
|
title: "🏠 *Presence Module · Leaving Home*"
|
||||||
message: "I see you're leaving. Goodbye!"
|
message: "I see you're leaving. Goodbye!"
|
||||||
@@ -101,7 +101,7 @@ automation:
|
|||||||
to: "on"
|
to: "on"
|
||||||
action:
|
action:
|
||||||
- service: script.routine_coming_home
|
- service: script.routine_coming_home
|
||||||
- service: script.telegram_say
|
- service: notify.telegram
|
||||||
data:
|
data:
|
||||||
title: "🏠 *Presence Module · Coming Home*"
|
title: "🏠 *Presence Module · Coming Home*"
|
||||||
message: "Welcome home!"
|
message: "Welcome home!"
|
||||||
@@ -114,11 +114,13 @@ automation:
|
|||||||
from: "work"
|
from: "work"
|
||||||
to: "not_home"
|
to: "not_home"
|
||||||
action:
|
action:
|
||||||
- service: script.telegram_say
|
- service: notify.telegram
|
||||||
data:
|
data:
|
||||||
title: "🏠 *Presence Module · Leaving Work*"
|
title: "🏠 *Presence Module · Leaving Work*"
|
||||||
message: "I see you're leaving work. Are you coming home?"
|
message: "Hey, I see you're leaving work. Are you coming home?"
|
||||||
inline_keyboard: "Yes:/leaving_home_routine, No"
|
data:
|
||||||
|
inline_keyboard:
|
||||||
|
- "Yes:/leaving_work_to_home, No:/do_nothing"
|
||||||
|
|
||||||
#
|
#
|
||||||
# ─── CUSTOMIZATION ──────────────────────────────────────────────────────────────
|
# ─── CUSTOMIZATION ──────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ automation:
|
|||||||
entity_id: input_boolean.guest_mode
|
entity_id: input_boolean.guest_mode
|
||||||
state: "off"
|
state: "off"
|
||||||
action:
|
action:
|
||||||
- service: script.telegram_say
|
- service: notify.telegram
|
||||||
data:
|
data:
|
||||||
title: "🛡 *Security Module · Door opened while away*"
|
title: "🛡 *Security Module · Door opened while away*"
|
||||||
message: "It seems like the front door was opened while you are away! Check the camera!"
|
message: "It seems like the front door was opened while you are away! Check the camera!"
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ script:
|
|||||||
{% if is_state('media_player.master_bedroom', 'playing')
|
{% if is_state('media_player.master_bedroom', 'playing')
|
||||||
or is_state('input_boolean.speech_notifications', 'off')
|
or is_state('input_boolean.speech_notifications', 'off')
|
||||||
or is_state('input_boolean.georgi_home', 'off') %}
|
or is_state('input_boolean.georgi_home', 'off') %}
|
||||||
script.telegram_say
|
notify.telegram
|
||||||
{% else %}
|
{% else %}
|
||||||
script.sonos_blast
|
script.sonos_blast
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -44,14 +44,6 @@ script:
|
|||||||
title: "💬 *Speech Module*" # For telegram only
|
title: "💬 *Speech Module*" # For telegram only
|
||||||
message: "{{ message }}"
|
message: "{{ message }}"
|
||||||
|
|
||||||
telegram_say:
|
|
||||||
alias: Speech · Telegram say
|
|
||||||
sequence:
|
|
||||||
- service: notify.telegram
|
|
||||||
data_template:
|
|
||||||
title: "{{ title }}"
|
|
||||||
message: "{{ message }}"
|
|
||||||
|
|
||||||
sonos_blast:
|
sonos_blast:
|
||||||
alias: Speech · Sonos blast
|
alias: Speech · Sonos blast
|
||||||
sequence:
|
sequence:
|
||||||
@@ -96,3 +88,17 @@ script:
|
|||||||
data_template:
|
data_template:
|
||||||
with_group: yes
|
with_group: yes
|
||||||
entity_id: media_player.master_bedroom
|
entity_id: media_player.master_bedroom
|
||||||
|
|
||||||
|
automation:
|
||||||
|
- id: speech_telegram_do_nothing
|
||||||
|
alias: Speech · Telegram · Action · Do nothing
|
||||||
|
trigger:
|
||||||
|
platform: event
|
||||||
|
event_type: telegram_callback
|
||||||
|
event_data:
|
||||||
|
command: "/do_nothing"
|
||||||
|
action:
|
||||||
|
- service: telegram_bot.delete_message
|
||||||
|
data_template:
|
||||||
|
message_id: "{{ trigger.event.data.message.message_id}}"
|
||||||
|
chat_id: "{{ trigger.event.data.chat_id }}"
|
||||||
|
|||||||
@@ -48,3 +48,30 @@ script:
|
|||||||
- delay: 00:00:02
|
- delay: 00:00:02
|
||||||
|
|
||||||
- service: script.music_play
|
- service: script.music_play
|
||||||
|
|
||||||
|
automation:
|
||||||
|
- id: leaving_work_to_home
|
||||||
|
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
|
||||||
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user