Here is a set of (4) programs I use for a similar function in a multi-control situation. These further limit the total on time available to 60min. This can all be changed to suit your needs however. You would need to establish the variable too.
Barn Lights Check - This initiates the decrement program when the lights are turned on via Mobilinc or admin console. If Status 'Barn / Barn Overhead Lights 1' is On And Status 'Barn / Barn Overhead Lights 2' is On And $Barn_Light_Minutes is 0 Then Wait 5 seconds Run Program 'Barn Lights Increment' (Then Path) Else - No Actions - (To add one, press 'Action') Barn Lights Decrement If $Barn_Light_Minutes > 0 Then Wait 1 minute $Barn_Light_Minutes -= 1 Wait 1 second Run Program 'Barn Lights Decrement' (If) Else Set Scene 'Barn / Barn Lights' Off Wait 1 second $Barn_Light_Minutes = 0 $Barn_Light_Minutes Init To 0 Stop program 'Barn Lights Decrement' Barn Lights Increment If ( Control 'Barn / Barn Overhead Lights 1' is switched On Or Control 'Barn / Barn Overhead Lights 1' is switched Fast On Or Control 'Barn / Barn Overhead Lights 2' is switched On Or Control 'Barn / Barn Overhead Lights 2' is switched Fast On ) And $Barn_Light_Minutes <= 30 Then Set Scene 'Barn / Barn Lights' On $Barn_Light_Minutes += 30 Wait 1 second Run Program 'Barn Lights Decrement' (If) Else - No Actions - (To add one, press 'Action') Barn Lights Off If Control 'Barn / Barn Overhead Lights 1' is switched Off Or Control 'Barn / Barn Overhead Lights 1' is switched Fast Off Or Control 'Barn / Barn Overhead Lights 2' is switched Off Or Control 'Barn / Barn Overhead Lights 2' is switched Fast Off Or Status 'Barn / Barn Overhead Lights 1' is Off Then Set Scene 'Barn / Barn Lights' Off Stop program 'Barn Lights Decrement' $Barn_Light_Minutes = 0 $Barn_Light_Minutes Init To 0 Else - No Actions - (To add one, press 'Action')