Need to count button pushes and then act - help please


#7

I think I see what you’re trying to do. If you can take a snapshot using the green button at the bottom of your piston, I’ll take a crack at cleaning it up tonight (or tomorrow if I fall asleep before it’s posted). :slight_smile:


#8

Wow…thanks very much. Really appreciate the chance to learn more about how to do this.


#9

I’m new to this too [installed my system Monday this week] and the people here have been super helpful to any questions I’ve had, so I’m glad to help anyone else!

I’ll clean this up now and will repost in a bit!


Apparently I’ve maxed out the number of posts I can make on my first day on the forum - hopefully I can edit this one and still get you what you need!

See if this does what you want? I didn’t have your items listed so you’ll have to re-select them from the dropdown.

To get this to import, try going to “add a new piston”, “Restore a piston using a backup code”, then enter the df5f code shown.

Any questions or hiccups, let me know!


#10

Cool, thanks, I’ll look at it now (at least until my wife tells me “PUT THAT COMPUTER AWAY!!” :slight_smile:

Wow. I’ve been using Core for a couple years (mostly simple stuff) and just converted to WebCore - this option to share and import pistons is amazing…I should have converted to WebCore much sooner.

I imported your piston and replaced the devices - it looks “right” unlike my effort. :slight_smile: I won’t be able to test now until tomorrow - wife looked at me like I was crazy when I suggested I might get some towels wet and put them in the dryer right now. She might be right, but I’m having fun making the world (or at least our house) a cooler place to be. :smiley:


#11

@Danabw can you share both piston for washer and dryer once you get them to work. Thanks


#12

Sure. You should also see this thread.


#13

OK, things have changed overnight…I reviewed the Aeon HEM washer and dryer logs again and found that I don’t need to use counters for the dryer, and I can’t use them w/the washer. Apologies for asking the wrong question.

The dryer logs make it look like it should be simple, based on a button push and hold state, and the washer logs are so chaotic that a timer seems like the best option (we run the same cycle pretty much all of the time).

I tried two versions of a dryer log based on Aeon HEM states, one looking for two different virtual button states (pushed, then held), and another looking for a dryerstatus=on.

None of my pistons worked.

I’ve included them below, as well as a link to a spreadsheet I created with the Aeon HEM washer and dryer clamp logs from two different cycles from each.

Appreciate help in getting the pistons to work.

Washer/Dryer logs

Dryer Pistons:

Washer piston:


#14

Just throwing this out there… The best way I’ve found to tune thresholds for energy meter readings is by logging the power to a Fuel Stream for a few power cycles. You will be able to clearly see the power usage on the fuel stream chart.

Here is an example of a piston that logs to a Fuel Stream. Just don’t leave it logging to the steam forever, please.


#15

You’re close but the nested if’s need a tweak in order to work properly. When the outer if evaluates to true the inner one is evaluated immediately thereafter. However in practice the inner event would happen later on.

There is a Followed By operator that allows you to match a set of conditions then wait for another set of conditions to match. To use it you would edit your outer if and convert the conditions to a group. Then, add a new condition to the if for the trigger that follows at a later time. Finally click the operator between the conditions and change it to Followed By. It will look roughly like

if
    (
        Keypad pushed
        and
        Time is between
     )
    followed by
    Keypad held
then

I hope that helps! I also have a dryer monitored by Aeon HEM so I’ll stick around to help.


#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.