Have a dynamic bot to responde on therten state.
- alias: Telegram controle xyz
initial_state: 'on'
trigger:
platform: event
event_type: telegram_command
event_data:
command: /xyz
action:
- choose:
- conditions:
- condition: templete
value_template: "{{ is_state('automation.xyz', 'off') }}"
sequence:
- service: telegram_bot.send_message
data_template:
title: "xyz is *{{ states('automation.xyz') }}*"
message: Shall I turn it on?
inline_keyboard:
- Nope:/stop
- On:/xyz_on
default:
- service: telegram_bot.send_message
data_template:
title: "xyz is *{{ states('automation.xyz') }}*"
message: Shall I turn it off?
inline_keyboard:
- Off:/xyz_off
- Nope:/stop