[SOLVED] [telegram] 404 error


(Angelos) #21

there is also a new method to “enforce” cfg parameters:
place as the first line of the cfg file the service pid and it will cleanly reload the parameters

pid:org.openhab.telegram

(Homer Sim) #22

Thanks all,
a lot of approaches which I will test at home after work!

I will report


(Homer Sim) #23

I did this and there is an additional bot1 entry

   bot1.chatId = 7XXXXXX7
   bot1.token = AXXXXXXXXXXXXXXXXXXXXXXXXXX8
   bots = heinz,kathleen
   heinz.chatId = 7XXXXXXXXX4
   heinz.token = AXXXXXXXXXXXXXXXXXXXXXXXXXX8
   kathleen.chatId = 7XXXXXXXXX7
   kathleen.token = AXXXXXXXXXXXXXXXXXXXXXXXXXX8
   service.pid = org.openhab.telegram

I deleted my telegram.cfg file and restarted the openhab container. Is it expected to rebuild a fresh cfg file? It did not happend …


(Homer Sim) #24

this worked to update the cfg infomation.

now only one bot is defined but I am still have a
Method failed: HTTP/1.1 404 Not Found
error in the logs.

May I ask for the debug logging where I have to add this, I am really having a hard time to understand the openhab page about logging …


(Angelos) #25

no, the cfg files in $OPENHAB_CONF are created only when you install the binding (and they are empty with some sample data). They are not recreated if you delete them. You need to recreate it.

If on Linux: openhab-cli console, then:

bundle:list -s |grep telegram
log:set DEBUG org.openhab.telegram
(or... not sure)
log:set DEBUG org.openhab.action.telegram

(Homer Sim) #26

I did the debug thing, both of them. but there is still no more in the openhab.log …

2018-11-05 21:00:30.981 [INFO ] [egram.internal.TelegramActionService] - Bot heinz loaded from config file
2018-11-05 21:01:09.374 [WARN ] [ab.action.telegram.internal.Telegram] - Method failed: HTTP/1.1 404 Not Found


(Homer Sim) #27

Sorry for coming back but I am a little lost.

I tried now this command in browser and it worked

https://api.telegram.org/bot7"Bot-ID"7:A"Bot-Token"8/sendMessage?chat_id=7User-Chat-ID4&text=testChat

In the cfg file we are just defining the “User-Chat-ID” and the Bot-Token … ?! right?
Where does the Bot-ID come from?

Right now when i was typing this message I had an idea.

The HTTP API Token which I received by creating a new bot is like this:
7777777777:ABGHSAGDJH(/88(sdfsd

Do I have to put the complete thing into this config line?
heinz.token=7777777777:ABGHSAGDJH(/88(sdfsd

or is it only
heinz.token=ABGHSAGDJH(/88(sdfsd


(Homer Sim) #28

OMG …

That was too easy to be seen …

SORRY now it is working …


(Angelos) #29

post the proper & working telegram.cfg now for others to see :slight_smile: (by the way: mask confidential info)
I don’t use this specific action https://www.openhab.org/addons/actions/telegram/


(Homer Sim) #30

This is now my working telegram.cfg:

bots=heinz,kathleen

# Handy Heinz S7 Active
heinz.chatId=7XXXXXXXXXX4
heinz.token=7YYYYYYYY7:ABBBBBBBBBBBBBBBBBBBBBBBBBBB8

# Handy Kathleen iPhone
kathleen.chatId=7ZZZZZZZZZZZ7
kathleen.token=7YYYYYYYY7:ABBBBBBBBBBBBBBBBBBBBBBBBBBB8