Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TP-Link energy monitoring values all wrong #12029

Closed
timdonovanuk opened this issue Jan 29, 2018 · 10 comments
Closed

TP-Link energy monitoring values all wrong #12029

timdonovanuk opened this issue Jan 29, 2018 · 10 comments

Comments

@timdonovanuk
Copy link

timdonovanuk commented Jan 29, 2018

Home Assistant release (hass --version):
0.62.0

Python release (python3 --version):
Python 3.5.3

Component/platform:
platform: tplink

Description of problem:
The values the HA tplink component reports do not match up with the actual values as reported by the tplink app (Kasa).

Here is what the app reports:
screenshot_20180129-125945 small

Here is what HA reports:

current_power_w: 0.00 v
voltage: 250.2
total_energy_kwh: 1.880 (what is this value supposed to be, as it doesn't match any even closely)
today_energy_kwh: 0.214
current_a: 0.02

expected

I'd expect to see HA values that reflect the same (or at least close) as above, such as:

current_power_w: 0.00 v
voltage: 250.2
current_a: 0.02

30_day_total_energy_kwh: 33.3
7_day_total_energy_kwh: 16.1
1_day_total_energy_kwh: 0.21

30_day_average_energy_kwh: 1.11
7_day_average_energy_kwh: 16.1

Instead the values don't even match closely.

@DanNixon is this working fine for you?

@ReneNulschDE
Copy link
Contributor

Hi @timdonovanuk ,

based on your description, I can't find any mistake. I see only a feature request to add the 7 and 30 days total and average values.

The expected 1_day_total_energy_kwh is shown in the attribute today_energy_kwh.

total_energy_kwh should show the lifetime consumption.

Maybe I misunderstood the issue. Could you please clarify.

Thx

@timdonovanuk
Copy link
Author

timdonovanuk commented Feb 6, 2018

So today_energy_kwh is fine but total_energy_kwh doesn't match any expected value that the plug reports!

total_energy_kwh should show the lifetime consumption.

At the moment "lifetime consumption" means "lifetime of HA tracking the plug" rather than the actual value.

The plug is the source of truth. So why datalog the value in HA and use that to compute total_energy_kwh when the correct value could just be pulled direct from the plug? If HA is down or the plug is not connected to HA for whatever reason, the total_energy_kwh value will always be incorrect.

@ReneNulschDE
Copy link
Contributor

Maybe I'm wrong, but the ´total_energy_kwh´ is collected from the plug. See here and is not calculated based on the history in HA.

@timdonovanuk
Copy link
Author

Odd - so as mentioned in my first post, why in my example does the plug show total consumption 33.3 kwh and HA shows total_energy_kwh: 1.880 (a value which doesn't appear to match up to anything the plug reports)?

@DanNixon
Copy link
Contributor

DanNixon commented Feb 6, 2018

@timdonovanuk Have you checked the numbers reported in HA against what is reported by pyhs100 (https://github.com/GadgetReactor/pyHS100)? If they match then the issue is with the pyHS100 library (which is used to communicate to the smart plugs/bulbs).

May be worth checking with @rytilahti too as he is an author of that library.

@ReneNulschDE
Copy link
Contributor

the consumption of 33.3 on the screenshot is for the last 30 days only and not the total consumption.

@timdonovanuk
Copy link
Author

Thanks @DanNixon I'll have a go with that and report back!

@ReneNulschDE 33.3 > 1.88 so unless I'm misunderstanding you that doesn't many any sense, as lifetime total would always be a higher number than a 30 days rolling total.

@rytilahti
Copy link
Member

You have to check what does pyhs100 report to you, because that's where the homeassistant gets it data from. If the switch reports it as such (incorrectly), there's nothing that the component can do for it.

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@balloobbot
Copy link

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

@home-assistant home-assistant locked and limited conversation to collaborators Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants