How to trigger an action that takes a snapshot of IPCamera for display in Sitemap?

Hello,

I would like to take a snapshot of the doorbell IPCamera every time the doorbell is pressed. I know I have to copy the image from the static image URL of the camera but I can’t figure out how to do so and where to save the picture locally so that I can load it in the Sitemap.

Appreciate the guidance

Cheers
Josh

The IPCamera binding has channels to achieve that, you can even send a short video sequence through an animated gif:

You will find a working example in the binding docs:

Hi,

My understanding is the example grabs the last gif snapshot and sends it to an external server but it doesn’t really work how I need it to. I would like to save the snapshot to /static/doorbell.gif or something that I can serve in the SiteMap even through OHCloud instead of just sending the last available file as an attachment before it is overwritten.

You can save the data to any local folder, check the option FFmpeg Output Folder in the Thing config.
I am sending a 5 sec animated gif to my phone via pushover if the doorbell rings.

The ffmpeg output file gets rewritten constantly every X interval, I only want it to save when someone presses the bell (or some trigger action). I can’t push to an external device because it needs to be viewed by people with no 3rd party devices as well.

I think this is the section that I need to explore. Will update again if it doesn’t work out.
IP Camera - Bindings | openHAB

OK, let me rephrase my setup for the IPCamera binding:

The doorbell button gets pushed, a gif is created locally on my openHAB server, I can put this on a sitemap or send it via notification service to my phone. The gif file gets overwritten the next time the doorbell button is pressed.

If this is not what you want you need to find another solution.

I am accessing my cams snapshot URL to take a picture on request to at the end send it via telegram.
Attached you can find the DSL rule that I use. While the bytestream object is base64 encoded to send it via telegram near to the end of the rule you would have to store it.
rule.txt (2.7 KB)

The cam provides a snapshot URL ? Then you may try the rule and modify it.
You also could use curl or wget together with executeCommandLine to take a snapshot and save in one call to a shell script.

You can trigger your camera to save/export/ftp-upload the current sensor image to /etc/openhab/html/cam or simply save the image via wget and store all filenames as a json or csv string in a seperate item.
A slider image reads the item and shows the pictures. Fairly easy. If you are interested leave a comment and I can post it here the next couple of days.