Outputting text to a Windows shared folder

I'm running Node-Red in Home Assistant on a Raspberry Pi. I'm collecting data from MQTT and can save it into a file, on the Pi, but how do I send it to a shared folder on my Windows file server. I've been trying with node-red-contrib-filebrowser, but haven't got anywhere. Can anyone point me in the right direction - (probably need more than a pointer).
Thanks

Can you access the folder from the pi by saving to it in an editor or other s/w?

Edit: Sorry, should have said welcome to the forum.

No, unfortunately Home Assistant doesn't allow access to the underlying operating system or allow other software.

I had missed the fact that you are running HA. Few here have any experience of that, I suggest you ask on an HA forum.

Didn't think it was a Home Assistant issue - I'm using Node-Red. Doesn't it have a node capable of doing this and node-red-contrib-filebrowser isn't the right node?

The underlying operating system will need to have CIFS capabilities to read/write windows shares. In your case, the underlying OS will be alpine or some other slimmed down Linux (since HA and I believe the node-red plugin) run is a docker container. That's why we suggest you ask on HA forum.

2 ideas off the top of my head...

  1. run an FTP server on windows box and use an FTP node.

  2. Or, run node-red on the windows box and pass the data (via MQTT or rest or other means) and write the data from within the windows box.

Thanks - HA's cut-dowwn Raspian does have CIFS capabilities as it shares some folders on the network. But thanks for the suggestions. But I'm still not getting an answer to my question, so I'm assuming there is no specific node that can write to a network share like I'm using the node 'write file' to write to a local folder.

In which case, try mounting the share via terminal and use the standard file node.

Thanks, I looked at that, but as HA is in a container, the included terminal doesn't allow access beyond the folder containing the shares on the Pi.
But you've given me a workaround, as the MQTT server runs on the Windows server anyway, I can install node-red on that and duplicate what I've done. But I still haven't had an answer about any node-red nodes capable of writing to a Windows shared drive.

Possibly because folk writing to windows shares (I do this) use the standard file node (from within a Windows box) & use a UNC path.

I assume you tried a UNC path?

Someone may yet come along and recommend a node but AFAIK, there isn't a specific node for writing to windows shares (not that I've looked)

You can mount to any (sub) folder.

Have you considered running node-red outside of HAs container? (Run it on the metal so to speak)?

HA doesn't allow access outside its container - for stability.
I tried using a UNC path, but it fails, presumably because there's nowhere for entering credentials which is why I looked at node-red-contrib-filebrowser which has a section for entering credentials.

Steve-Mcl - I see from further investigation in HA that you are correct - accessing external storage is not possible unless the HA program is modified to allow this. At the present time it is locked down. Thanks for the guidance.

1 Like

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