I have a simple rule that tells a Govee light to cycle through a bunch of scenes...currently I've got a simple rule that uses repeat while, applies each scene number w/the setEffect command and lets it run for 5m, and then goes on to the next and repeats while a plug is on:
Rather than have to store the scene numbers in the rule and have to edit the rule every time I want to remove/add/change order of scenes, I'd like to store the scene numbers in a file, upload it to the hub, and have RM look at the file and use the scenes in the file in the setEffect actions.
That simplifies editing the scenes I'm using, and I could have separate files for each season and set up the rule to parse the desired set of scenes for the current date.
Does RM support something like this? I did some searching and looked at the RM docs and didn't see info about this. If I missed it appreciate a pointer.
Having tried many times without success to pull file contents in through either of RM's built-in "Get" functions, my first impulse here is to recommend, in no particular order:
Use the built-in "Set Variable from Local File" feature in RM:
Using a Hub Variable instead, since it's (a) readily editable, (b) holds quite a long string, and (c) with some copy/paste or var renaming, could accommodate pretty much any swap-out scheme you care to use in RM.
Writing a simple Groovy script (driver) with custom commands (e.g. Xmas, New Year, Independence Day, etc.) your rule could ping and return strings of commands via an attribute. Storing and parsing data objects in a script is quite straightforward and flexible.
And fully agree with earlier reply mentioning the Set Variable > Token feature in RM to iterate through your data points.
Thanks for the multiple options...above is initially most appealing as it looks like it would be easiest for me to implement w/a little assistance.
Pretty terrible w/Groovy other than minor editing of existing content, so likely won't go down that path.
Hub variable may be the fallback if the File Manager Device option doesn't work out.
Also going to search/google a little on RM string tokenization just for the fun of it, and maybe I will have the opportunity to teach @hubitrep that no good deed goes unpunished.
An approach based in part on the File Manager Device app and using variables worked...this was running last night and seemed to cycle through scenes just like I hoped. Uses tokens and everything... So I think initial victory.
@hubitrep - Coming back to look at your post I think I ended up w/a kind of "mini-me" version of your rule, not as slick but seems to do what I want:
While RM lacks a facility for picking specific keys directly from JSON (which webcore allows, btw), it's conceivable you could "wrap" multiple holiday sequences into a single file, then use distinct token separators to tease them apart. But that's more complexity than you bargained for....
Instead you'll likely wind up placing individual sequences into their own files in Local storage, and then compose the necessary filename within your rule as seasons change.
Yeah, my (admittedly tiny) bit of thinking about that part last night was that I could setup an If/Then at the start of the rule that would choose the desired file based on the current holiday/time of year.