The iot_fetcher project is designed to collect and process data from various IoT devices. It provides a framework for fetching data from sensors, storing it in a database, and analyzing it to gain insights. The project aims to simplify the integration and management of IoT devices in a scalable and efficient manner.
- Aqualink - Connects to pool pump to fetch temperature and settings
- Airquality - Connection to Google Maps Airquality API
- Balboa - Connects to SPA to fetch temperature and settings
- Elpris - Fetches energy price in Sweden SE 1-4
- Ngenic - Fetches temperature and settings from Ngenic
- Tapo - Connects to TP-Link Tapo smart devices to fetch power state, energy usage, and device metrics
- VictoriaMetrics Backup - Automated backup that streams
/api/v1/export/nativeto Google Cloud Storage every 12 hours
INFLUX_HOST- InfluxDB server hostname/IPINFLUX_TOKEN- InfluxDB authentication tokenINFLUX_ORG- InfluxDB organization nameINFLUX_BUCKET- InfluxDB bucket name for data storage
TAPO_EMAIL- Your TP-Link/Tapo account email addressTAPO_PASSWORD- Your TP-Link/Tapo account password
Run TAPO module individually for testing:
docker run --rm --env-file .env iot-fetcher:latest -- tapo- Schedule: Runs automatically every 12 hours (at
:10past the hour) - Storage: Google Cloud Storage, path templated via
GOOGLE_BACKUP_URI - Process: Streams VM's
/api/v1/export/native→ gzip → GCS (single file per run) - Filename:
vm-export-YYYYMMDDTHHMMSSZ.native.gz
INFLUX_HOST=http://database:8181 # VictoriaMetrics HTTP endpoint
INFLUX_TOKEN=... # only needed if VM is behind vmauth
GOOGLE_BACKUP_URI=gcs://your-bucket/vm-backups/%Y%m%dT%H/
GOOGLE_SERVICE_ACCOUNT='{"type":"service_account",...}'# Run backup manually inside the container
docker exec iot-fetcher python python/src/main.py backup_vm# Download backup from GCS
gsutil cp gs://your-bucket/vm-backups/20260422T12/vm-export-20260422T120500Z.native.gz ./vm-export.native.gz
# Stream into VM's import endpoint (ungzip on the fly)
gunzip -c vm-export.native.gz | curl -X POST \
--data-binary @- \
-H "Content-Type: application/octet-stream" \
"http://database:8181/api/v1/import/native"The Node.js service automatically discovers and monitors TP-Link Tapo smart plugs using the TP-Link cloud API.
Add your TP-Link credentials to your .env file:
TAPO_EMAIL=your-tp-link-email@example.com
TAPO_PASSWORD=your-tp-link-password- Device Status: Power on/off state, uptime
- Signal Quality: WiFi signal level and RSSI
- Energy Usage: Current power consumption, daily and monthly energy totals
- Device Information: Device ID, MAC address, alias, model
- Runs every 10 minutes
- Automatically discovers new devices
- Stores data in InfluxDB under measurement
tapo_device
make buildBuild the container an tag itmake runStart the application inside the docker containermake run MODULE=<module-name>Start a specifc module onlymake pushBuild and push the containermake devRebuild container with pydebugger installed and start application with debugger on port5678