Do Action if variable is still the same after five minutes

Posted on
Tue May 05, 2015 12:43 pm
noel1983 offline
Posts: 446
Joined: Oct 17, 2014

Do Action if variable is still the same after five minutes

Hi all,
I'm on the case detecting the power usage of a tumble dryer so that five minutes after power usage drops to less than 5 watts Indigo sends me a message to say that the Drying is finished.

I can set the variable TumbleDryerOn to be true and false based on the power usage no problem, the bit I don't know how to do is to check after five minutes if the variable is still false so as to then send the message.

Reason I want the delay is sometimes the dryer pauses and changes direction which I have a suspicion will result in 0W for a few seconds.

Can anyone help me out?!

Thanks
Noel

Posted on
Tue May 05, 2015 12:49 pm
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Do Action if variable is still the same after five minut

Others will correct me if I have missed anything, but I would attempt to tackle this by creating a Timer device that is set to 5 minutes. Whenever you variable changes to "false", you will start the timer... any time it goes to true (meaning the dryer is on) you will stop the timer in case it is running from a "pause" as you think may happen. When the timer completes you know that it has been off 5 minutes from having going to "false" and can send the notification.

Adam

Posted on
Tue May 05, 2015 1:21 pm
noel1983 offline
Posts: 446
Joined: Oct 17, 2014

Re: Do Action if variable is still the same after five minut

Hi Adam,
Perfect thanks, I knew there was some nugget of knowledge I was missing! That's working perfectly.

Cheers for the awesomely fast response!

Noel

Posted on
Sun May 24, 2015 3:40 pm
jens offline
Posts: 265
Joined: May 03, 2015
Location: Sweden

Re: Do Action if variable is still the same after five minut

Nice, can you do a scream dump how you did, is new on this...

Posted on
Mon May 25, 2015 5:13 am
noel1983 offline
Posts: 446
Joined: Oct 17, 2014

Re: Do Action if variable is still the same after five minut

tumble dryer actions.tiff
tumble dryer actions.tiff (281.48 KiB) Viewed 4294 times
tumble dryer triggers.tiff
tumble dryer triggers.tiff (306.03 KiB) Viewed 4294 times
Two screenshots hopefully attached!

The first shows the conditions, the second the actions for the three triggers.

So what happens is as follows

When power consumption of tumble dryer goes above 500W (it normally sits about 0.2W when off) make variable TumbleDryer = On AND stop timer

When power consumption of tumble dryer goes below 5W make variable TumbleDryer = Off AND start timer TumbleDryerOffFor5Minutes with start time of 5 minutes.

When timer reaches 0 send email notifications to boxcar which then sends push notifications to our phones.

The reason for the timer and not simply sending a notification as soon as power drops is sometimes it will pause for a little while change direction etc.

This means that when it stops, timer starts, if it starts again timer stops and resets.

Once its been stopped for 5 minutes notifications are sent.

Hope this helps

Cheers

Noel

Posted on
Mon May 25, 2015 11:09 pm
jens offline
Posts: 265
Joined: May 03, 2015
Location: Sweden

Re: Do Action if variable is still the same after five minut

Thanks Noel,

Try it to day...

:D

//Jens

Posted on
Tue May 26, 2015 12:52 am
jens offline
Posts: 265
Joined: May 03, 2015
Location: Sweden

Re: Do Action if variable is still the same after five minut

Noel,
You have a Pause trigger whats that??

:?:

Posted on
Tue May 26, 2015 1:19 am
noel1983 offline
Posts: 446
Joined: Oct 17, 2014

Re: Do Action if variable is still the same after five minut

I think that's from when I was getting to grips with the timers and figuring out how best to set this up. It's no longer required! Good spot
Cheers

Posted on
Tue May 26, 2015 2:35 am
jens offline
Posts: 265
Joined: May 03, 2015
Location: Sweden

Re: Do Action if variable is still the same after five minut

OK, now it works

Posted on
Sun May 31, 2015 8:44 pm
midd offline
Posts: 372
Joined: Apr 18, 2010

Re: Do Action if variable is still the same after five minut

so how would I get it to work for multiple variables still the same?

I get the gist of the preceding posts. But I'm using the beacon plugin and geohopper and I need the timer to start (20 minutes) once indigo sees my phone and my wife's phone are away. Once the 20 minutes are up and we are both still away, I want to change my heating and cooling settings.

Indigo 7, Monterey (12.1) on a 2009 Mac Pro..

Posted on
Sun May 31, 2015 11:27 pm
noel1983 offline
Posts: 446
Joined: Oct 17, 2014

Re: Do Action if variable is still the same after five minut

Something along the lines of

When person 1 away check if person 2 away, If yes start timer

And vice versa if person 2 away check if person 1 away, if yes start timer

When timer reaches 0 turn off heating etc

When person 1 or 2 comes home then stop/reset timer, that then covers you if someone leaves and comes back quickly.

There may be better ways to do this so I'm sure more experienced minds will be along soon!

Posted on
Sun May 31, 2015 11:46 pm
kw123 offline
User avatar
Posts: 8377
Joined: May 12, 2013
Location: Dallas, TX

Re: Do Action if variable is still the same after five minut

each of your phone should start a trigger with a delayed action (20 minutes) if they are away, with condition that the other is away too.
if one of them comes back online you trigger a server/removed delayed action that removes the delayed action from the triggers above.

So I guess you would need 4 triggers, 2 for each phone: offline and back online.. off line starts a DELAYED action and online kills these actions.
and the action group should be a common action group i.e. change heater to away.


Another way could be to have one variable that gets increased / decreased by your phones changing to offline / online & condition:
one trigger checking if variable =2 then start delayed action group..
one trigger checking if variable <2 then kill delayed action group


no matter what I guess you need 4+ triggers.

Karl

Posted on
Mon Jun 01, 2015 6:23 am
midd offline
Posts: 372
Joined: Apr 18, 2010

Re: Do Action if variable is still the same after five minut

ok thanks. I think I have it.
Before my post, I had 5 triggers set up. 2 for each phone, 1 for being home, 1 for being away. The 5th would tell indigo to switch my housemode variable to vacation after we have been gone for twenty minutes.

So I used Karl's suggestion and created another variable, Phones not home. As each phone leaves the variable increases by 1 and decreases by 1 when each one returns home. When the value reaches 2, the 20 minute timer begins.

After 20 minutes that 5th trigger would kick in.

The more I look at it now, I only need the one variable, Phonesnothome. I'm also using the Myphone and myifesphone to show True or False depending on if we are present or absent. Phonesnothome is doing the triggering at a value of 2. The other two really aren't contributing to what I want done.

Image
Image

Indigo 7, Monterey (12.1) on a 2009 Mac Pro..

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests