Checking for time since on/off state change

Posted on
Sun Sep 27, 2015 11:19 am
pbosgraaf offline
Posts: 3
Joined: Sep 26, 2015

Checking for time since on/off state change

Hi All,

I'm evaluating Indigo for my house automation.

My current setup (different vendor) is using trigger "Device has been on/off for longer/shorter than" extensively.
I'm trying to accomplish the same setup in Indigo but i don't think this trigger exist, or at least i'm struggling :-)
Can anyone tell me if there is an easy way to accomplish this?

So far i have found that i can log a timestamp to a variable and use a trigger/script to process the time difference.
I also see that the device details already hold a "Last Update" variable, so i might be able to use that.
But both seem like fairly complicated way to do so, so i'm hoping there is an easier way to do this?

Or if there is not, is there any chance these triggers could be added as a feature request?

Thanks!
Peter

Posted on
Mon Sep 28, 2015 9:21 am
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Checking for time since on/off state change

Hi Peter, welcome to the forums. There is no built-in trigger for this and while I'm sure someone at some point has asked for it, I don't recall the last time it was requested.

There are a couple of different ways to accomplish it, but I think to find the right solution we probably need to know more precisely what the use-case is (are). It may be that there's a different approach to the task that will work just as well or better in Indigo. So, can you describe a scenario or two where you use the trigger in your current setup?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Sep 28, 2015 9:35 am
kw123 offline
User avatar
Posts: 8392
Joined: May 12, 2013
Location: Dallas, TX

Re: Checking for time since on/off state change

checkout the "seconds since last change" plugin :
http://forums.indigodomo.com/viewforum.php?f=164

that should do what you want.

Karl

Posted on
Mon Sep 28, 2015 11:45 am
pbosgraaf offline
Posts: 3
Joined: Sep 26, 2015

Re: Checking for time since on/off state change

Hi,

Thanks for the quick reply!

@jay, i can list several but here a few:

I want the ventilation system in my shower to run for 15 minutes after the last one person has showered.
So it turns on when shower has been on for more 5 minutes.
And turns off when the shower has been off for more than 15 minutes.

Shutting down unwanted appliances.
When there is no activity in a room for longer than 15 minutes i shutdown all the appliance modules.

When the last persons enters the bed and stays there for more then 30 minutes house mode get's set to sleepmode.

I really feel these kind of timers are an addition to the current trigger selection.

@karl, thanks i'll go have a look!
hopefully you can select the state in the trigger too, for ex "x seconds since state on"
And use longer and shorter etc.

Cheers,
Peter

Posted on
Mon Sep 28, 2015 12:13 pm
kw123 offline
User avatar
Posts: 8392
Joined: May 12, 2013
Location: Dallas, TX

Re: Checking for time since on/off state change

You could do most of these things with delayed triggers.
First do a delayed trigger of 15 minutes that switches eg light off
Then another trigger that cancels the first trigger if another person enters the room etc.

Along these lines



Sent from my iPhone using Tapatalk

Posted on
Mon Sep 28, 2015 12:16 pm
kw123 offline
User avatar
Posts: 8392
Joined: May 12, 2013
Location: Dallas, TX

Re: Checking for time since on/off state change

The plugin secs since last change or previous change you can set a trigger on any device state >,<,= x seconds since last change / previous change


Sent from my iPhone using Tapatalk

Posted on
Mon Sep 28, 2015 12:41 pm
pbosgraaf offline
Posts: 3
Joined: Sep 26, 2015

Re: Checking for time since on/off state change

Thanks!, i think i can use the "seconds since last change" for most of my events.

And i see that i can use delayed trigger too, but I still feel adding it to the core would make a good add to the current triggers.
Having it there right in the core would make this feature way more accessible for Joe Average if you ask me.

Thanks all, i'll go play with the plugin :)

Posted on
Mon Sep 28, 2015 3:28 pm
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Checking for time since on/off state change

My point is still valid however: depending on your use case, there are likely better more user-friendly ways of accomplishing things.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest