Start timer when washing machine starts (watt measured through smart plug)

Right now my washing machine automation looks like this:

  • I am starting my washing machine
  • I afterwards use a switch Item in the OH UI to trigger a rule which
  • creates a timer for 3h
  • after timer expiry the washing machine is shut down (smart plug switched off)

I want to improve it to fully automate it and avoid flipping a switch in the UI to start the timer after turning the machine on.

I was thinking about retrieving the Item state for the watt usage and when it exceeds a threshold, let’s say 200 W, I start the timer. But I will regularly get input > 200W during the run and it would start tons of timers I assume.

Is there a way to identify the real startof the machine in between all data points and distinguish the 200 W from the dozens of 200 W states while the machine is running for 2h.

Or even better: to identify which program is of the several machine programs is running?

Not really but you don’t need to.

Assume the first > 200W event is the machine starting. Create your timer. For the subsequent triggers, check to see if the timer exists and scheduled to run. If it does, simply do nothing and exit.

To do that you’ll have to gather a bunch of data and figure out what the pattern of events are for each program. Then you’ll need to write code to detect that pattern when it occurs. This is doable but not easy. But the first step will be gathering the events over multiple runs of multiple programs to see if there is a detectable pattern there.

1 Like

Oh great! I was not thinking of that, even though it’s so simple. I can just add a null check and avoid it being created multiple times. I will test it. That will improve my automation already.

I am actually doing that right now using InfluxDB and Grafana, but it takes a lot of time to get all the programs and to run them multiple times for the patterns :slight_smile:

I would go the other way.

The first time that the washer goes above 200W, enable a rule that checks for when consumption drops below a minimum theshold. I would guess that it’s always above this threshold while the washer is running.

When it drops below the minimum threshold, you can set a timer to ensure it stays there and cancel the timer if energy spikes again (meaning that the washer is either still in use or a new cycle has been started). Otherwise, turn it off and disable the rule.

How much energy does your washer consume when it’s not in use? I assume it’s an older machine, but it still shouldn’t be drawing enough current that you’d need to worry about it.

1 Like

I’ve created a binding that does this.

3 Likes

Am doing this via a very simple rule, to announce my washing machine and dish washer being finished via Alexa. Works like a charm for one year or so. Needs one or two recordings of Watts over time to find the right thresholds, otherwise no timer needed.

2 Likes

Forget about timers, implement a state machine.
Use @Seaside’s binding or search the forum, there’s a ~2016 thread on determining white goods operating states generically based on consumption.

That’s easy. All washers use heaters to consume ~2000W for a variable period of time.
So use persistence to average the value across some seconds and use a threshold of >1000W.
I have experimented quite some with possible solutions and this is what I finally implemented in my energy management system.

You can determine if it’s a low or high temp program by looking at the time consumption stays >2kW.
But this is an XY type o’ question: when the state machine is operative, you don’t really care about the program. You only want to know when it’s done, and that the state machine will tell you.

1 Like

I was testing a bit and it is working very solid for my washing machine the way you described it. Now for the dish washer there’s a new problem. It is ACTIVE while above a threshold and there comes a timeframe during the running program where the machine goes to 0 Watt for around 1h 20 min. That’s the period of extreme heat in the machine to dry the dishes. Afterwards it goes to around 20 W for 1 min and then the program is done.

I therefore changed my idleTimer checking every 120 seconds for the idle state to increase a counter. If that counter reaches 3 I start another timer for shuting down the machine after 75 min.

The only concern I have is that my rule is triggered by the Item measuring the Watt consumption receiving an update. And there is so much action going on in the log caused by that…

I was reading through it. Seems nice and solid. I understood one can configure the active threshold and an idleTime But would it be able to handle my scenario described above with the 80 min “downtime” even though the machine is still not finished?

I will check the state machine option. The timers above are working but it feels like I create a ton of calculations for a simple task. Still though my problem is the dish washer now with the very very long down time to 0 W during the program runtime.

I’m admittedly still wondering how much you’re gaining by turning off these devices. If your dishwasher is drawing 0W when it’s drying the dishes, I’d be surprised if it draws more than that when it’s not running. Same for your washing machine.

As far as I’m aware, a power-monitoring plug doesn’t monitor its own power consumption (unless that’s just the ones I have). You might actually be increasing your overall consumption by having plugs monitoring 24/7 and constantly reporting to OH.

1 Like

Yes 80 min is not that much.

I mean would I be able to basically skip a 80 min timeframe of the machine running at 0 W before 1 min of 20 W and after that the program ends (which is the step I want to detect).

Would the state machine be able to detect the program ending having a 80 min idleTime configured? I guess I just do not understand how the idleTime works in your binding.

It is not necessarily only to shutdown the plug. I might want to send an Email or output an Alexa voice command when I am able to detect the “precise” program end. Of course a slight variance of some minutes is absolutely acceptable. Which I have right now with my multiple timers :slight_smile:

1 Like

Nothing in itself, but in combination with your own PV power production or variable energy tariffing it is beneficial to relocate white goods runtime.
Here’s a link to my website (German only) about how much that’ll save you.
For a typical household, controlling washers like that amounts to almost 100€ a year.

2 Likes