For some time, I have had a mounted windows nas folder in my home assistant system that has camera footage from my various linked cams.
I now have another cam that is battery powered but does have an email facility. This has allowed me to create a node-red that will read the appropriate emails, extract the attachment and save in a local folder in home assistant. Ideally, this should be saved to the mapped folder share so that the videos are loaded with the share and thus are available in the same media folder.
So far, I have only used this mapped nas share in the media dashboard. I now want to be able to write to folders in this share. Is this possible and, if so, how do I refer to the folder path?
This obviously mounts in the folder /config/cameras/ in HA.
The subfolder on the NAS that I want to save files in is GardenEnd/Video/
So, in my head, the full folder path should be something like /config/cameras/GardenEnd/Video/
As this is not a physical folder in HA (well, not beyond the “cameras” folder), I am not sure if this is accessible. I would need to use this in a Write File node.
OK. It may take me some time to get around to posting my solution as it involves a second raspberry pi4 for part of the process. Been a while since I accessed that.
I will quickly describe here and actually collate extra code some time this week.
I eventually set up nodered on a second pi and, there, I could create a script that would read unread emails with a specific title, and extract the attachment to a base folder on the share. It did a rename of the name of the file so that the next process could identify them easily.
As the format of these videos was not friendly to HA, I also wrote a python script that looked for video files in this folder and converted them to ffmpeg. It does also move them to a completed folder.
The files in this completed folder are then available in HA in ffmpeg format. I did use the Samba Nas addon to mount this but HA System>Storage I believe can now mount shares easily.
As stated, I will access the pi and get the code this week.
Cannot remember why but I think there were issues on my HA with implementing the Nodered scripts there and so it had to be on a different pi.