Samba Update where is the filepath now?

And just for reference this article explains all of this

I am using the Node 'Write a File, which is part of the Nodered system

Writes msg.payload to a file, either adding to the end or replacing the existing content. Alternatively, it can delete the file.

Inputs

filenamestring
The name of the file to be updated can be provided in the node configuration, or as a message property. By default it will use msg.filename but this can be customised in the node.
encodingstring
If encoding is configured to be set by msg, then this optional property can set the encoding.

Output

On completion of write, input message is sent to output port.

Details

Each message payload will be added to the end of the file, optionally appending a newline (\n) character between each one.

If msg.filename is used the file will be closed after every write. For best performance use a fixed filename.

It can be configured to overwrite the entire file rather than append. For example, when writing binary data to a file, such as an image, this option should be used and the option to append a newline should be disabled.

Encoding of data written to a file can be specified from list of encodings.

Alternatively, this node can be configured to delete the file.

is nodered an add-on ? , guess it must be :slight_smile:

1 Like

Ok filesystem. In that case you will use /homeassistant/local

A view of /config is presented to the HA docker container as /homeassistant.

Your copy of NR ‘sees’ /homeassistant it refers to /config The OS and docker are isolating your writes inside the container and making it Look like the file is in that folder (primarily for read access to the container so you can serve files)

Im not sure you can make a permanent write like that anymore and make core see it. (that’s what I’m researching now.)

Samba gets special permission to see everyone’s config folders by mapping something called all_config instead of config. But NR doesnt

Yup. It sure ism

Yes Nodered is an addon. The article may explain it, and might welll be understandable to someone less than 72, who has only just understood how to write javascript

2 Likes

About 10 years ago some idiot I hate came up with a perfectly great idea of virtual filesystem.

Thats what’s going on.

So when you write it what did you WANT to do with it?

Specifically- the post earlier was great.

What might help.

Imagine all of your addons are a pane of glass and you wrote /config on each in a colored dry erase marker. (and did core in black)

All panes see thier own /addon_config folder AS /config in the color they’re in AND they see the black copy of /config mounter as /homeassistant but they CAN’T see each other Unless your name is SAMBA

1 Like

i still only can read the javascript, rest is copy/paste :slight_smile:

1 Like

OK so now I am beginning to get this.
But, Node red is an invaluable tool for linking with HA and it actullay enhances and adds considerable weight to the data that you can incorporate.
If Nodered cannot integrate properly with HA, then HA to me is bordering on useless for my requirements

1 Like

It can you just may not be able to do it the way you want.

Thats why I want to know what is eventually done with this and How.

Don’t think of how think result the how may be something completely different.

Edit: and my dad is 73 I taught him powershell last year. You’ll get this

OK well for example most of the the data i can get from say Openweather, my own airraft receiver, HM tide data, PVsolar and i drag into Nodered and enhance that data.
eg my aircraft receiver gives mne a lat/lon position and with nodred I can process that and find distance, azimuth and elevation and plot those using some fancy cards in HA like flex table and canvas guage card etc

1 Like

Cool so you’re pumping HA sensor data with it or? Are you trying to read that in from the filesystem on the HA side (this is the part I think we need to change btw)

OK so the aircraft receiver is a separate pi +rtl receiver and that gives me a json file, which I can look at in HA, but I can’t do processing to gain the extra mile. Nodered is simply great for doing stuff and in simplistic ways so thats why I use it. I then have to get it a proper dislplay system, hence HA. I don’t care how I get it there or in what format, I just chose to write it as JSON file and flow it into HA as that was easy for me.

The Tide data I get I can load using an integration, but it gives me non local timing and also I can enhance that to give me tide heights and local time/tides data split into days and I have built a tide clock which is great as a handy reference. So now I have dumped the integration and I pull the data straight into Nodered, maniplutate it it and push it out to to HA

1 Like

K I think i get what you’re doing. It’s either going to come down to there’s a folder that you have write access to in the core filesystem (and what EXACT path it uses (in each container) or we will have to use a ‘network’ connect like FTP to transfer (but I think there’s a folder)

At the end of the day Its possible - you’re just fighting the right way to do it I’m convinced this is in the dev docs I just haven’t read that far yet.

Just think you only have to find one folder. Many of us (including me) had to restore the Entire node red setup. Ultimately the new way will be much better. More secure by a MILE and easier to recover (NR now holds all the NR bits in its own backup instead of being split in core and the addon post 16.0.2 because of this - and ultimately why they did it.)

Thanks for your help on this. I can’t be the only person who does this sort of stuff and to be honest it keeps my brain alive, so i need to keep inventing new ways of enhancing stuff and as my wife says it keeps me off the streets.
I think I am off to crash in the bed now so I will keep playing around with it, but some help is very, very welcome.

1 Like

Get some rest. I’ll read and let you know what I find.

Found what we needed

This is the file map configuration out of the current 16.0.2 docker config for NR:

map:
  - addon_config:rw
  - homeassistant_config:rw
  - media:rw
  - share:rw
  - ssl

So the first four folders have config:rw which means you can read and write in those folders (they will mount and map as we discussed in the article previously)

The way I read the doc You could probably drop the file in /homeassistant (that’s homeassistant_config:rw above as seen from NR) and pick it up in /config on HA and that Should work. If you need to move it from the HA side we might be able to run a command

Reference:

I am sorry but I am not totally grasping this as I don’t understand the architecture of HA or nodered. Please be patient with me.
I presume you wanted me to place the map: set up into the config.yaml, which I have done and I thnk you are telling me to write a file from nodered to /homeassistant_config/. Nodered rerports an error that no such directory is found.
I can get it write a folder that isn’t found from nodered within that write file node, which I did and it supposedly writes it but of course it doesn’t exist.
So to summarise i can write a file to /homeassistant/airdata4.json and it is there, but of course i can’t load it as a resource because I cant use /homeassistant:port 8123, which as far as I understand is HA’s html front end.
If I could move that file out or copy it automatically to local/community, I could use it.

can you write to /homeassistant/www/airdata4.json ?

And please when you say " i can " specify whether you mean “nodered can” or you manually can ,trough some other add-on like file-editor/samba, there is a big different

Just as an aside I can write to /media/ but i cannot load the url at
http://192.168.1.130:8123/media/skyware/airdata.json as I am unauthorised.