Making statistics on power consumption corelated to a device state?

I have a “smart” washing machine and hooked a smart plug to it to get its power consumption. This means I get the current washing machine program, and see the consumption in real time, but I would like to be able to put in place something that tells me how much energy a washing machine program took (so for example, get the daily consumption at the change of state of the washing machine program, and subtract it from the value when the program ends, then save it somehow so I can have statistics on all programs that were run). That’s one example, but I can think of other very similar use cases (linking my Steam account and PC power consumption so I can see how much a specific game takes, for example).

Some hints can be found here: Power consumption per one cycle (washing machine)

1 Like