Send pic Telegram


(Djuscha) #1

From externally one can send so the picture by Telegram

sendTelegramPhoto(“Openhabbot”,“http://www.selfhost.eu/msubmenu=jpg”,null, “admin”, “pass”)

How is the code when I have the image in the tmp directory of Raspi /tmp/1.jpg?

if I try file: ///tmp/pic.jpg I get error message Invalid base64 image provided.


(Angelos) #2

check the last examples on: https://www.openhab.org/addons/actions/telegram/#send-an-image-to-telegram-chat

You can try another “trick” also: place the image in $OPENHAB_CONF/html and call it with a URL: http://localhost:8080/static/<image.jpg>

why not re-use the 2 year old thread? :slight_smile:


(Mark) #3

Alternatively, if on Linux you can create a symbolic link in $OPENHAB_CONF/html to the local directory where your images are stored. Having a symbolic link is especially useful if you have large images, or a lot of images, because it will keep your openHAB backups small. Well, maybe not small, but definitely smaller than they would be by putting the images in $OPENHAB_CONF/html. :wink:


(Djuscha) #4

how does it work ?


(Djuscha) #5

Nobody paid attention at that time.and now I’ll try that again with Openhab 2 :slightly_smiling_face:
Thank you very much I will test and report.


(Angelos) #6

let’s say you have a subfolder in /tmp/something/ with all your image files (e.g. hot.png)
you can create a symbolic link to that subfolder within $OPENHAB_CONF/html/ in order to avoid copying the image files to that destination

the command would look like this:

ln -s /tmp/something/ /etc/openhab2/html/

This will create the “virtual” subfolder /etc/openhab2/html/something/

then, you can call the files with:

http://OH2_IP:8080/static/something/hot.png

(Mark) #7

What he said above. :smile:


(Djuscha) #8

Everything works very well. Thanks to all