[SOLVED] [telegram] 404 error


(Homer Sim) #1

Hi,

This is my config:

# Read http://www.instructables.com/id/Telegram-Bots-for-beginners/
# to see how to set up bots and find your chat ids
# bots=bot1,bot2
bots=heinz,kathleen
# Handy Heinz S7 Active
heinz.chatId=7XXXXXXX7
heinz.token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Handy Kathleen iPhone
kathleen.chatId=7XXXXXXX7
kathleen.token=XXXXXXXXXXXXXXXX

and this is my rule entry:

sendTelegram("heinz", "Trockner ist fertig!")
sendTelegram("kathleen", "Trockner ist fertig!")

But I am receiving in openhab log this error:
[WARN ] [ab.action.telegram.internal.Telegram] - Method failed: HTTP/1.1 404 Not Found

Do you know where to look for a solution?

Thanks


(CM6.5 H102) #2

Install the HTTP binding from PaperUI


(Homer Sim) #3

it is already installed since ages …


(Vincent Regaud) #4

Try adding a - in front of the chatId

# Read http://www.instructables.com/id/Telegram-Bots-for-beginners/
# to see how to set up bots and find your chat ids
# bots=bot1,bot2
bots=heinz,kathleen
# Handy Heinz S7 Active
heinz.chatId=-XXXXXXXX
heinz.token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Handy Kathleen iPhone
kathleen.chatId=-XXXXXXXX
kathleen.token=XXXXXXXXXXXXXXXX

@H102
The 404 error comes from telegram responding that the binding asked for an address it couldn’t find.
Nothing to do with the http binding

I assume that your tokens are correct.


(Homer Sim) #5

I created and checked them according the action description


(Homer Sim) #6

And I tried it right now again with success


(Vincent Regaud) #7

Yeah!!
Please mark the thread as solved.
The telegram API is not always fully available and you can’t get 404 for that reason too.


(Homer Sim) #8

Maybe I was not precise enough. The check of the https://api.telegram.org/bot<token>/getUpdates was successful
But I still receive the 404 error message and no notification


(Vincent Regaud) #9

Did you change the tokens with a - in front?


(Homer Sim) #10

it is like this
https://api.telegram.org/bot7XXXXXXX7:AXXXXXXXXXXXXXXXXXXXXXXXXXX8/getUpdates


(Vincent Regaud) #11

Did you change the tokens with a - in front if the telegram.cfg?


(Homer Sim) #12

It is like shown in post 1 there is no -


(Vincent Regaud) #13

Sorry, the chatIds

put a - in front:

# Read http://www.instructables.com/id/Telegram-Bots-for-beginners/
# to see how to set up bots and find your chat ids
# bots=bot1,bot2
bots=heinz,kathleen
# Handy Heinz S7 Active
heinz.chatId=-XXXXXXX
heinz.token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Handy Kathleen iPhone
kathleen.chatId=-XXXXXXXX
kathleen.token=XXXXXXXXXXXXXXXX

(Homer Sim) #14

no effect


(Vincent Regaud) #15

I don’t know buddy…
Works here… Just tested


(Homer Sim) #16

is there a log dedicated to telegram with more information?


(Vincent Regaud) #17

Have you searched the forum?


(namraccr) #18

Logging for telegram works exactly the same as logging for all of the other actions/bindings.


(Miika Jukka) #19

Try to configure only with one bot and see if that works. You can also test by sending the telegram to your group name ‘bots’.


(Mihai Badea) #20

The dash (-) in front of the chatId is a MUST for group chats. For a regular chat, there is no dash.

You might want to look to the config of the telegram action. Maybe you tested more config’s and the action didn’t save properly the new one.
Take a look here HowTo: Manage OpenHab 2 configurations, section Some useful Karaf console commands.
Try and view the current telegram config in karaf console:

config:list "(service.pid=org.openhab.telegram)"

If the displayed config doesn’t match the one from telegram.cfg you should delete it and let the action re-load the config from file by restarting openHAB.