I have no clue on what system you are or what level of experience you have. So i just post a snapshot of how i solved some on my windows system.
Maybe it inspires you to find a similar solution ...
function GetCam(idx,naam,save)
local Cam = 'idx='..idx..'" -OutFile "cam/'..naam..'.jpg"'
commando = 'powershell Invoke-WebRequest -Uri "http://IP:Port/camsnapshot.jpg?'..Cam
os.execute(commando)
if (save) then
Cam = 'idx='..idx..'" -OutFile "cam/'..naam..now..'.jpg"'
commando = 'powershell Invoke-WebRequest -Uri "http://IP:Port/camsnapshot.jpg?'..Cam
os.execute(commando)
SendText('Beeld opgeslagen '..naam..now)
end
end
As you see i call a powershell --> IP:PORT are my domoticz IP and port , IDX is the IDX of the cam in domoticz.
sendtext just notifies my telegram the picture has been stored.
But this way you never capture the name.
So i suggest using a storing a second time to a fixed name (i do this also in the above example)
This way you store with date and time, but latest picture will always be available in snapshot.jpg
It should be doable to transform this into something you can use.
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
Thank you for the script, but i want to see the screeshot immidiatly, so i solved it like this.
(i'm no LUA expert, so did some copy/paste from other scripts) I do need to clean it up a bit
Basicly i did...
execute the URL with Curl for windows and store the result in "content"
modify "content" so only the path to the jpg is in a variable
added that path variable to the jpg after the camera's IP adress
create a notify variable for PushSafer with the complete location of the jpg
Update the uservariable in Domoticz
Send the notification