Download Image with a rule?


is it possible to download a image with a rule and rename it after download?


On what system? You can create a script bash/python/node/etc and trigger/run them with the Exec binding

on my raspberry (openhab server)

background is this:

so, i need a solution in openhab, if possible.


i try this, but will not work

rule "download image"
when Time cron "0/30 * * * * ?"
executeCommandLine("curl -L '' -o /home/openhabian/repetier.jpg")

LOG is good, no error

2018-03-14 21:56:30.036 [INFO ] [] - executed commandLine 'curl -L '' -o /home/openhabian/repetier.jpg'

but there is no download

if i use the command in my ssh-terminal, it works fine

[21:53:28] openhabian@openHABianPi:/tmp$ curl -L '' -o /home/openhabian/repetier.jpg
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  453k    0  453k    0     0  5691k      0 --:--:-- --:--:-- --:--:-- 5815k
[21:57:38] openhabian@openHABianPi:/tmp$

Does your openhab user have write permissions on the openhabian folder?

I suppose you’re trying to show the image on your screen?


i think so, i had try the openhabian home path and tmp folder. both dont work


yes, but the url is dynamic. the first attempt is to download the image via a rule. the
second to change the url to the correct path (the ID in my path can be different)

but, i ve now problems with the first step.

What UI are you using?

Maybe take a look at this post.


Give the command some time to execute:
Add time at the end, 5s should be sufficient:

executeCommandLine("curl -L '' -o /home/openhabian/repetier.jpg", 5000)

1 Like

works, thx

but next problem, how can i add a local image to openhab?
image is in tmp folder

Image url="/tmp/repetier.jpg" refresh=10000

this dont work

Put the image in the conf/html folder

Yup. Thats what I would do.

Or you can use HABPanel and use the URL ( itself on an image widget