Who does?
Hahahaha the longer I use HA the more I think I should…
Its gotten personal! I will dominate… adapt and overcome… eventually…
But I’ll settle for just getting it to work!
Again thanks for your help!
You’r very welcome!
Is there a way to send message / menu to multiple users ? I want to send my notification to myself and my wife.
Never tried it, but I guess you can add multiple users in the receiver/send nodes:
*Comma separated list of userId authorized to use the chatBot*
Was someone able to send videos recorded by a cam? Last time I tried it wasn’t possible:
“Error: EFATAL: Unsupported Buffer file-type”
It can be done with telegram_bot and a call service node. Make sure you set the bot up in YAML as “broadcast” instead of “polling” as it will cause conflicts with Redbot if not.
I’m trying to set this up but no matter what I do I end up with errors in NodeRed.
It must be something with its config because I was able to complete all six steps and I have received text with testing
When it comes to my NodeRed config:
I’m not sure where the problem lies as when I hit timestamp it records contents of the message in the log in my shared folder but the message is not forwarded to the telegram.
Also I get tons of polling errors:
error: [polling_error] {“code”:“EFATAL”,“message”:“EFATAL: Error: connect ENOENT /bot8888888:token/getUpdates”}
I do not get any output from Authorized node in debug nodes. Finally here is edited output from chatbot debug node in Nodered log in hassio:
-- OUTBOUND MESSAGE --
type: message
content: Hello, testing, testing
chatId: id_number
messageId: null
inbound: false
silent: false
fallback: null
options:
Error: EFATAL: Error: connect ENOENT /bot888888888:TOKEN/sendMessage
26 Oct 13:15:40 - [error] [chatbot-telegram-node:a9929f17.22e57] Error: EFATAL: Error: connect ENOENT /bot888888888:TOKEN/sendMessage
--------------------- ChatBot context (id:a60b8141.3a12b8) ---------------------
chatId: chatid number
userId: null
messageId: null
transport: telegram
authorized: false
pending: false
language: null
currentConversationNode: 24d49947.fea4ee
currentConversationNode_at: Sat Oct 26 2019 13:15:40 GMT+0100
--------------------- ChatBot message (id:a60b8141.3a12b8) ---------------------
type: message
content: Hello, testing, testing
chatId: id_number
messageId: null
inbound: false
silent: false
fallback: null
options:
Any advice would be really great, thx.
Do you have a Telegram bot setup with polling in your YAML config somewhere? If so, change it to broadcast and that will stop the errors. If that is the case, you’re basically running the same bot twice and it will cause issues sending messages.
I don’t think you need that conversation node either. Connect the authorized node directly to the text node.
No, I do not. I have set it up only in NodeRed.
Is it possible you have the bot running in both the development environment and the production environment, in different nodes?
Also, according to the error, it looks like its coming from chatbot-telegram-node:a9929f17.22e57. Have you looked at that one specifically? That doesn’t look like one of the send/receive nodes as that would be named chatbot-telegram-send or chatbot-telegram-receive.
I was running both in development and in production. I have changed it to development and there is no difference, I’m still getting polling errors.
That error points towards telegram config node on all flows. It disappears when I put authorized node after text node.
If I remove it then I don’t receive any messages on my debug node. I have changed the flow so it looks like below:
Since you mentioned Telegram bot setup in Yaml config, is it also required for this to work?
Yeah, with an inject node you need the conversation node, didn’t think of that earlier.
Setting it up in YAML is only if you want to use a call service node to send messages, rather than using Redbot like you’re doing. AFAIK, there’s no reason to have it setup in YAML if you are using REDBOT.
Are there any other telegram bot nodes other than Redbot that you’ve set up in testing?
I setup this telegram bot along side REdbot when I was testing and had a similar issue as you, after uninstalling it the issue went away
No, I don’t have any other bot nodes.
Did you check some basics first?
- Crucial: Did you send a first message with Telegram Messenger App to your bot for initiation of the user?
-
Suggestion: In your Telegram-bot setting you can add the logfile option. It will write all Telegram communication to a txt file on a specified location. It can be handy to watch what is happening and it even shows all non-authorized communication.
Synthax: <path_to_logfile_location>/<name_of_logfile> - Crucial: Make sure, when used in HA notification, the HA platform-settings used should be set to Broadcast and not to Polling or Webhook. [link]
FYI, the Authorized-node should only be used behind a Receiver-node. It should not be used for sending. When sending messages it is only sends messages to the user ID setting of the Sender-node
To be more clear, the Authorization-node is used to manage authorized/unauthorized request from the bot to Node-Red.
Option: If you have multiple users configured in the Sender-node (or none = visible to everyone/complete world!), but you only want to send a message to one specific user you should use a Coversation-node. Also when used as @PickleSlice mentioned.
Something another weird thing I noticed. Sometimes it will happen, by some reason, the conversation routing get stuck in a loop.
This can be noticed by setting a debug node connected directly to the Receiver-node and watch the Node-Red debug-tab.
When sending a message with the Telegram Messenger app and no data will be shown, you should check the Node-Red Telegram-bot Context settings:
- Set the Context Type settings to Memory
- Force Node-Red to deploy settings again (move some node, for example, if needed).
- Do a Full-Deploy
Now Node-Red will reset the Telegram-bot Context-memory and sometimes things come to live again.
Just something I want to share, maybe it can help you solve some strange problems…
To add-on to what @Domoticon said, starting over is sometimes the way to go, as it undoes anything that you might have missed.
Just a simple question…Am I supposed to have to manually ~regexp away all “underscore” characters in my outgoing messages to telegram users?
Since my telegram notifier chokes on them
The log says (when sending the text “test3_”):
[homeassistant.components.telegram_bot] Error sending message: Can't parse entities: can't find end of the entity starting at byte offset 5.
I know the underscore is a markdown char, but should the ha-logic choke on it?
I can survive it now, by adding “| replace” to all my strings I send, but it feels a bit annoying, so I cant help but wonder if it is working as designed…
Br,
Taisto
OK, I have decided to start again from scratch (third time).
- Created new bot
- Saved new token.
- Sent a message to my new bot.
- Since the first method in step five never worked for me I used the alternative way to obtain my user ID
- Used this link:
https://api.telegram.org/bot<AUTHENTICATION_TOKEN>/sendMessage?chat_id=<USER_ID>&text=testing
to send URL in my web browser. Received reply message from my bot with text testing.
So far the above worked for me every time. It is only when I move to NodeRed I start to get errors.
In node red in the sender node I have filled following fields:
- Bot-Name with @my_bot_username
- Token with my token
- Users with my username obtained in step 3.
- typed in the path to my telegram log in my hassio shared folder: /share/telegram/telegram.log
- changed Parse to html
- Made sure my bot configuration is for development mode only and not both.
Here is my flow (without the authorization node):
and here is the output from my telegram.log
My_userID < [TELEGRAM] Sun Oct 27 2019 17:11:54 GMT+0000 - Testing, testing, testing
The error from the flow which points to the: 75b9a33a.4b256c node and when I click on it, it points here:
I have no clue why this doesn’t work.
Compare what you’re doing to a write up that I did. Maybe you’re missing a step somewhere?