I have a rule which is triggered when someone pushes the doorbell. The rule grabs a snapshot of my camera and sends a notification via Pushover and e-mail. This worked fine until some weeks ago. Sometimes (half of the time), I don’t see any image in Pushover and the image in the e-mail is not able to open. When I go to the location of the jpg which needs to be send, it’s 0kb…
I don’t know but you don’t need to call external programs to fetch web data, there’s builtin http commands. Probably easier to debug so give that a try.
But then what do you do with it … or more importantly, when do you do it? It takes time to write the file away, you might need a short wait before trying to use it.
Some cameras will when busy reply with a http 503 and not send the jpg. If that is the cause the ipcamera binding will solve the issue as it stores and sends the last good jpg from ram instantly when asked.
If you did what @5iver suggested you would see the 503 reply and it is best to diagnose an issue first.
EDIT:
I happen to have an example in my rules you can adapt…
val String result=executeCommandLine("mv /tmpfs/Doorbell/"+TimeStamp.toString+".mp4 /etc/openhab2/html/Doorbell/"+TimeStamp.toString+".mp4", 500)
logInfo("MovingFile", "Command line result: {}",result)
The above will only create a log when something goes wrong with the move command which can be very handy.