This blueprint is useful to wait for a telegram_text event and store the received text message into an input_text entity. Can be filtred by user_id and chat_id.
Input_text entity : REQUIRED. Select an input_text entity to store the message into.
Remove received message?: Activate this toggle to delete the received message from chat. Useful for private or secret messages (alarm codes, passwords…).
Thanks for the blueprints, they make it easier to deal with the bot. But I have another problem: as soon as I send commands to Home Assistant via the app, everything works and Telegram responds to the chat. But I also want to send commands via Tasker (i.e. the API with POST) and here Home Assistant does not respond, as these messages are apparently sent as a bot in the chat.
My question: Is there a solution for this at all? Or does it have something to do with the authorisation? In configuration.yaml I have:
rest_command:
assist_request:
url: "http://192.168.xxx.xxx:8123/api/conversation/process"
method: POST
headers:
authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... SZE8
accept: "application/json, text/html"
payload: '{"text": "{{ text }}","language": "{{ language }}"}'
content_type: 'application/json; charset=utf-8'
verify_ssl: true
I don’t use tasker, so I cannot help you so much. If you have problems with the authentication, you could check this tutorial: ⚙️ Using Tasker with Home Assistant (V2)
Or you could also use webhooks to trigger automations in Home Assistant: Automation Trigger - Home Assistant instead of communicating directly.
First of all, I just wanted to say thanks for your work with all of your Blueprints so far! Second, is there any way that this can work with groups as well? Or am I missing something? Given that I just woke up and have yet to clear the fog 100% I could just be missing something. Thanks for your time!
Hi @Zashtys ! Thanks for finding this blueprint useful!
This blueprint should work with groups. If you’re trying to filter a group ID, just remember that in Telegram, group IDs begin with - (full example: -123456789). If you’re trying to execute a Home Assistant action from a group chat with a Telegram command, I recommend using this other blueprint: Telegram Bot: Respond to Telegram Command by executing an action
If you explain me what you’re trying to do, I can try to help you with the set-up.
I tried to reproduce your issue, but I don’t get the problem you explain.
Keep in mind that this script finished when a text message is received. If you immediately send a second message, it won’t be stored unless you run the script again first. Can it be part of the issue?
I don’t know if this is what you’re trying to do, but if this is the case, I guess a possible solution would be to call the script on every change in the input_text entity. It could be done with an automation like this one:
Hi @maverik360 , sorry for my super late response (I’ve been busy…).
This script is going to store the text received on Telegram AFTER you turn on the script. The timeout is the time the script is waiting for receiving a text message. So, you should set up a new telegram command (such as /memo) that will run the script. You can do it with this other blueprint: Telegram Bot: Respond to Telegram Command by executing an action . Then, when you type /memo on your telegram, the next message you send will be stored to an input_text entity.