Telegram bot cant send messages with "_" (underscore)

I’ve just set up the telegram bot integration, and stumbled onto the fact that I cant send messages containing “not_home”.

I was trying to troubleshoot the automation for a while with help from discord, but now I’ve tested using the service-feature of the developer section.

Sending any message with “_” fails as can be seen at:

I added the data:

{'target': [chat-id], 'message': 'A is a_b'}

In the service-data section, and the debug log says:

" can't find end of the entity starting at byte offset 6"

Surely this is a bug?

It took me a while but… Since “_” is a markdown syntax letter, thats whats effing it up… with a |replace("_"," "), it works fine :slight_smile:

Sorry for reviving this old thread, but how is this considered solved?

I am sending sensor information to my chat to process it further. Doing a replace and thereby changing the data makes this impossible to work :frowning:

Or has this bug be fixed by Telegram ?


But its not a bug, its a feature :slight_smile:

Telegram parses your text as markdown text, and then some chars will be interpreted accordingly.

What you can do, is to send messages with html as the parse_mode instead, as long as the data you sent, doesnt contain things that will be interpreted as html…