How to a Create Static Files

Hi , I am looking for help in understanding and how to create a static file in HA / node red. I have removed the // httpStatic" there is a node-red-static file however when i use this in File node i receive the following error "failed to write to file: Error: ENOENT: no such file or directory, open 'home/.node-red/static' If i create a file config/reolink_snapshot.jpg i can see the snapshot. question is this the only way . I was looking to store them to my hard drive if possible?

I await any comments or advice.

I think HA runs Node-RED in a docker container - if so then that would need to mount a volume from outside the container as a directory inside that it can then write to - the file node needs to specify a complete path - but to a place inside the container . I suspect you will find more help on the HA forum as there aren't so many HA folk over here.

Hi dceejay, thanks for your reply. asking HA is a nightmare, most people i don't think they realise that newbies need to learn, they spout computer jargon in stead of plain english.

thanks again for reply

You could ditch HA and use node-red for everything.

1 Like

I most likely will when I get used to and the learn the basic, hence looking for advise on why the httpStatic, now that i have removed // from setting js. What else i need to do?

If, as Dave say's, HA runs NR in a docker container, you need to understand a bit about containers. They provide a semi-isolated virtual environment. That means that whatever you put in settings.js relates to the inside of the container. The usual way around that is, as Dave says, to add an extra container that just provides a virtual filing system that maps to a real folder.

If that sounds complex - it should! Because it is! And it is for that reason that lots of us recommend not using that kind of approach unless you really have to.

For you, it may even be simpler to run up a stand-alone copy of Node-RED and then just use it to serve up the static folder for now but then move over your other flows later.

Of course, you could also run up a simple web server instead. Caddy is very easy to install and configure and it comes pre-configured with a static folder. As does NGINX.

TotallyInformation, , thanks for the information at least you gave me some to look at. thanks you . I will look into it. I have HA on a PI3+and my iMac to learn the pros and many cons , when hopefully i will transfer over to my Pi3.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.