Hi all,
I’m playing around with alerts and inline keyboards.
When the alert fires, I get the message which also contains two buttons: turn off and acknowledge
alert:
heater_office_on:
name: Heater Office is On
done_message: Heater Office is turned off, thanks!
entity_id: switch.shelly_1pm_04
state: 'on'
repeat:
- 15
can_acknowledge: true
skip_first: true
notifiers:
- telegram
data:
inline_keyboard:
- 'Acknowledge:/acknowledge_4'
- 'Turn Off:/turn_off_heater_4'
the two options of the inline keyboard are both handled by an automation, which either turns off the heater or turns off the alert.
alias: 'Telegram Callback Handler'
id: 'telegram_callback_handler'
trigger:
- platform: event
event_type: telegram_callback
action:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.event.data.command == '/turn_off_heater_4' }}"
sequence:
- service: switch.turn_off
entity_id: switch.shelly_1pm_04
- conditions:
- condition: template
value_template: "{{ trigger.event.data.command == '/acknowledge_4' }}"
sequence:
- service: alert.turn_off
entity_id: alert.heater_office_on
default:
- service: notify.telegram
data:
message: 'I can''t choose...'
This all works fine, except that I get the inline keyboard on the done message as well… Is there a way to avoid that?
Spiffo