So I just installed some RGBW LED lights in the garden, and have a few different Action Groups representing a few different colors. I'd like the lights to come on at Sunset (no problem there) but would like Indigo to randomly choose a different action group each day so the colors are somewhat random.
So this would choose between a set of Action Groups...
I'm guessing there is a probably a way to do this via Python, but is there another easier way thru the GUI with existing plugins?
Choosing Random Action Groups
- jay (support)
- Site Admin
- Posts: 18411
- Joined: Wed Mar 19, 2008 11:52 am
- Location: Austin, Texas
- Contact:
Re: Choosing Random Action Groups
I don't know of any plugin that does it, but the script is super simple:
Code: Select all
import random
# Just add the ID of each action group that's part of the list
group_id_list = [
047955397,
1859802910,
137055768,
614592366,
1972742736
]
# Execute a random one from the list
indigo.actionGroup.execute(group_id_list[random.randrange(len(group_id_list))])
Re: Choosing Random Action Groups
Wow!
That looks easy!
Again, I can't thank you guys enough for all your hard work and support.
That looks easy!
Again, I can't thank you guys enough for all your hard work and support.
Re: Choosing Random Action Groups
Jay
Just a quick note that I'm finally able to utilize this random script. I don't remember why I had asked in the beginning, but am able to use it to randomly start via OSC a DMX show running on a Raspberry Pi.
Works like a charm.
THANKS
Just a quick note that I'm finally able to utilize this random script. I don't remember why I had asked in the beginning, but am able to use it to randomly start via OSC a DMX show running on a Raspberry Pi.
Works like a charm.
THANKS
- jay (support)
- Site Admin
- Posts: 18411
- Joined: Wed Mar 19, 2008 11:52 am
- Location: Austin, Texas
- Contact:
Re: Choosing Random Action Groups
Great! Thanks for the followup.
Re: Choosing Random Action Groups
Jay
Just wondering if there is an easy way to capture what Group the Random script chooses and stick it in a variable.. The log shows the Action Group NAME, (2nd line below) which would be best, but even just capturing the Action Group ID would be nice.
Just wondering if there is an easy way to capture what Group the Random script chooses and stick it in a variable.. The log shows the Action Group NAME, (2nd line below) which would be best, but even just capturing the Action Group ID would be nice.
Code: Select all
Schedule ***Mardi Gras WarmUp. (1 of 3)
Action Group Pi-1-Warmup-11
- jay (support)
- Site Admin
- Posts: 18411
- Joined: Wed Mar 19, 2008 11:52 am
- Location: Austin, Texas
- Contact:
Re: Choosing Random Action Groups
Sure:
Untested, but it should be close
Code: Select all
import random
# Just add the ID of each action group that's part of the list
group_id_list = [
047955397,
1859802910,
137055768,
614592366,
1972742736
]
# Get a random action group
random_group = indigo.actionGroups[group_id_list[random.randrange(len(group_id_list))]]
# Insert the name into a variable
indigo.variable.updateValue(ID_OF_VARIABLE, value=random_group.name)
# Execute a random one from the list
indigo.actionGroup.execute(random_group)
Re: Choosing Random Action Groups
Got it
Can NEVER thank you enough!!
Can NEVER thank you enough!!