Help creating automation based on power usage

Hi all,

Ive done a bit of reading previous topics on this, but none really fit my situation.

I want to notify when my washing machine is done - I have a smart plug with power monitoring

The part that Im not sure how best to achieve, is what to base my notification on. As you can see, during a cycle the usage will drop to 0w many times and for varying lengths of time.

The cycle times would also vary depending on which wash type we use, so defining a static length of time before idle wouldnt work

Any thoughts on how to achieve this?

I would not know how to do this in Homeassistant (as I am a Noob here), but as an engineering problem:

  • if state “idle”
    – wait for Power > 1800W
    – set state “heating”
    The heater is well detectable, and probably always present in a wash cycle.
    Unless it is a “cold wash”, but I never use those (fine wool needs it, but that goes to hand wash or dry cleaning, not in the machine).
    The ~2 kW usage is the heater. Hmm, interesting side note: german washing machines use 16A standard, typically 3 to 3.5 kW heaters. Machines for older-type wiring use 10A/2.2 kW; yours is more conservative than that…)
    – now wait for the falling flank of the heater use (drop to below 15W or so): set state “washing”

and that leaves detecting the greywater pump coming active.
But that comes on multiple times during the wash cycle, e.g. when swapping out the soap-water for fresh water.
In your posted power usage graph the final peak is about 200 Watts?
I am guessing that the greywater pump uses significantly less than 200W; so this would be a spin cycle?
But this is the highest peak after the heater, which is detectable.

If you are confident that every cycle ends with this 200W peak, I would implement another peak detection like

  • if in state “washing” (as detected above with the heater-detection)
    – wait for >160W power,
    – set state “rinse_spin”
  • if in state “rinse_spin”
    – wait for power below 5W,
    – set state “idle”
    – notify

Modeling such things as a finite state machine is an old engineers habit, therefore typical for me.
State machines are usually document as some kind of graph with named bubbles for the states and names arrows describing the transitions from one state to another.
I would also include timeout-transitions, at least to “idle”, so the whole system will always return to a know state.
And then put notifications whereever you want them. “washing done” would be the desired one, but the timeouts might also be useful.

1 Like

I have the same issue and spent weeks tweaking my automations for washing machine and dryer.

What you need to do is to run your washing machines with different programs and capture the power usage graph. Then you analyze them and see what kind of patterns you can identify in all of them or if you can identify a specific program and define specific rules.

The most parts of my automations is to set different power threshold levels as triggers and then either check the previous state or wait for another trigger.

For the end of the cycle, if the power drops I wait for a certain amount of time and if no more power is detected the machine is done, which is in my case 1:40 minutes. From what I can see in your graph this will not work very well, as the time span can be more than 20 minutes. But you know that this long time span is after the heat cycle, so you can set your automation up in a way that it waits after heating for long and if the state is not heating just for a shorter period. If there is a reoccuring pattern you can even set more intermediate states, which could help with the timing.

In the end there is no definitive answer as every washing machine is different.

1 Like

Thanks - I just started with the monitor so Ill have to wait a while to get more usage history, but this sounds like it could work! Just need to see more about the spin using 200W at the end - should be the same on all cycles

‘Data!data!data! he cried impatiently. I can’t make bricks without clay.’

  • Arthur Conan Doyle, Sherlock Holmes

Ugh I hope not. Looks like @hsemkem’s solution could work though