Hi folks,
So Iām starting to look at some pretty complex functionality in Rule Machine and I was wondering if Iām missing a way of making my life easier.
I come from a programming background and I am used to creating stateless functions, principles of DRY and I find myself violating those rules a lot at the moment.
So, is their a way in Rule Machine to create an untriggered rule, that I can trigger from another rule and then pass some variables into for execution.
As an example, I have a button that toggles through various radio stations on my Sonos, it sets the volume, announces the station via TTS and tunes to the stream. At the moment I am having to replicate the sub rules for each radio station, or create a huge monolithic rule with a lot of Else If sections.
What I would love to be able to do, is have a main rule, that has the main Else If section, that then calls a sub rule and passes in the station name, requested volume, and station URL.
Taking it one step further, I have 4 speakers to write this for, so it would be amazing to nest these rules within another rule that passes down the speaker to target based on some more logic of which button on which room was pressed.
Now, I get the feeling from other peopleās posts that this is kinda possible, but I think Iām missing/not understanding how to implement it?
Apologies for my rambling!
Thanks
Gareth