Camera Snapshots from node red

Thanks Kermit! This works for me.

In a few times, it failed to get the snapshot. Is it possible to try take another if it is failed? And is there any node that we can save the image to a folder with timestamp?

Thank you.

I use the call service node to call camera.snapshot, filename: ā€œwww/whatever.jpgā€ (create the www dir in your config dir), and then pass url https://your_ha_host:port/local/whatever.jpg

1 Like

yes I got it but had to install a third node to use my url picture has ā€œbase64ā€ because watson dont handle the url or other kind of payload :frowning:

[{"id":"5b275441.c28e9c","type":"debug","z":"bbc1256d.2b84a8","name":"Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1050,"y":400,"wires":[]},{"id":"7752e2db.0dd9b4","type":"visual-recognition-v3","z":"bbc1256d.2b84a8","name":"","vr-service-endpoint":"https://gateway.watsonplatform.net/visual-recognition/api","image-feature":"classifyImage","lang":"fr","x":470,"y":160,"wires":[["5b275441.c28e9c"]]},{"id":"8ff64a53.397dc8","type":"inject","z":"bbc1256d.2b84a8","name":"","topic":"","payload":"/share/preau.jpg","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":160,"wires":[["28df0478.04cf2c"]]},{"id":"28df0478.04cf2c","type":"jimp-image","z":"bbc1256d.2b84a8","name":"","data":"payload","dataType":"msg","ret":"buf","parameter1":"200","parameter1Type":"msg","parameter2":"200","parameter2Type":"msg","parameter3":"800","parameter3Type":"msg","parameter4":"600","parameter4Type":"msg","parameter5":"","parameter5Type":"msg","parameter6":"","parameter6Type":"msg","parameter7":"","parameter7Type":"msg","parameter8":"","parameter8Type":"msg","parameterCount":0,"jimpFunction":"none","selectedJimpFunction":{"name":"none","fn":"none","description":"Just loads the image.","parameters":[]},"x":290,"y":160,"wires":[["7752e2db.0dd9b4","b7f76003.86cca"]]},{"id":"74179799.a5cfd","type":"inject","z":"bbc1256d.2b84a8","name":"","topic":"","payload":"/share/salon.jpg","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":220,"wires":[["28df0478.04cf2c"]]},{"id":"b7f76003.86cca","type":"image viewer","z":"bbc1256d.2b84a8","name":"","width":160,"data":"payload","dataType":"msg","x":480,"y":260,"wires":[[]]},{"id":"c4988e25.f2e44","type":"inject","z":"bbc1256d.2b84a8","name":"","topic":"","payload":"/share/atelier.jpg","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":280,"wires":[["28df0478.04cf2c"]]}]

This is my node :wink:
Good luck

Ps: it work, I mean watson recognise my car but on the edge only, firstly the picture was taken from the upper backā€¦ Was not fine lol

My flow to send a camera image to my email when the alarm is disarmed no longer works. Getting the error " The websocket command ā€˜camera_thumbnailā€™ has been deprecated. " in HA. What is the correct format to grab the image in Node red now? I have tried camera_snapshot and camera.snapshot. they do not work.

image

I know this is an old topicā€¦

Is there a way to save locally or send via telegram the camera snapshot, using this flow?

Thanks

This is what I ended up doing:

1 Like

Yes there is. I have a flow like this set up buy it has stopped working. The issue I have is the snapshot call service node does not save the image any more

THX for your hints, works perfect with my IP Cam to get an jpg file as well as sending this via mail.

ā†’ I look now for an opertunity to grap an forward several pictures, even better to grap and send a smal video. Hints how to would be highly appreciated.

THX M

Greetings All,

I am currently in search of a method to accomplish to same result only instead of an email, I am attempting to have the HA Companion App on my Android device display the notification with an image.

I am able to get as far as having a snapshot taken, and a prompt sent to my phone; though sadly no thumbnail/image is visible.

What are your thoughts?

[{"id":"2e8b5d92a1e3273e","type":"tab","label":"Sandbox","disabled":false,"info":"","env":[]},{"id":"a057ef5eddb425a9","type":"api-call-service","z":"2e8b5d92a1e3273e","name":"Notify Rob's Phone","server":"59c431be.e53a8","version":3,"debugenabled":false,"service_domain":"notify","service":"mobile_app_oneplus_7_pro","entityId":"","data":"{\"title\":\"HA - Notification\",\"message\":\"Trigger Garage Door?\",\"data\":{\"attachment\":{\"content-type\":\"jpeg\",\"image\":\"https://cdn.sparkfun.com/assets/learn_tutorials/9/0/0/home_assistant.jpg\"},\"actions\":[{\"action\":\"Garage_Door\",\"title\":\"Yes Please\"}]}}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":750,"y":180,"wires":[[]]},{"id":"0e5b4d8f24545df7","type":"inject","z":"2e8b5d92a1e3273e","name":"Manual Test","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":180,"wires":[["d1f37f26ee819d43"]]},{"id":"d1f37f26ee819d43","type":"api-call-service","z":"2e8b5d92a1e3273e","name":"Take Snapshot","server":"59c431be.e53a8","version":3,"debugenabled":false,"service_domain":"camera","service":"snapshot","entityId":"camera.garage","data":"{\"filename\":\"/config/www/garage_snapshot.jpg\"}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":340,"y":180,"wires":[["9f91c3f94d1c06da"]]},{"id":"9f91c3f94d1c06da","type":"delay","z":"2e8b5d92a1e3273e","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":540,"y":180,"wires":[["a057ef5eddb425a9"]]},{"id":"59c431be.e53a8","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

Note: I replaced my local image URL with this image for testing.
https://cdn.sparkfun.com/assets/learn_tutorials/9/0/0/home_assistant.jpg

Thank you for any suggestions,
Rob

Issue resolved!
It was a matter of proper formatting.

Flow Overview:

Call Service Node:

Feel free to import this template and apply to your own use case.

[{"id":"206f8fe0defc3dab","type":"api-call-service","z":"2cbd4bd1825e9d2d","name":"Notify Rob's Phone","server":"59c431be.e53a8","version":3,"debugenabled":false,"service_domain":"notify","service":"mobile_app_oneplus_7_pro","entityId":"","data":"{\"title\":\"House - Notification\",\"message\":\"Trigger Garage Door?\",\"data\":{\"actions\":[{\"action\":\"Garage_Door\",\"title\":\"OPEN / CLOSE\"}],\"image\":\"https://raw.githubusercontent.com/home-assistant/assets/master/logo/logo.png\"}}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":670,"y":80,"wires":[[]]},{"id":"59c431be.e53a8","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
3 Likes

Okay, this is weirdā€¦ have been trying to get camera snapshot to my Android device for about the whole morning and nothing I tried seemed to work.
In the end I saved the snapshot name without and underscore (_) in the filename and all of a sudden it works.

File stored in www folder is publicly reachable through https://mydomainname/local/filename.jpg and is viewable. If however there is an underscore in the name the file is just not viewable anymore. Not in a browser, not in a notification. So https://mydomainname/local/file_name.jpg does not work altough the file is actually in the folder.