How do I add Kasa KP125 and KP125M energy monitoring plugs to Energy Dashboard

Under the hamburger for the Energy Dashboard, I see the ability to add an individual device. As expected, it requires a sensor with an energy (e.g., kWH) unit of measurement.

The KP125 offers three such sensors:

  • Total Consumption
  • This Month’s Consumption
  • Today’s Consumption
  1. Am I correct in assuming that I should use “Total Consumption” and that the corresponding value tracks total cumulative kWH since device was first used (or last reset)?

In contrast, the KP125M offers only two consumption sensors:

  • This Month’s Consumption
  • Today’s Consumption
  1. Since there is no “Total Consumption” which if any of the 2 listed above should I use? (and why is there no “Total Consumption” sensor?)
  2. Will there be a problem since presumably these “reset” each month and day respectively, potentially creating discontinuities in the data for periods longer than a day?
  3. Regardless, what I do for the Energy dashboard, is it possible and advisable to programmatically created my own derived “Total Consumption Sensor” either by using the historical sum of “Today’s Consumption” or by calculating it cumulatively based on the real-team Watts flowing? Any suggestions on how best to proceed?

Daily, monthly, or total consumption will all work fine for energy dashboard, it doesn’t care if the entities reset their values.

So, what happens for example when you are looking at quarterly bins in the Energy dashboard… if you restarted HA, how will it know how much was consumed in prior months since there is no new “sensor” created for cumulative consumption and the existing sensors store only a month.

On doing some more research, it seems I may be better off using something like PowerCalc to create a new energy-like “total_consumption” sensor based on the “current_consumption” sensor (which confusingly actually measures power)

All energy is based on long term statistics.

Every hour, the value of the sensor is snapped into long term statistics. It compute the delta between that hour and the previous hour, and stores that in long term statistics. So even if the sensor value resets to zero every night, energy is only looking for the change from one hour to the next, so it can accurately measure consumption no matter how often it resets.

So does that mean if you have statistics for both “Today’s Consumption” and “This Month’s Consumption” then the statistics should be identical since they are both non-decreasing based on the delta from the previous hour’s consumption?
Said another way, is it redundant to have both as statistics?

(still not sure how it handles the case where the reset occurs a little off from the actual hour mark… is it just monitoring it continuously so it knows how much it increases minue-by-minute and adds all positive increases – monotonic non-decreasing)

I think that’s the case.

It does not matter at all when during the hour it resets, doesn’t have to be aligned to any timestamp. It could even reset multiple times per hour.

Thanks for the clarification.
Based on the following sql query analysis performed on a KP125 (which has Total as well as Monthly and Today), I remain a bit concerned about edge effects calculating the total for a KP125M due potentially to monthly and daily resets
Specifically, I ran the following sql query on a KP125M

(TEMP1=94; TEMP2=92; TEMP3=95; HOURS=1200000; sqlite3 $DB -separator "SELECT DATETIME(s1.start_ts, 'unixepoch', 'localtime') AS DATE, ROUND(s1.sum,1) AS TOTAL , ROUND(s2.sum,1) AS MONTH, ROUND(s3.sum, 1) AS TODAY, ROUND(AVG(s1.sum - s2.sum),1) AS TOT-MON,  ROUND(AVG(s1.sum - s3.sum),1) AS TOT-TOD, FROM statistics s1 JOIN statistics s2 ON s1.start_ts = s2.start_ts JOIN statistics s3 ON s1.start_ts = s3.start_ts WHERE s1.metadata_id = $TEMP1 AND s2.metadata_id = $TEMP2 AND AND s3.metadata_id = $TEM3 AND s1.start_ts > strftime('%s', 'now', '-$HOURS hours') GROUP BY s1.start_ts ORDER BY s1.start_ts;")

The query compares the values of the ‘total’, ‘monthly’ and ‘today’ consumption for optionallystate and sum columns in optionally the short or long term statistics table.

My findings are as follows looking over the past 11 months for one energy sensor:

  1. For the sum column:
Date              Total      Month   Today
2024-07-09   4.4         0.0         4.4
2025-06-07   48.0       43.6       47.2
  • Interestingly, at the beginning:
    Total = Today = 4.4 > Month = 0.0 which seems a bit strange since I would have thought Total >= Month >= Today)
    At the end:
    Total - Month remains 4.4
    But Total - Today increases from 0 to 0.2 to 0.8 suggesting that potentially there is some edge effect perhaps due to resetting.

Since this switch is only used occasionally, it’s possible that there are also edge effects for Total vs. Month that I just am not seeing.

  1. For the state column:
Date              Total      Month    Today
2024-07-09   4.4         0.0         0.0  
2025-06-07   42.6       0.2         0.0

Not really sure I understand what is going on here…

The bottom line is that if the math is similar for the KP125M which lacks the total sensor, then there may be edge effects using the ‘sum’ statistics value for either Month or Today as a proxy for Total. Presumably, though ‘Month’ is better than ‘Total’.