Collects electricity consumption data from Shelly energy meters and transfers it to InfluxDB 2
Tested with these Shelly devices:
- Shelly Pro 3EM
- Shelly Pro EM-50
- Shelly Pro 1PM
- Shelly Pro 4PM
- Shelly 3EM
- Shelly Plus Plug S
- Shelly Plus PM Mini Gen3
- Shelly Plug S (Gen3)
- Shelly Plug 2
- Shelly EM
There are two ways to get the data from the Shelly devices: Via local access (HTTP) or via the Shelly Cloud API.
Linux machine with Docker installed, InfluxDB 2 database
-
Prepare a Linux box (Raspberry Pi, Synology NAS, ...) with Docker installed
-
Make sure your InfluxDB2 database is ready (not subject of this README)
-
Prepare an
.env
file (see.env.example
) -
Run the Docker container on your Linux box:
docker compose up
The Docker image support multiple platforms: linux/amd64
, linux/arm64
, linux/arm/v7
The Shelly Collector sends the following data to InfluxDB (stored as fields in the given measurement):
power_a
(in W, if available)power_b
(in W, if available)power_c
(in W, if available)power
(in W, storespower_a + power_b + power_c
if not available)response_duration
(in milliseconds)temp
(in °C, if available)
By default, all numeric values are stored as floating-point numbers in InfluxDB. If you need integer values for power measurements instead (e.g., when migrating from Home Assistant), you can set the power data type to integer using the INFLUX_POWER_DATA_TYPE
environment variable:
INFLUX_POWER_DATA_TYPE=Integer
This will affect all power-related fields (power
, power_a
, power_b
, power_c
) while keeping other fields like temp
and response_duration
as floats. This is useful when you previously stored power values as integers and want to avoid InfluxDB type conflicts.
Copyright (c) 2024-2025 Georg Ledermann, released under the MIT License