After getting so cozy with the Zigbee thermostats and temperature sensors, I've now grabbed four Zigbee plugs to test. Sonoff S60ZBTPF, which have a power meter built in alongside the switchable relay. 53 euros for all four, so a good 13 euros apiece.
Connected now are the fridge, freezer, TV cabinet and the water softener. The devices show up directly in MQTT via Zigbee2MQTT, Telegraf swallows the values and writes them into InfluxDB, exactly like with the thermostats, just with its own inputs.mqtt_consumer block in the Telegraf config because the plugs use a different topic format:
[[inputs.mqtt_consumer]]
servers = ["tcp://mosquitto:1883"]
topics = [
"zigbee2mqtt/Kühlschrank",
"zigbee2mqtt/TV Schrank",
"zigbee2mqtt/Gefrierschrank",
"zigbee2mqtt/Enthärtungsanlage",
]
topic_tag = "device"
data_format = "json"
name_override = "zigbee"
fieldinclude = [
"power",
"energy",
"energy_today",
"energy_yesterday",
"current",
"voltage",
"linkquality"
]
The really interesting thing afterwards was the Sankey in Grafana. It now nicely shows how the power flows: PV coming in, what goes to the grid, what the individual devices consume:

In the screenshot you can see 2.29 kW of PV production right now, 586 W of consumption and 1.70 kW going to the grid. The interesting one is the "Unbekannt" (unknown) block at 204 W, which is everything that doesn't have a plug yet. I want to shrink that over time.
Today I also added water consumption to Grafana, and that has a longer backstory.
When I started with the RTL-SDR and the Flightradar setup at the beginning of April, I wondered whether you couldn't also read out the water meter with it. Modern meters transmit their values via wMBus (Wireless M-Bus), a protocol that sits right in the ISM band, which an RTL-SDR can receive without any trouble. The only catch: the telegrams are encrypted and the key sits with the utility company.
So on April 13 I sent an email to my city and asked for the key. Today the reply came and I got started right away. The meter is a Kamstrup Multical 21. The wmbusmeters image gets the RTL-SDR dongle passed through via Docker and needs privileged: true for it:
services: watermeter: image: docker.io/wmbusmeters/wmbusmeters:latest privileged: true devices: - /dev/bus/usb:/dev/bus/usb volumes: - ./config:/wmbusmeters_data/etc - ./logs:/wmbusmeters_data/logs - ./influx_write.sh:/wmbusmeters_data/influx_write.sh:ro
The wmbusmeters.conf says which SDR dongle and which protocol is used - t1 is the wMBus mode that most water meters use:
device=rtlwmbus:t1 format=json meterfiles=/wmbusmeters_data/logs/meter_readings meterfilesaction=overwrite
And one config file per meter with the meter ID, type and the key from the utility company:
name=main id=XXXXXXXX key=******************************** type=multical21
wmbusmeters calls a shell script on every new telegram and passes the meter reading, and the script then writes it into InfluxDB:
#!/bin/sh total_m3="$1" [ -z "${total_m3}" ] && exit 0 curl -s --max-time 10 \ -XPOST "http://influx:8086/write?db=vault&u=api&p=****" \ --data-binary "watermeter,meter=main total_m3=${total_m3}"
One hour of work.

Total meter reading and the trend over the day. Makes sense if you want to see over the long run whether something is dripping somewhere.
Amazon Affiliate Links
This article contains Amazon affiliate links. If you buy something through them, I receive a small commission. It does not cost you any extra.