I have a "dumb" washing machine with power measured socket. This reports the power and energy. I'd like to determine if washing machine is currently active or not. The rule is to be below 5W for at least one minute I have achieved the job, but I'm not really sure if that's the best approach or is something better here.
- Source of data is the Athom power plug that reports current power (yellow line on the chart)
- I've created a statistics helper that takes past 2 minutes of power data and averages them (blue line)
- I have another template binary sensor "is active" that checks if the statistics helper is below 5W. Template is very simple:
{{ states('sensor.washing_machine_last_2_minutes_power')|float(0) > 5 }}
I use then the "is active" binary sensor in the automation plus it is helpful as I see the washing machine status history. I plan to use this binary sensor to count number of washing machine cycles, etc.
What I'm not sure is if there is more appropriate way to get a "is active" with a single binary sensor without an intermediate one. The rule is that it shall be below 5W power for at least a minute.