I have
Mosquitto MQTT collecting sensor data
Node-RED
InfluxDB
Grafana
all running in Docker containers on a Synology NAS and maintained via a PC.
Recently the Node-RED container stopped working which was fixed with Forum help.
Now, what is the easiest way of adding some missing data to the InfluxDB database, eg time/temperature?
I created a simple Excel spreadsheet with the intention of using the "spreadsheet-in" node to start the process.
This failed when I couldn't even figure out what the absolute path of the .xlsx file was on the NAS or PC when being located by Node-RED in the Docker container!
Was I barking up the right tree, or what is the "right tree"?
Assuming that you know how to formulate the correct timestamp for adding InfluxDB historic records, your issue seems to be more about understanding server filing system access than InfluxDB?
To start understanding the file locations, we first need to know how you are running Node-RED on the Synology NAS.
Node-RED, InfluxDB etc are all running in containers in Docker on the NAS (also a Home Assistant container). I have a number of sensors around the house collecting data and feeding it into InfluxDB via MQTT and Node-Red. I maintain them and view the resulting information in Grafana via a PC.
I started by using a spreadsheet to get the missing data into Node-RED/InfluxDB, because I thought that it would be the easiest way (for me to undersatnd), if there is a more simple, or easier way, then please say.
After I created the spreadsheet on the PC it dawned on me that Node-Red would need to know the path to the file on the PC. Conversley, if the file were on the NAS, where should it be? I tried a number of locations and paths but the "read-file" node reported ""Error: ENOENT: no such file or directory".
If you are running node red in a container then you must put the file in a folder accessible to the container. Which folders are accessible depends on how the container is setup.
And the file/folder structure is relative to the container and not to the NAS. The typical Docker Node-RED install should have a /data folder attached which is your userDir (where the flows and other node-red files exist). So make sure you put your spreadsheet into that folder. Where the data folder physically sits on your NAS depends on how you configured the node-red docker container. You should check its settings to see where you mapped the data folder to.
This is a typical Docker issue, not a node-red issue. Containers are enclosed systems and you need to understand about how they are configured in order to be able to use them sensibly.
Well, thank you for being so patient with me Julian, that did the trick!
The foibles of containers and paths is going in my little black book!
Using a path name of /data/Add_Data.xlsxallowed the spreadsheet to be visible to the next node, so now I can crack on and format the data ready for sending back to InfuxDB.
Thanks Colin, I just happen to be watching a Steve Cope video and it does seem easier to control the data using a csv file - so with your nudge, I'll sack off the .xlsx format and go csv.