Uses this container to scrape power data from the reverse-engineered kasa API running on the smart plugs (e.g. HS100).
Docker compose example
compose.yml
version: '3.8'
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_storage:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- 9090:9090
grafana:
image: grafana/grafana-oss:latest
container_name: grafana
restart: unless-stopped
ports:
- 3000:3000
volumes:
- grafana_storage:/var/lib/grafana
kasa-exporter:
image: fffonion/tplink-plug-exporter:latest
container_name: kasa-exporter
restart: unless-stopped
ports:
- 9233:9233
volumes:
prometheus_storage:
grafana_storage:
prometheus.yml
global:
scrape_interval: 15s
scrape_configs:
- job_name: "prometheus"
scrape_interval: 15s
static_configs:
- targets: ["localhost:9090"]
- job_name: 'kasa'
static_configs:
- targets:
# IP of your smart plugs
- 192.168.1.166
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: kasa-exporter:9233
# scrape kasa_exporter itself
- job_name: 'kasa_exporter'
static_configs:
- targets:
# IP of the exporter
- kasa-exporter:9233
Import grafana dashboard id: 10957 for power dashboard of your smart plug(s)