Add telegram automation for leaving work

This commit is contained in:
2020-03-11 22:39:00 +02:00
parent e9a232e4d6
commit fd0668c0e6
5 changed files with 56 additions and 19 deletions
+9 -7
View File
@@ -65,7 +65,7 @@ automation:
entity_id: input_boolean.georgi_home
state: "off"
action:
- service: script.telegram_say
- service: notify.telegram
data:
title: "🏠 *Presence Module · Arrival detection*"
message: "Device marked as home. Waiting for door to open!"
@@ -74,7 +74,7 @@ automation:
timeout: 00:15:00
- service: input_boolean.turn_on
entity_id: input_boolean.georgi_home
- service: script.telegram_say
- service: notify.telegram
data:
title: "🏠 *Presence Module · Arrival detection*"
message: "✅ Hey, I've marked you as home now!"
@@ -88,7 +88,7 @@ automation:
to: "not_home"
action:
- service: script.routine_leaving_home
- service: script.telegram_say
- service: notify.telegram
data:
title: "🏠 *Presence Module · Leaving Home*"
message: "I see you're leaving. Goodbye!"
@@ -101,7 +101,7 @@ automation:
to: "on"
action:
- service: script.routine_coming_home
- service: script.telegram_say
- service: notify.telegram
data:
title: "🏠 *Presence Module · Coming Home*"
message: "Welcome home!"
@@ -114,11 +114,13 @@ automation:
from: "work"
to: "not_home"
action:
- service: script.telegram_say
- service: notify.telegram
data:
title: "🏠 *Presence Module · Leaving Work*"
message: "I see you're leaving work. Are you coming home?"
inline_keyboard: "Yes:/leaving_home_routine, No"
message: "Hey, I see you're leaving work. Are you coming home?"
data:
inline_keyboard:
- "Yes:/leaving_work_to_home, No:/do_nothing"
#
# ─── CUSTOMIZATION ──────────────────────────────────────────────────────────────
+1 -1
View File
@@ -109,7 +109,7 @@ automation:
entity_id: input_boolean.guest_mode
state: "off"
action:
- service: script.telegram_say
- service: notify.telegram
data:
title: "🛡 *Security Module · Door opened while away*"
message: "It seems like the front door was opened while you are away! Check the camera!"
+15 -9
View File
@@ -36,7 +36,7 @@ script:
{% if is_state('media_player.master_bedroom', 'playing')
or is_state('input_boolean.speech_notifications', 'off')
or is_state('input_boolean.georgi_home', 'off') %}
script.telegram_say
notify.telegram
{% else %}
script.sonos_blast
{% endif %}
@@ -44,14 +44,6 @@ script:
title: "💬 *Speech Module*" # For telegram only
message: "{{ message }}"
telegram_say:
alias: Speech · Telegram say
sequence:
- service: notify.telegram
data_template:
title: "{{ title }}"
message: "{{ message }}"
sonos_blast:
alias: Speech · Sonos blast
sequence:
@@ -96,3 +88,17 @@ script:
data_template:
with_group: yes
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 }}"