Thanks for the hint.
I have checked everything again very thoroughly and found the issue indeed in my openhab.cfg.
Some copy / paste issue with the chatID. So you were absolutely right! @paolo_denti.
It did not have anything to do with incompatibility of the different .jars.
I use the openHAB designer and with .cfg files there is obviously not a proper syntax handling!?
Which editor (within OH_Designer should I use?) - currently just text editor which somehow caused the issue.
Thanks @hakan & @watou as well.
Telegram action is included in 1.8 and not included in 1.7. So you can either build it on yourself or wait until the 11th of January, when the 1.8 will become official
I canāt get this to work. SendTelegram works great, but sendTelegramPhoto just doesnāt appear to do anything. Is there anything I can do to debug it?
[Edit] to expand! the image is accessed via a url like this āhttp://username:password@ipaddress/snapshot.cgiā I looks like this doesnāt work with sendMail either, so is that likely to be the issue?
This would not work with the sendMail action for the reason that the username:password@ part is not accepted by the external Java mail library. The current known workaround in that case is to attach the image from a simple URL (perhaps by first fetching the image to a /tmp directory using curl or similar, and then attaching it to the email with a file:///tmp/... URL.
You could try this approach with the Telegram action, and perhaps rename the file extension in the process (but I think the Telegram action is smart enough to figure out the fileās real type regardless of extension).
Looks like that is the issue. Itās a html page, with a img tag pointing really oddly to the same url. I can only imagine some sort of header is being sent when the request is for the image.
Iāll have a try and what @watou has suggested and use curl to dump the picture locally and see if that works.
Iāve made the change suggested by @watou and that works great for sendmail, but Iām guessing that telegram doesnāt accept file:///tmp/webcam.jpg as an input to the send picture command.
Iāve tested using the sample (open-hab logo) and that works fine, so Iām guessing the issue is loading from file://
i will implement an accept header from http url in order to accept only images.
This could solve issues similar to your one where probably the web server is sending back appropriate content depending on accept header
The problem is the following one: the schema of username and password in the url is managed by the browsers. It is not managed by the standard httpclient.
I added a method with basic authentication here (https://github.com/paolodenti/openhab), in branch "telegram"
It tested it and it looks working. If it works for you as well I will issue a pull request.
how to use it; the sendTelegramPhoto accepts two new optional parameters for basic auhentication (username and password)
sendTelegramPhoto(ābot1ā, āhttp://ipaddress/snapshot.cgiā, null, āusernameā, āpasswordā)
I just submitted a pull request that i tested on myself (setting up a basic authenticated server). As soon as it will be deployed by the jenkins you will find it in the builds.
I will then modify the wiki accordingly (after the pull request execution)
Iāve just had a little look here https://openhab.ci.cloudbees.com/ and couldnāt see anything obvious. Iāll take another look in a few hours and see if itās ready then (assuming thats the correct place to look!)