Need to count button pushes and then act - help please


#16

When I use the Followed by option, it is inserted as “Followed by within 1 minute” by default. I cannot find any way to change that “1 minute” parameter.

46 AM

Also, when I set the Follow by option, the dialog as an option to set “Not negated” or “Negated.” Not sure which option to choose.


#17

My apologies, instructing from memory did not work out well there. The approach that I use is basically two separate if’s where the first if sets a variable running = true and the second if checks the finished trigger and that running is true. The second one then sets running = false after it triggers.


#18

@ipaterson

Cool, thanks for the update, that seems to make it much simpler (though I’ve totally confused myself so many times w/this that I have little trust in myself at this point.) :slight_smile:

Attached updated piston…

One question, I have intentionally put the action to set the “dryerRunning” variable to False in two places so I could ask a question about that.

Should it be inside the “then” statement w/the other actions, or in the “end with” statement? I wanted to find out if one location was considered better than the other.

Really appreciate your help and feedback, thank you.


#19

You have two with blocks there inside an else if, the end with line just marks the end of that block. Either works, occasionally I use separate with blocks for separate groups of logic because they are easier to reorganize later as a group.


#20

DOH!

I started the washer tonight to do a load, and see how my two washer pistons would work.

The simple timer (start timer if button one is pushed) kicked off w/out issue.

The other piston that uses a washerRunning variable to help start the timer did not start. Realized that the first section of that piston evaluates the variable and looks for a “false” value…I didn’t initialize the variable w/false so it had no value so the piston didn’t run! Oops…I’ve set the variable to initialize w/“false” as the value, so it should work next time.

However, since the simpler piston that just starts the timer off a push is working, if that holds up looks like that will do it for the washer.


#21

Victory w/dryer piston, it lets me know when the load initially finishes, and (just by dumb luck rather than planning on my part) the piston also notifies me at the end of each mini “wrinkle prevention” cycle that runs after the drying cycle is over.

Hopefully will have time to test my two current attempts at a washer piston today to see if either of them work.

Dryer piston:


Please help fix my laundry piston
#22

Thanks to@bangali for mentioning this in another thread, the scheduling options for followed by are configured on the condition after the followed by. So in addition to the normal options for the second condition you will also see “within” to change the time range along with a matching method to control the wait.

Maybe not relevant to this piston anymore but I had to correct my earlier misunderstanding to make sure you can use followed by in the future where it makes sense to do so!


#23

Thanks!

I eventually found that as well, but thanks for putting the specifics.

I did end up finishing both pistons, and neither ended up using counting - the dryer cycle ended up simple, and the washer cycle was just too inconsistent/random for counting to help…below is my final Washer cycle, which used the push to start and then set a timer. It’s solved my laundry notification issues, finally. :slight_smile: Tons of help from folks here like you w/out whom I would not have got this working.


#24

Thanks so much, @Danabw and @ipaterson. I feel like I’m close to getting this right, but not quite there yet. I actually do need the counting – the monitor occasionally reads phantom power on the circuit and it’s just enough to set the alert off. I’ve done what I can to monitor the fuel stream to set the On and Off wattage correctly, but the phantom spike set the alert off at random times. Getting the counting variable right would solve my problem.

Here’s what I have so far – but I feel like I have some of the order wrong because it seems to ignore the need to start the counting over if the button is held (because it’s ostensibly done) before it’s had at least 3 high readings. Seems to be alerting me before it’s had 4 low readings.

Been really fun to figure out the logic how to get this to work correctly, but I’m clearly missing the right commands to get it to do what it needs to. Happy to send the logs if that helps.


#25

Just a quick question…what purpose does the variable wattsCount serve in the piston? I only see it in this statement, and interestingly, it’s not in the list of defined local variables in the start of your piston.

39 AM


#26

Fresh set of eyes always helps, or maybe I had fixed it but didn’t save it. It lived like that for a period of time and then got bifurcated into the two High and Low. Let’s see if that works.


#27

@Fe2_O3 Did you get this working?


#29

I think this is it, @llcanada! I only have one load with this new code, but I got zero false positives during the wash – a first!. Going to leave it running and see if I get any false positives when it’s off – none yet, despite the usual phantom spikes which is a good sign.


#30

@Danabw - what SmartApp did you use to make the Google Sheets logs in post 13? I’ve used a couple but they don’t have nearly as much data as yours.


#31

Those were from the IDE…click on Devices, then click on the HEM Aeon device, then click on List Events. That opens the events log and you can scroll down to see all your device events.


#32

@Fe2_O3 how is the piston working for you now are you still getting any false reading etc? Thanks


#33

2/26/2018, 12:12:02 PM +485ms
+2161ms ║Piston waited at a semaphore for 2007ms

Does anyone know what this means? Thanks for the help.


#34

I believe that’s the general “information overload” message that WC sends out when too many events come across in a very short amount of time.


#35

It’s registers the washer and dryer finish about 9 loads out of 10, and has reduced premature alerts to maybe 1 time out of 10. Has completely eliminated the phantom loads – notifications for loads that never existed. Your mileage may vary, but I’m very happy.

Using a hardwired AEON HEM v1, with Mike’s edited handler


#36

Another 3 loads in the washer and dryer, and 6 correct notifications @llcanada.