Is it possible to send a telegram actionable message with a picture? It seems it should be possible from the docs, but I cannot get it to work. Here’s what I’ve tried:
action:
- service: telegram_bot.send_message
data_template:
title: "Garage Door Open"
message: "{{ trigger.to_state.attributes.friendly_name }} is {{ trigger.to_state.state }}! Do you want to close it?"
inline_keyboard:
- "Yes:/closegarage_double, No:/do_nothing"
data:
photo:
- url: !secret hik_garage_pic
Currently, I’m working around this issue by sending to notifications
action:
- service: telegram_bot.send_message
data_template:
title: "Garage Door Open"
message: "{{ trigger.to_state.attributes.friendly_name }} is {{ trigger.to_state.state }}! Do you want to close it?"
inline_keyboard:
- "Yes:/closegarage_double, No:/do_nothing"
- service: notify.telegram_jon
data:
title: "garage door open2"
message: "2nd message"
data:
photo:
- url: !secret hik_garage_pic
- service: notify.telegram_argy
data:
message: 'This is a message. {{states.sensor.balcony_temperature.state}}'
data:
inline_keyboard:
- 'Yes:/answeryes, No:/answerno'
photo:
file: /home/homeassistant/.homeassistant/www/images/snapshot.jpg
caption: 'This is the caption. {{states.sensor.balcony_temperature.state}}'
Take a note: The message doesnt show up anywhere, but you cannot ommit it… The caption is what you see in the telegram. Also, you dont have to use data_template. It works without it.
Another note: use the correct path and make sure you have whitelisted it. Take a look at the bottom of this page:
EDIT: Or use the url in your case (which I didnt notice )
Slightly off topic but kinda not , does anyone know how to include emojis in a Telegram message? I’ve tried countless methods based on some Internet searching but nothing I do works.
Well, I am not really sure how triggers work in a template, so I wont confuse you more with this, but I will just assume it needs to get the trigger from somewhere, and there is nothing in your action that specifies it… Nevertheless, I am only making assumptions here… Cant say for sure… Maybe someone else can help you here.
BUT, if you just use a state template like my example above, you will see it is working. So, templating works fine without using data_template.
EDIT:
This guy here just made the real question. Follow his thread to get an answer. I think this is what you are looking for.