Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fffonion/tplink-plug-exporter
TP-Link Smart Plug Prometheus Exporter
https://github.com/fffonion/tplink-plug-exporter
prometheus-exporter smart-home tplink tplink-kasa
Last synced: 2 days ago
JSON representation
TP-Link Smart Plug Prometheus Exporter
- Host: GitHub
- URL: https://github.com/fffonion/tplink-plug-exporter
- Owner: fffonion
- License: bsd-2-clause
- Created: 2019-10-04T07:35:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-13T21:58:38.000Z (8 months ago)
- Last Synced: 2024-11-05T21:45:42.833Z (15 days ago)
- Topics: prometheus-exporter, smart-home, tplink, tplink-kasa
- Language: Go
- Homepage:
- Size: 57.6 KB
- Stars: 125
- Watchers: 11
- Forks: 20
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tplink-plug-exporter
Export TP-Link Smart Plug metrics to grafana dashboard
## Install
Download from [releases](https://github.com/fffonion/tplink-plug-exporter/releases) or run from docker
```
docker run -d -p 9233:9233 fffonion/tplink-plug-exporter
```### Usage
Use the -h flag to see full usage:```
$ tplink-plug-exporter -h
Usage of tplink-plug-exporter:
-metrics.listen-addr string
listen address for tplink-plug exporter (default ":9233")
```## Grafana dashboard
Search for `Kasa` inside grafana or install from https://grafana.com/grafana/dashboards/10957
![img](https://grafana.com/api/dashboards/10957/images/6954/image)## Sample prometheus config
```yaml
# scrape kasa devices
scrape_configs:
- job_name: 'kasa'
static_configs:
- targets:
# IP of your smart plugs
- 192.168.0.233
- 192.168.0.234
metrics_path: /scrape
relabel_configs:
- source_labels : [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
# IP of the exporter
replacement: localhost:9233# scrape kasa_exporter itself
- job_name: 'kasa_exporter'
static_configs:
- targets:
# IP of the exporter
- localhost:9233
```## Docker Build Instructions
Build for both `arm64` and `amd64`:
```
docker build -t :latest-arm64 --platform linux/arm64 --build-arg GOARCH=arm64 .
docker build -t :latest-amd64 --platform linux/amd64 --build-arg GOARCH=amd64 .
```Merge them in one manifest:
```
docker manifest create :latest --amend :latest-arm64 --amend :latest-amd64
docker manifest push :latest
```## See also
- Original reverse engineering work: https://github.com/softScheck/tplink-smartplug