- alias: Reminder_if_tomorrow_is_black_bins
trigger:
platform: template
value_template: >
{% set d = (strptime(states('sensor.testbin_d'), '%d/%m/%y').timestamp() - 24*60*60)|timestamp_custom('%Y-%m-%d') %}{{ states('sensor.date_time') == d ~ ', 21:00' }}
action:
- service: telegram_bot.send_message
data_template:
title: 'Black Sacks'
target: x-x-x-x-x-x
message: 'Black sacks waste collection tomorrow! Do you want a reminder?'
inline_keyboard:
- "Yes 30 Minutes:/30m, Yes 1 Hour:/1h, Yes In the morning:/8h"
- "No need!:/removekeyboard"
- id: 'telegramrepeat30m'
alias: 'Telegram callback to repeat message in 30 minutes'
hide_entity: true
trigger:
platform: event
event_type: telegram_callback
event_data:
data: '/30m'
action:
- service: telegram_bot.answer_callback_query
data_template:
callback_query_id: '{{ trigger.event.data.id }}'
message: 'OK, reminding you in 30 minutes'
- service: telegram_bot.edit_replymarkup
data_template:
message_id: '{{ trigger.event.data.message.message_id }}'
chat_id: '{{ trigger.event.data.user_id }}'
inline_keyboard: []
- delay: '00:30:00'
- service: notify.telegram
data_template:
data:
message: '{{ trigger.event.data.message.text }}'
Should this be enough to trigger the alert repeating after 30minutes? Because whilst the keyboard disappears and I get the “OK, reminding you in 30 minutes” - but I have never had a reminder. It’s based on the @Kallb123 guide - but I’ve had to modify that quite a bit to get it to work even to the extent it is now, I presume because lots has changed since he wrote the guide.
Thanks