Skip to content

How It Works

Dave Schmid edited this page Oct 3, 2024 · 1 revision

How It Works

Kasa Collector is designed to automate data collection from Kasa Smart Plugs. It offers two modes: Automatic Device Discovery and Manual Device Configuration.

Automatic Device Discovery

Kasa Collector automatically discovers compatible Kasa devices on your network. By default, it sends discovery packets regularly (KASA_COLLECTOR_DEVICE_DISCOVERY_INTERVAL) and identifies devices that support energy monitoring.

To control automatic discovery, use the KASA_COLLECTOR_ENABLE_AUTO_DISCOVERY environment variable:

  • Enable Auto-Discovery: Set KASA_COLLECTOR_ENABLE_AUTO_DISCOVERY to true.
  • Disable Auto-Discovery: Set KASA_COLLECTOR_ENABLE_AUTO_DISCOVERY to false.

Manual Device Configuration

If devices are not automatically discovered, or if you prefer manual configuration, you can specify device IPs or hostnames using the KASA_COLLECTOR_DEVICE_HOSTS variable. This variable accepts a comma-separated list of device IPs/hostnames.

  • Example: KASA_COLLECTOR_DEVICE_HOSTS="10.50.0.101,10.50.0.102"

TP-Link Account Configuration

For Kasa devices requiring TP-Link account authentication, provide your credentials with the KASA_COLLECTOR_TPLINK_USERNAME and KASA_COLLECTOR_TPLINK_PASSWORD variables. These credentials enable control of TP-Link cloud-authenticated devices.

Proceed to the Environmental Flags page for a complete list of environment variables used by Kasa Collector.