Profile PictureMitchell Morley Production

Longer-Delay (Minutes or Hours) Companion Actions with a Countdown Displayed!

$0+
0 ratings

Ever wanted to delay an action (or set of actions) by minutes or hours in Companion? And wanted to see how long you had left until the action(s) executed?

Well, now you can! In this simple example, you can press a button that will turn another button green at a later time. By default, I have this delay set this at 1 minute and 30 seconds. You can edit this by clicking on the "Turn Target Green in 1m30s" button, and adjusting the "stopwatch: Set" action values to a different number of minutes & seconds, or even hours! When you press that button, the timer is set and begins counting down.

The actions to be executed after the delay are defined on a Trigger in this Companion config. The timing & timer are handled with a stopwatch Generic connection and then the Trigger has logic defined to use this connection, and a custom variable, to execute the actions on the correct delay.

When the timer runs out, the action(s) will execute. In my template, I am simply turning this Target Button green. You can put whatever you need to in the Actions section of the Trigger for your own project needs (and then, of course, make sure to rename the "Turn Target Green..." button to match accordingly).

The "RESET" button also acts as an abort button, in case you need to cancel.

Additional steps if you are importing the page and not the full config:

1) Re-create the custom variable I am using (which I named safety_enabled) and set its startup value to 1 & its current value to 1. This custom variable is used so that resetting the timer does not execute the actions on the Trigger.

2) Re-create the Trigger I am using (screenshotted below). Change the actions to whatever you want them to be, but the Events & Condition sections need to be re-created accurately



this template was inspired by a post in the Companion User Group on Facebook

$
Add to cart
Size
2.2 KB
Copy product URL
$0+

Longer-Delay (Minutes or Hours) Companion Actions with a Countdown Displayed!

0 ratings
Add to cart