[BETA] Hubitat File Driver (HFD)

For you, an user that can't wait to explore the latest awesome local files feature, I present a "provisory" solution for file access:

Hubitat File Driver (HFD)

With HFD you can read/write/append to files directly from your apps and drivers, almost like if you were using a File API.

This is a BETA version. Bugs are expected, suggestions are welcome, even complaints too ... part of the business, of course.

I hope it is useful for the community.

Marco Felicio

11 Likes

Interesting.... Examples of use?

With HFD you can read/write/rewrite a file.

One example that I think of and use case for HFD is creating an user log - first create the file then append information to it.

As I said, there are some tradeoffs: it is necessary to create a virtual device for each file that you want to use.

In you case - if I'm not mistaken .. - you'd need a file to duplicate a tile definition. If you can live with a single file for that - a plain workfile - I think HFD can be useful for you.

I warn you that it that seems to be a file size limitation due to Hubitat's current implementation of the local files. This is expected, since it is a beta feature.

Marco

Just dropping this here as a "PSA" because I couldn't find this info very easily

To easily read the contents of a file from local storage see example below replacing filename.txt with your filename.

String fileText = "http://${location.hub.localIP}:8080/local/filename.txt".toURL().getText();

3 Likes

H
Interesting โ€ฆ

Could you explain this a bit further. Where does that line go?

In your device handler code where you need to get something out of a file. The entire file contents are in the variable fileText. Clear?

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