Telegram automations
To enable telegram automations, add the following to your customize.yaml
:
customize.yaml
person.<<person-name>>:
telegram_id: <<persons-telegram-chat-id>>
Also add the following automation to enable the cancellation:
Automation: Telegram Cancellation
To cancel automations using Telegram (in case of misfires), set up an automation that listens for the /cdu
command (cdu
is for “cancel door unlock”, but thanks to message size limits for telegram callbacks, this has to be short)
The automation could look like this:
alias: "Lock: Cancel unlocking"
description: ""
trigger:
- platform: event
event_type: telegram_callback
event_data:
command: /cdu
condition: []
action:
- service: automation.turn_off
data:
entity_id: "{{ trigger.event.data.args[0] }}"
stop_actions: true
- service: automation.turn_on
data:
entity_id: "{{ trigger.event.data.args[0] }}"
- service: telegram_bot.edit_message
metadata: {}
data:
message_id: "{{ trigger.event.data.message.message_id }}"
chat_id: "{{ trigger.event.data.chat_id }}"
inline_keyboard: []
message: |
Unlocking cancelled.