Page 1 of 1

Need Simple Script-30 min from use?

PostPosted: Wed Dec 31, 2014 2:23 pm
by thomasw
Hi All,
Following a legacy post on here about sensing when a washer was done, I bought an Solo iMeter and plugged my washing machine into it. I then set up the trigger for current draw when it goes below 000.050, to activate an X-10 plug in chime in another part of the house, so I know when the washer is done. This works, but the problem is that this trigger goes off about every 3 hours or so, even though the washer hasn't been on? This makes no sense, because the washer current draw is 000.000 when it is off? I tried putting an addition condition in the trigger itself, to be only within 30 min of when the current draw was over 000.500, but there isn't a way to add that condition. So, I was wondering if I could put in the condition that a script would have to return that within the last 30 min the current has been over 000.500? There is a space at the bottom of the condition section for a script to return "true". But I don't know how to write a script to do that. Can anybody help me write this simple script?

Re: Need Simple Script-30 min from use?

PostPosted: Wed Dec 31, 2014 2:54 pm
by autolog
I think you can do what you want with two triggers and a variable. :)

Setup a variable named "within30minutes" (or whatever you want to call it) and set it to a value of 'false' (no quotes).

Then, setup a new trigger that fires when the load goes over 000.500 that has two actions: the first will set the variable to 'true' and the second will set it to 'false'. The second one should have a delay of 30 minutes and the 'override previous delay' box should be ticked.

Now in your existing trigger, you add in additional check for the variable being 'true' (i.e. within 30 minutes). If it is 'false' then you know it was longer than 30 minutes ago.

I am not sure why your meter is showing a load when nothing is plugged in unless it is something to do with the meter itself - I won't try to address that issue :wink:

Hope this helps :)

Re: Need Simple Script-30 min from use?

PostPosted: Wed Dec 31, 2014 3:00 pm
by kw123
I would do the following:
1. Trigger A ; triggers "if watts > 500 (washing machine on)" ; action 1: " enable Trigger B"
2. Trigger B : triggers " if watts < 1 (washing machine off)" ; action 1 : "whatever you like to do"; action :" disable trigger B" ### will fire only once, will be only reenabled if washing machine starts again.

no scripting

Karl

Re: Need Simple Script-30 min from use?

PostPosted: Wed Dec 31, 2014 3:09 pm
by autolog
Hi Karl,
An elegant solution :D

Re: Need Simple Script-30 min from use?

PostPosted: Wed Dec 31, 2014 4:55 pm
by kw123
I guess we typed the solutions at the same time.. there are always 20 ways to skin the cat.. ;-)

Re: Need Simple Script-30 min from use?

PostPosted: Thu Jan 01, 2015 4:13 am
by thomasw
Thanks for the replies guys.
karl, how do you do this?
..........action :" disable trigger B" ### will fire only once, will be only reenabled if washing machine starts again..........
I couldn't find any way to tell the trigger to disable anything?
I'm going to try what Autolog suggested to see if that will work. I'll post back when I have tried that.

Re: Need Simple Script-30 min from use?

PostPosted: Thu Jan 01, 2015 5:14 am
by autolog
Answering for Karl,
In the Trigger Actions tab, select Server Actions > Enable/Disable Actions > Enable Trigger or Disable Trigger :)

Re: Need Simple Script-30 min from use?

PostPosted: Thu Jan 01, 2015 2:10 pm
by kw123
Autolog, thanks for the quick reply.. here the whole sequence in screenshots:

Here the screenshot to enable/disable a trigger:
Screen Shot 2015-01-01 at 1.35.11 PM.png
Screen Shot 2015-01-01 at 1.35.11 PM.png (104.1 KiB) Viewed 5313 times



specifically for your scenario:
first you need to setup trigger B (as B is referenced in A it has to exist before you can reference it)
trigger B setup:
Screen Shot 2015-01-01 at 1.40.42 PM.png
Screen Shot 2015-01-01 at 1.40.42 PM.png (28.61 KiB) Viewed 5313 times

trigger B actions:
Screen Shot 2015-01-01 at 1.40.34 PM.png
Screen Shot 2015-01-01 at 1.40.34 PM.png (17.38 KiB) Viewed 5313 times



Then set up trigger A:
trigger A setup:
Screen Shot 2015-01-01 at 2.05.09 PM.png
Screen Shot 2015-01-01 at 2.05.09 PM.png (28.89 KiB) Viewed 5313 times

trigger A action:
Screen Shot 2015-01-01 at 1.41.28 PM.png
Screen Shot 2015-01-01 at 1.41.28 PM.png (26.26 KiB) Viewed 5313 times



Karl

Re: Need Simple Script-30 min from use?

PostPosted: Sun Jan 04, 2015 11:22 pm
by thomasw
Thanks Karl,
That did it perfectly. Now it works great. When the imeter solo detects current use above 12.000 watts, the Trigger A enables Trigger B. Then, when the washer is done the imeter solo detects equal to 0.000 and Trigger B sends the Indigo command to sound the X-10 chime in the other part of the house. Then Trigger B is disabled.
This solution works great. Thanks again to Karl and Jon for the replies and help! - Solved
-Tom

Re: Need Simple Script-30 min from use?

PostPosted: Sun Nov 20, 2016 7:10 am
by immergruen
Hi,

thank you for the nice howto but cannot make it work.
I´ve done everything but I receive a huge amount of mails, that the washing machine is ready.
It looks like the timer starts different times an does not reset.

I hope someone can give me some tipps to make it work.