Local Files in Rule 4.0

For appends, what signifies a carriage return/line feed?

Great. Thank-you!

And for a string local variable append, %newinfoToAdd%, what do we use?

You can just put the CR in the text box:

A text box can have multiple lines...

Fair enough. Was conceptualizing it too old school. Thanks, again.

Hi everyone !

I've developed a "provisory" solution for accessing files from apps and drivers:

Hope you guys like it.

Marco Felicio

1 Like

This is awesome...

Local control, local files, local everything! My NAS does a fine job as a web server, but I really like the idea of keeping everything needed by the HE on the HE.

Now all I need is some way to send email via my SMTP provider from the HE, and I'll have zero dependencies.

That is, until your hub crashes :sweat_smile:

1 Like

Or you want the email outside of your house..... :wink:

1 Like

Hi @tomw !

Take a look at this:

It is not official - and never will be, since it's a workaround. But it's something ...

Best

Marco

3 Likes

I'd love to do this using one of my RM rules.
Could you explain what approach you took to upload the .mp3 and what your rule looks like to play back on Sonos?

Thank you!

1 Like

I can think of some things but some of it would ideally be done with being able to feed rule machine JSON files or XML (I think JSON would be better)

1 Like

Neat, you can use this to log access pins used for door locks.

So what would it take to be able to run an html file (like a dashboard) directly now from the hub instead of a Pi running Apache. We can host images, sounds etc. but is that now possible too? (sorry, away from home right now so not able to test and itching to know!). And would that load up the hub too much and be better served out on a Pi anyway?

Apps have always been able to serve whatever content they want via local or cloud OAuth endpoints, including complete HTML pages. For a Dashboard, you'd quite likely need the dynamic capabilities and closer interaction with the platform (e.g., ability to see selected device states) that an app would provide, compared to just hosting an HTML file on the hub itself. If you're thinking of things like HousePanel, this feature really won't help there (unless there's more to this file storage that we aren't being told about) because it relies on PHP for some of the dynamic capabilities like talking to Hubitat--not just a "static" HTML file or HTML with JavaScript and whatnot. HP could be re-done as a Hubitat app, with the app doing the "talking to Hubitat" part and local files (from Hubitat or elsewhere) serving JS/CSS/images/etc, as needed, but that would be quite a design change.

But for something with more hope: consider Hubigraphs. Nothing like this is possible here as-is because it uses Google Charts, which Google requires you to use their cloud option for and does not provide any local capability, but let's pretend we're in an alternate world where it uses an alternate library like Charts.js instead. This library could be hosted by the hub instead of needing the cloud library (and without going through the excessive work of trying to format the JS code to some sort of Groovy string that could be embedded in your app's output...something that I guess has always been theoretically possible, just nearly impossible from a practical perspective since you'd have to embed the library in every page served).

4 Likes

Like use it logging almost infinite hub log, not just couple last hundreds of records

Up to 1GB

Take a look at this:

It may be of some use in this regard.

Marco

I think you're crossing the point where writing an app is the better tool. RM is great, but it's not designed to be a general purpose programming language. If you haven't already, it's probably time to start looking into groovy apps if you feel the need to parse JSON for your rules.

1 Like

"Now all I need is some way to send email via my SMTP provider from the HE, and I'll have zero dependencies."

If you happen to have a RPI online, you can do this with this approach: