Have Telegraf pull metering data from your Shelly Plug S and maybe even visualize that in Grafana!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Claudius Coenen 969562e88f major overhaul of pretty much everything 7 months ago
documentation major overhaul of pretty much everything 7 months ago
LICENSE-CC0.txt initial working version 7 months ago
README.md major overhaul of pretty much everything 7 months ago
shellyplug-dashboard.json major overhaul of pretty much everything 7 months ago
shellyplug-meter.conf major overhaul of pretty much everything 7 months ago

README.md

Shelly To Influx

Reads info about your shelly plug and posts it to InfluxDB.

grafana dashboard with two shellyplug s added to it

Setup (Telegraf)

Use shellyplug-meter.conf with Telegraf, just put it into your /etc/telegraf/telegraf.d directory and insert your shellyplug URLs in the url section. Make sure to keep the /status/0 part at the end.

Telegraf will post the measurements under shellies which was chosen because this is the canonical name for the mqtt endpoints. You can change this in shellyplug-meter.conf.

Setup (Grafana)

You may also use the shellyplug-dashboard.json with Grafana, just import it as a dashboard. While setting up this dashboard, you can set your local energy price in this dashboard's variables:

grafana variables: kwhPrice

Fields and their units

Sheshellyplug Documentation below for further info. The most odd one must be watt-minute ("total"). The Grafana dashboard correctly converts to the more common "watt hours" (which is just a division by 60, of course). We're keeping almost all of the Shellyplug names, I don't see a reason to change them even though there are inconsistencies.

  • timestamp: (number) Unix timestamp of the last energy counter value - we use this as timestamp in telegraf, taken from meters.0.timestamp. Not itself a field.
  • total: (number) Total energy consumed by the attached electrical appliance in Watt-minute
  • power: (number) Current real AC power being drawn, in Watts
  • overpower: (number) Value in Watts, on which an overpower condition is detected
  • temperature: (number) Device temperature in °celsius
  • overtemperature: (bool) true if device has overheated
  • ison: (bool) Whether the channel is turned ON or OFF
  • is_valid: (bool) Whether power metering self-checks OK
  • has_update: (bool) If there is a firmware update available
  • connected: (bool) If it is connected to the wifi (somewhat moot since we could never receive a "false" on this one.)
  • rssi: (int) Wifi signal strength in dBm

Tags

  • mac: MAC address of the device. Format AABBCCDDEEFF, no seperators
  • ssid": SSID of the currently connected wifi
  • ip: Current IP. Format 123.123.123.123
  • firmware: Currently running firmware, taken from update.old_firmware of the API, renamed for clarity

References