Page 1 of 1

Trigger only when condition occurs for a given duration?

PostPosted: Tue Dec 15, 2020 6:08 pm
by jheddings
Something that would help with several of my triggers is to have a "duration" value... This would be a configuration parameter that only executes when the trigger condition has occurred for a given period of time. For example, when certain sensors detect motion for more than a few seconds turn on a light (no need to turn on lights if I just move between rooms).

Today, I'm getting around this using Timers. The problem with that approach is twofold:
1) Indigo becomes cluttered with more timers and triggers than necessary.
2) It can be harder to debug behaviors since the original event is asynchronous from the actions that take place.

It's workable as-is, just tossing it out an an idea for future releases. Of course, if there is a better way to solve this in Indigo currently, I'm all ears!

Re: Trigger only when condition occurs for a given duration?

PostPosted: Wed Dec 16, 2020 5:22 pm
by jay (support)
I do that sort of thing with Timers as well. Feels like the right balance given Indigo's real-time event architecture.

Re: Trigger only when condition occurs for a given duration?

PostPosted: Wed Dec 16, 2020 5:25 pm
by FlyingDiver
For the presence detection cases, give my new pre-release plugin a try: viewtopic.php?f=216&t=24528

Re: Trigger only when condition occurs for a given duration?

PostPosted: Fri Dec 18, 2020 1:34 pm
by jheddings
Thanks for the thoughts and feedback! Timers are working well, just a little cumbersome to get them all set up.

Joe- I'll give that a spin over the holidays.