Automation rule with variable?

If you have created a unique MLServeCmd that performs a unique task, please post it here so others can learn from them.
User avatar
simonmason
Expert
Expert
Posts: 855
Joined: Tue Dec 26, 2006 9:06 pm
Contact:

Automation rule with variable?

Postby simonmason » Sat Apr 13, 2013 7:49 am

I want to trigger an automation rule based on a variable that has another variable inside it:

Whenever satradio_{{satradio.playing}}_artwork changes value

Then SetVariable|music_currentalbumcoverart_CHA3~satradio_{{satradio.playing}}_artwork

I tried it out but it doesn't seem like it is working. Any thoughts on how I might accomplish this? Thanks.
Simon D. S. Mason

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Automation rule with variable?

Postby CinemarDave » Sat Apr 13, 2013 11:14 am

Just as you have seen automation rules cannot contain nested variables. You would have to create an automation rule for every variation of the satradio_{{satradio.playing}}_artwork value. Why not just put the satradio now playing artwork on the scene and have its visibility controlled by the play state of the radio?

User avatar
simonmason
Expert
Expert
Posts: 855
Joined: Tue Dec 26, 2006 9:06 pm
Contact:

Re: Automation rule with variable?

Postby simonmason » Sun Apr 14, 2013 7:45 am

I have a home scene that shows the artwork for whatever source is now playing. To do this, I display {{artwork_Source#}} and replace source# with the source playing in that zone. Sat radio is source 3 in the house, so I want {{artwork_source3}} to point to the artwork for the current channel playing on the Sat Radio. Under the previous version of satellite radio there used to be some activeradio variables on the server that I would use but this appears to be gone now? I have found {{satradio_radio#_fanart}} which I can use for the fan art, but I am trying to get cover art, artist name, song title, etc?
Simon D. S. Mason

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Automation rule with variable?

Postby CinemarDave » Sun Apr 14, 2013 7:48 pm

Because SiriusXM gives us all the now-playing info for all their channels at one in one query we do not create separate server variables but instead rely on the individual data for each channel. I cannot think of any easy way to accomplish what you want without updating the app. I'm thinking something with a compound server variable might work. I'll experiment.

User avatar
simonmason
Expert
Expert
Posts: 855
Joined: Tue Dec 26, 2006 9:06 pm
Contact:

Re: Automation rule with variable?

Postby simonmason » Mon Apr 15, 2013 8:02 pm

i have tried everything I can think of from setting variables on the client to writing a script. I want to avoid triggering the events on change of every sirius channel as I think this will create too much traffic at the server. All approaches come back to an automation rule and I can't figure out how to get the rule to fire on the active channel.
Simon D. S. Mason


Return to “MLServeCmd Examples”

Who is online

Users browsing this forum: No registered users and 1 guest