I’m new to home assistant and node-red. But I already managed to made quite a few nice automations. Only now I have something that I can’t figure out. Hopefully someone can tell me where this goes wrong.
I will explain the step-by-step guide of what I have done.
First I created the cameras in home assistant via motioneye:
Then in Node-RED I have made the following simple flow.
Which works! Because I do receive a snapshot in Telegram.
The only problem is that I don’t receive it from Camera1:
But after I click on timestamp I see two green dots at “take snapshot” and at “send photo”.
Only now nothing is happening. Nothing is coming in on Telegram now. If I put it back to “www” it works and I do receive a photo via telegram. Only from camera4 and not from camera1 as I indicate the flow.
So unfortunately it is not the solution for me or I must have done something wrong.
I even tried it by changing “filename” to “file”. As you typed in your post, but then I get an API error.
The change to local is explained in the companion app wiki. It may only need to be changed if you send it a pic to the app, I am not sure that it applies to telegram. One thing to try place a pic in the www folder. Then in a browser use http://your.ha.ip:8123/local/pic_name.jpg You should see the pic in the browser.
You should also add the file type eg .jpg after the file name. Lastly go to dev tools and use call_service/send_photo try to send the photo from ha to make sure there isn’t another problem outside NR
It now works!
Did a lot of trouble shooting, the “local” will not work only.
This must be “www”, is this a problem to keep it “www”.
(because it works now)
This is how it looks now: {"filename":"/config/www/snapshot.jpg"}
There is a general problem with the www folder, it’s not protected by home assistant authentication. If you use https vs a VPN, if someone had the address they would be able to view the folder. If you’re on a VPN and your instance is not exposed to the internet it’s much less of a problem.
There are 2 ways to handle this. Since it doesn’t seem you are saving this for any period of time aside to send a text, you can use the entity picture.
I was referencing your response. If the intent here was to change for security reasons ie you want the pictures protected by home assistant, then changing from www to local will not protect the files.
To protect the files, they need to be stored in the media folder.
You should consider using /media vs /www to store your snapshots. www has no authentication and is exposed to the internet. media is protected by HA authentication.