Measure energy usage of washer cycle?

Smart switch with energy monitoring plugged into a washing machine, I’d like to calculate the energy used per cycle. All I want to do is include that amount in the notification that says the cycle is done, and then I’m happy to throw that data away.

How should I go about this?

What entities does the smart switch make available for energy or power?

Current consumption in watts, today’s/total consumption in kWh. I used current before in NodeRed but I understood NodeRed better. I am not using NR anymore and I just need a way to either count the current consumption in a var when the washer starts, and store it for later for when the cycle ends. Or store today’s or the total consumption at start and when the cycle ends, subtract that stored amount from the new total and convert back down to watts.

I just don’t know how to do those things in automations.

Alright I made an input_number and set the max to 100,000. Then in my automation that detects the washer has started (>3W for a minute), I set the input number to the total watt consumption from my smart plug. When the washer cycle ends, I set the input number to total watt consumption - the input number. Ta-da!

Code looks like:

In washer start automation:

service: input_number.set_value
data:
  value: "{{ (states.sensor.kasa_110_total_consumption.state | float * 1000)}}"
target:
  entity_id: input_number.washer_watts

In washer end automation:

service: input_number.set_value
data:
  value: >-
    {{ (states.sensor.kasa_110_total_consumption.state | float * 1000) -
    (states.input_number.washer_watts.state | float | round(0)) }}
target:
  entity_id: input_number.washer_watts
service: notify.antarctic_tanning_solutions
data:
  message: >-
    🧺👕Washer cycle complete! It used {{
    (states.input_number.washer_watts.state | int) }} WH.
3 Likes