Write json files to another computer on the network

I want to be able to write a JSON file to another computer internally on my network, but however
I construct the file path in the write node I cannot get access.
I suppose this is an issue with authorization, but surely this is possible somehow.

The Noe-RED installation I am using is an addon to Home Assistant on a raspberry pi and I specifically want to get this file to another pi.
Can someone shed some light on how to do this.

Not many here use Home Assistant but if you have an MQTT broker on your LAN - send the message to it and install Node-RED on the other Pi to receive it and then just have a simple flow to save file from there

1 Like

@cymplecy suggestion is very clean, self contained and simple to maintain.

However, if you wont go down this path, you will need to somehow mount the remote directory to a mount point inside of the HA docker container (providing permissions (if needed)). Once you have that all working, you can then use standard file nodes to write to the mnt/mount-point-you-setup

EDIT...

Even if you dont have an MQTT broker, there are many options for sending data from node-red to node-red (http end points, TCP, UDP etc) but MQTT is by far the easiest

Thanks I will have a look at the options and see what works best.

So I have an existing installation of a MQTT broker from a HA addon, which handles my Ring doorbell device. I have never used in any flows it as I have neglected to look at it.

I have attempted to send an MQTT JSON message from one flow to another on the same install of Node-Red, which works well.

I have installed Node-red on another machine using a (different port), but I don't seem to be able to connect to the MQTT broker to receive the message using the credentials I am using on the first installation, should they be different or am I missing a trick somewhere.?

  1. You use same port (normally 1883) on all instances. Just need to use the actual ip address of the broker (normally 192.... or 10....)

  2. If the broker is running inside the Docker, then there may be difficulties connecting to it from the 2nd machine. I hadn't thought if this issue when I first replied :frowning:

Are you able to open up port 1883 on the docker instance?

As you installed the broker as an add on to ha, they have likely answered the question if external connections many times in the ha forum.

Also, as you said your ring doorbell is using it, I suspect it may simply be you have not entered the correct settings on your 2nd node red instance.

Ah silly me, I was being stupid and not concentrating.
I put a ridiculous IP address in for the server on the second receiving machine.
It's working a treat. Now I know about this I can have hours more fun!!
Thanks for making me do a bit of reading, it's a brilliant thing

2 Likes

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