Local Files in Rule 4.0

Is there any limitations when it comes to global variables?

Maybe storing this info into files and being used with other child apps could be beneficial in some sort ?

Hmmm or used to dump data to be used for parsing for more info... perhaps something that can limit the need to make multiple call outs to the internet to parse the same data over again... no clue if this would speed things up, be of any benefit etc...

For now, you can't create a global variable that represents a /local file -- only a local variable can do that. But, any rule can do that, so in effect a /local file is available globally,

The only child app that can access /local files is Rule-4.0, for now. There are not methods available to user apps to reference /local files.

Future request. :slight_smile:

2 Likes

I can see massive potential for this once it becomes available to custom apps/drivers
For example: setting a variable in one app or driver and it being available to other apps/drivers.

Once the methods for read/write from apps etc are available, I can also see serious problems where two developers use the same filename.
Perhaps if/when the methods are created for custom apps, either the app.label or app.id could be prepended to the filename (although sensible devs could easily do this as ā€˜best practiceā€™ on write)

Andy

3 Likes

There is already this potential name conflict between developers when creating data values in drivers. An agreed approach would be beneficial. app name or namespace prepend would be sensible

2 Likes

I see app id actually may cause a problem.
Namespace prepend should be sufficient either automatic or as an agreed best practice convention

Andy

1 Like

Hi guys !

For addressing concerns like this:

And this:

And this:

and some more that's why I've suggested this here (comment #28):

and discussed it more here (comment #32):

Marco

1 Like

Works great for playing local mp3 files (have not tried other file formats).
I have a rule that plays dogs barking triggered by the doorbell if everyone is not home from the Amazon cloud but now I can play it locally!

1 Like

So while not immediately available for apps, could an intermediary device be created and rm could pass the data in? Apps can subscribe to all devices now correct?

I can think a few ways to use this ability. One is to capture the current state of my Yamaha Receiver mute state and volume and some of the harmony settings so I can restore them later.

i didn't get the upload screen in chrome, but it came right up in edge. microsoft is coming back with a vengeance! :joy:

1 Like

I see another great potential use for this..
Dumping the config of an app to a local file then importing it into a duplicate
Hmmm.....

4 Likes

I tried adding a locally stored .wav file triggered by motion. It just read the file name and did not play the file. Any ideas?

Works with my Sonos speaker as well. Thank you!

1 Like

The string entered should look like http://192.168.0.x/local/Untitled.mp3

I would recommend trying an mp3 file.

Also the filename is case sensitive. Hope one of these helps.

1 Like

I tried mp3 and got the same result. I am doing this on an echo. Could that be the reason? It just reads the file name.

Thank you Brandon... I switched to the sonos and it works fine. Echo doesnt play the track, it just reads it. The Sonos plays it.

2 Likes

Glad you got it sorted, to bad about the echo.

Google devices play local files too.

I've used both wav and mp3, if the player can handle the file type then it doesn't matter.

2 Likes