fffonion / tplink-plug-exporter Goto Github PK
View Code? Open in Web Editor NEWTP-Link Smart Plug Prometheus Exporter
License: BSD 2-Clause "Simplified" License
TP-Link Smart Plug Prometheus Exporter
License: BSD 2-Clause "Simplified" License
Hi,
One of my smart plugs (H110, hardware version 4.1, firmware version 1.1.0) is not returning on any metrics. It used to work before, but I had to move the plug and when I plugged it back in, I stopped receiving metrics for it.
Here is what I see on Prometheus.
# HELP kasa_online Device online.
# TYPE kasa_online gauge
kasa_online 0
I am currently using the tplink-plug-exporter_0.4.0_linux_armv7.tar.gz
of the exporter on a Raspberry PI 4. my other two plugs seem to be fine ( I can see metrics for them). But they are on hardware version 1.0 and firmware version 1.2.6, not sure if that has a impact. All three plugs are on the same 2.4GH network.
In the logs I see the following
level=error msg="error collecting 192.168.1.181 : system.get_sysinfo: dial tcp 192.168.1.181:9999: connect: connection refused" source=
I can see data for all free plus when using the Kasa app on my Android device,
Loving this exporter, but I'm targeting it against my HS300 Power Strip and it appears to only be pulling one plugs power wattage. Is there a way to make it pull either each one individually (like its 6 HS110s) or just pull an aggregate for the whole strip?
This does not seem to work with Kasa KP125M.
time="2023-12-27T03:59:47Z" level=error msg="error collecting 192.168.3.13 : system.get_sysinfo: dial tcp 192.168.3.13:9999: connect: connection refused" source="exporter.go:97"
time="2023-12-27T03:59:48Z" level=error msg="error collecting 192.168.3.14 : system.get_sysinfo: dial tcp 192.168.3.14:9999: connect: connection refused" source="exporter.go:97"
time="2023-12-27T04:00:02Z" level=error msg="error collecting 192.168.3.13 : system.get_sysinfo: dial tcp 192.168.3.13:9999: connect: connection refused" source="exporter.go:97"
time="2023-12-27T04:00:03Z" level=error msg="error collecting 192.168.3.14 : system.get_sysinfo: dial tcp 192.168.3.14:9999: connect: connection refused" source="exporter.go:97"
time="2023-12-27T04:00:17Z" level=error msg="error collecting 192.168.3.13 : system.get_sysinfo: dial tcp 192.168.3.13:9999: connect: connection refused" source="exporter.go:97"
Hardware version 1.0
Firmware version 1.1.4 Build 231019 Rel 174214
Google search reveals TP-Link blocked off API access or changed the API?
I configured prometheus with your prometheus.yml configs. I have updated the IP addresses to my TP link smart plugs.
Prometheus starts but I'm getting "server returned HTTP status 404 Not Found" for my 2 plugs. They are the HS110 model with latest firmware.
Any ideas?
Hi, thanks for the exporter and dashboard!
I noticed that in the "Total Power" singlestat (top right) you're adding the load (in Watts) to the total power (in Kilowatthours), which kinda doesn't make much sense, as the value would go down with a lower load. Maybe use just the total power in there? 🙂
I have an HS110 that still has old firmware and I can monitor it off port 9999. I get the emeter information:
{"emeter":{"get_realtime":{"current":0.020707,"voltage":124.223949,"power":0.371734,"total":1.040000,"err_code":0}}}
and understand the following to be the case:
current is amps,
voltage is volts,
total is kwHs.
But what is power? I thought it was watts. But I am not sure at all now as I cannot seem to compute the values I see from the current and voltage I see in the same entry. This would seem to be single phase, 120v, USA utility power. So it would seen this formula would apply:
P = PF × I × U
where:
P – Power or wattage;
PF – Power factor;
I – Electrical current; and
U – Voltage.
And I understand that the power factor varies from 0 to 1 where 1 represents the most efficient use of power and 0 means the opposite.
So if "power" is in watts, the value displayed should be 0.020707 *124.223949 * something between 0 and 1.
But I can only get close to the power result being displayed by using PF of .15 which would seem rather low (but I am not sure of this). So is that the PF the unit is employing? Does this make sense? I am monitoring a deep freezer.
Thanks
This project currently doesn't have a license declared or mention of who owns the copyright. Is there any chance you could bundle a file describing the license?
Thanks :)
I am not sure if this has been tested but since Kasa plugs are mostly discontinued, do you know if this is compatible with P110 plugs which are the new "replacements"? This is not available in all regions and I used one that I could find that has the full specs.
I've got the TPLink Extension plug KP303 and not all the panels have data.
Total Power, Power, Current, Voltage, and Energy Usage don't have any data and I've gone to check the metrics in Prometheus and they don't exist.
It might be worth mentioning I manually downloaded the file and created a system file to get it running. I've installed it on a RPi which doesn't have docker installed.
It's picking up data for the other panels so I know the exporter is some-what working.
Has anyone else experienced this?
Also, great job on putting this repo together!
Hello,
When I want to check metrics datas on my hs110 devices, I use :
curl -L http://localhost:9233/scrape?target=192.168.0.12
This is what he shows
curl -L http://localhost:9233/scrape?target=192.168.0.12
# HELP kasa_current Current flowing through device in Ampere.
# TYPE kasa_current gauge
kasa_current{alias="vidéoprojecteur"} 0
# HELP kasa_on_time Time in seconds since online.
# TYPE kasa_on_time counter
kasa_on_time{alias="vidéoprojecteur"} 357610
# HELP kasa_online Device online.
# TYPE kasa_online gauge
kasa_online 1
# HELP kasa_power_load Power of load in Watt.
# TYPE kasa_power_load gauge
kasa_power_load{alias="vidéoprojecteur"} 0
# HELP kasa_power_total Power of load and device itself in Watt.
# TYPE kasa_power_total gauge
kasa_power_total{alias="vidéoprojecteur"} 0
# HELP kasa_relay_state Relay state (switch on/off).
# TYPE kasa_relay_state gauge
kasa_relay_state{alias="vidéoprojecteur"} 1
# HELP kasa_rssi Wifi received signal strength indicator.
# TYPE kasa_rssi gauge
kasa_rssi{alias="vidéoprojecteur"} -35
# HELP kasa_voltage Current voltage connected to device in Volt.
# TYPE kasa_voltage gauge
kasa_voltage{alias="vidéoprojecteur"} 0
Do you know why I don't have all the datas ?
My plugs send well all the consumption informations on the android app.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.