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
+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 }}"