I'm not expert in programming, but I like to do it for fun, it's like a puzzle!
So I've started to write my own app for efficiency purpose, since some of my somewhat complicated RM were a significant load for my hub. By writing dedicated custom apps, it reduces significantly the time spend to do the job in comparison to an equivalent RM as mentioned here: Writing your own "rule" apps worth it?
One of my RM is logging information into a txt file for further analysis with another computer. However, for what I understand, it is not currently possible to write local file into the hub with custom app since java.io.File cannot be imported. I'm sure this is for security reason.
Another nice guy has developed a way around: [BETA] Hubitat File Driver (HFD) but it still not solves my problem, since this method is based on a RM to write the file. The RM that I want to replace is currently a significant load for my hub.
So, my request/question, could it be possible to allow custom app to write file only into the File Manager? Although not mandatory, it will be a nice to have!
Just to clarify, in no way I want to diminish the RM app, it is super impressive all of the thing that we can do with it.
Yep I asked that question a while ago.. since then have moved on to Node-RED which is an opensource visual flow control system originally written by IBM. It's a very cool way of writing rules and definitely lessens the overhead on my hubs (have 3). My NR is currently running on an RPi4 along with HomeBridge for Apple Homekit Integration.
Thanks, node red is surely great alternative. I'm already using it for the broadlink universal remote and bluelinky for my Kia car and create custom driver has virtual device to communicate with Node red. However, when possible, I find it more efficient to run every thing on a single machine.
But if no plan to allow writing file within custom app, I will probably move those RM to node red.
The Hubigraph community app has been using file storage for its long term storage. It might be possible to figure out how it’s done by looking at its code. (The original developer left the platform some months back.)
He did it the same way I did it in HPM (we actually talked about it a lot to figure it out). But basically it emulates going to the file manager page and clicking the buttons. The limitations are you can only do text based files, not binary, and if you have hub security on you will need to enter your username and password in the app so it can login as you. I wish they'd add an API, I've asked for it too, it would let me fix a long standing bug in HPM with file manager, but it doesn't seem high on the priority list.