Help creating automation based on the power variation of a washing machine (signal pattern)

Hi,
I have a combined washer-dryer, and I’m trying to capture the machine’s states, considering the power variation (in watts) during the washing and drying cycles.

Visual analysis of the signal allows me to identify these states, but when I try to create an automation to capture these states, I have difficulty using only the power value (above or bellow some threshold).

Does anyone have any suggestions to help me capture the states highlighted in the figure?

Thanks!

Hello Maquis,

Maybe just a bit over thinking things here. You are the pattern detector. Just do something like this.

This template sensor:

Then this automation…

And if you look at the code there is one there for the dryer as well right next to the washer one…

1 Like

I think you should make a binary sensor first to simplify things then automation is based on the binary on/off sensor. Its neat to have the pure power reading but i can see potential issues with this and power spikes, so put logic into your binary sensor then automate based on that would be barrier and foundation for more reliable automations.

1 Like

You can play with the statistics sensor.
Have it set to something like a half an hour or so.
Then my guess is that if the average is below 25 w, child protect mode.
Above 500 w drying.
Else, running.

A rough guess.

1 Like

Just adding this to you automation will work just fine if you want to detect if the washing machine or dryer is finished

If power is below x Watt for 20 seconds the do something.

Overhere it works flawless like this for many years already

1 Like

Hi,

I’d try smoothing the power readings first, possibly using a statistics sensor as mentioned earlier, to make the signal more reliable. Then, depending on how your machine’s states transition, you could use an input_select to represent the current state. Automations could update it based on detected transitions in the smoothed power values.

1 Like

Thank you all for the suggestions.

The solution that worked for me was to create a dropdown ‘helper’ with several states: Off, On, Washing, Drying, and Cooling down.

Based on the power and average power values (I created another helper for this), I capture the current state of the machine.

An important point is to ensure the temporal relationship of the states. For example, ‘Cooling down’ needs to come after ‘Drying’. With this, I was able to capture all the states correctly.