How to write to a local file

Hi, I am looking for something as simple as writing (or appending) to a text file. And then I mean a local text file.

I found ways to export Insights with Archive Insights, write flow variables to a Google Sheets worksheet. Until now I did not find ways to write (and read) a local text file that I create myself and that I can export to my NAS with FTP Client.

Why not write the textfile yourself with the FTP client app on your NAS?

Must it be local?

You can use the Better Logic Library app and write to a text variable. The can be large if you want.

And else, you can use the MicroWebserver to write text to a local ftp file?!

Thanks Arie.

I do not understand “write text to a local ftp file”. What is local here? The Homey or the NAS?

If I can’t create a text file on Homey, I also can’t sent it via FTP…

In general:

If I have to do a lot of work on Archived Insights files that were exported to my NAS, I wonder if it is not easier to do collection of the data via MQTT on my NAS in the first place.

On my NAS I have a Docker container that runs Nodered. This has MQTT capabilities. So I can recieve the data, use Python to aggregate /analyze store the results. That saves the extra step in transporting the data.

Maybe use this app: Exporteer Insights App voor Homey | Homey

If you use the Micro Webserver app, you can create a local FTP server and use the FTP client to store something on Homey.

But, the ftp client app has a flowcard to save a string/text directly as a file.
So you can use that flowcard to write a file with text directly on you NAS.

1 Like

Yeah, i use this app also, i believe i have even placed my Bash script on the forum, which unzippes/extracts all files (on my Synology NAS), so it can be directly used in an excel file as datasource on my network.

1 Like

Yes, I use that already

OK , I did not recognize that functionality of the Web/FTP server. I will test it.

EDIT: OK I can send a file like that. In fact it is created right before sending, without saving it locally.

I need to define text variable to which I can append multiple chunks of text, separated by newlines.
And I need to discover how to make it base64

The reason why I ask these things is the following:

for deeper insights you often combine data of various sources. I need to decide if I do this “combining” on the NAS side or on the Homey side. The point is that neither of both side has the interfaces for all sensors.

IMO it makes less sense to transport data to the Homey side with MQTT for sensors that it doesn’t have on board if I have to transport aggregated data back to the NAS later. Rather, I use Homey to acquire data that are still missing, then transport them to the NAS/Nodered directly upon receipt and do further processing there.

This becomes especially true if there are no possibilities to create files with multiple lines of processed data on the Homey side.

Do you need a text file (like a log) or do you better want to export data in a database like MySQL on your NAS? For example log sensor data into one table, Aggregate data into another.

When that is part of the questions:
Shift+Enter works in standard and adv. flowcards

1 Like