How to connect telegram to "conversations"

Hi everyone,

I’m trying to connect telegram to HA “conversation” in order to chat with openAI using telegram bot.

It’s easy to set up an automation to send requests from telegram to conversation with the service conversation.process but struggling to do the opposite, get the text provided by conversation and send it to telegram.

I assume there should be an event firing upon conversation’s response but I can’t find any.

Any ideas?

I just went through this for Matrix, but it should work about the same for Telegram. Add processed event for conversation by al-one · Pull Request #89839 · home-assistant/core · GitHub adds a conversation_processed event which then makes it easy to backfeed the reply with a second automation. The PR isn’t merged yet, but you can test it by copying over the conversation component under custom_components and adding a dummy version field to its manifest (as otherwise it’ll fail to load per Integration Manifest | Home Assistant Developer Docs).

1 Like