diff --git a/Switch-scenes-randomly.md b/Switch-scenes-randomly.md new file mode 100644 index 0000000..5f4a98d --- /dev/null +++ b/Switch-scenes-randomly.md @@ -0,0 +1,49 @@ +Depending on what your requirements are different approaches can be used to randomly switch to one scene of a list of scenes. + +* If you want to switch to each scene for the same or a random amount of time before continuing to the next one using [Scene Groups](Scene-groups) would be recommended. +* If you instead want to switch to each scene for a predetermined amount of time using the "Random" macro action is likely the best approach. + +## Scene Groups + +As first step you will have to set up a [Scene Groups](Scene-groups) containing all the scenes you want to randomly switch to. +Make sure to set the type to "Random". + +![RandomSceneGroup](https://user-images.githubusercontent.com/19472752/167907331-de2ac528-4965-40dd-9b17-aace57fe5dda.PNG) + +Next [create a macro](Macros#creating-a-new-macro) to switch to switch to this scene group. + +As a condition chose whatever best fits your needs. In this example we will continuously switch scenes randomly so we choose the "Plugin state" condition type. + +The action will consist of a scene switch action (1) and a wait action (2). +As the scene switch target select the previously created scene group. +Finally configure the wait action to your needs. +In this example it was set to wait for a random duration between 5 and 10 seconds. + +![RandomMacro](https://user-images.githubusercontent.com/19472752/167908266-32b331e0-960d-4a43-a5ff-8544e8a080fb.PNG) + +This macro will now continuously switch to a scene from the [Scene Groups](Scene-groups) wait for a random duration between 5 and 10 seconds before triggering the next scene switch. +To not interfere with other macros you might have created you can mark this macro to run in parallel to other macros (3). + +## Random macro action + +This approach is more tedious to set up than the one using [Scene Groups](Scene-groups) but will allow you configure how long to stay on each particular scene before continuing to the next one. + +First [create macros](Macros#creating-a-new-macro) for each scene you want to randomly switch to. +These macros will not require any conditions as they will be executed by another macros. +The actions list should consist of a scene switch action and a wait action, similar to the following: + +![SwitchToScene1](https://user-images.githubusercontent.com/19472752/167910292-807876e5-8aa8-4351-8323-a71402b15063.PNG) + +Note that you can create a copy of macros by right clicking on the macro you want to copy. + +![Copy](https://user-images.githubusercontent.com/19472752/167910566-175bbc5a-d5d2-4c00-8222-b0ba72bfd628.png) + +Once you have created all these scene switch macros you will have to create one final macro which will execute the scene switch macros in a random order. +To do so first set up the conditions to your requirements. (In this example we will continuously run this macro so the "Plugin state" condition is chosen) +Add a new action of type "Random" (1) to the action list of this macro. +Next add each of the previously created scene switch macros to the Random action by pressing the plus button (2). + +![RandomMacro2](https://user-images.githubusercontent.com/19472752/167911671-f0cfb65d-ee0a-4a35-b724-ae162b0674e0.PNG) + +This macro will now continuously execute the scene switch macros in a Random order. +To not interfere with other macros you might have created it might be a good idea to mark this macro to run in parallel to other macros (3). \ No newline at end of file