👍 What we like
- Real measurements instead of estimates
- Runs 100% locally, no cloud required
- Documented, maintained tools (Shelly RPC API, Home Assistant, Zigbee2MQTT)
- Three complementary levels of measurement: device, plug tracked over time, circuit
👎 What to watch
- The Shelly EM Gen3 must be wired to 230 V by a qualified electrician
- The PM 231 E has no network connection: manual readings only
- The Shelly EM Gen3 measures single-phase power on two channels, and ignores loads under 30 VA per channel
- Zigbee plugs need a Zigbee coordinator on top
📑 Contents ▾
- 01 Which tool for which measurement
- 02 How much does a NAS draw, and why the figure varies
- 03 Tutorial prerequisites
- 04 Walkthrough: from the power meter to the Energy dashboard
- 05 Verification
- 06 Security and best practices
- 07 Troubleshooting common errors
- 08 Comparing the consumption of 4-bay NAS units (DS923+, TS-464, DXP4800 Plus)
- 09 Reducing the consumption of a NAS or home server
- 10 The UPS: protecting the NAS, not measuring its consumption
- 11 FAQ
- Our picks
To know what your homelab really costs in electricity, you have to measure it: a NAS’s or a server’s consumption depends too much on its drives, its load and its sleep settings to be guessed. Three tools complement each other: a plug-in power meter for one-off readings, device by device; a smart plug with energy monitoring to track a device over time; and a module such as the Shelly EM Gen3, installed in the electrical panel, to track a whole circuit. As a reference point, Synology rates its DS224+ 2-bay NAS at 4.41 W with drives hibernating and 14.69 W in access mode: your machine, with your drives and your services, will not necessarily draw the same.
Which tool for which measurement
| Tool | What it measures | How you read the data | Limit per the spec sheet | Installation |
|---|---|---|---|---|
| Brennenstuhl PM 231 E power meter | One device or a power strip: voltage, current, power, cumulative energy | On its LCD display, with no network connection at all | 16 A / 3680 W | Between the wall outlet and the device |
| Shelly Plug S Gen3 Wi-Fi plug | One device, continuously | Locally, in Home Assistant | 12 A / 2500 W | Between the wall outlet and the device |
| Nous A1Z Zigbee plug | One device, continuously | Through a Zigbee coordinator (Zigbee2MQTT, for example) | 10 A / 2500 W | Between the wall outlet and the device, plus a Zigbee dongle |
| Shelly EM Gen3 module | One or two single-phase circuits | Local RPC API, Home Assistant | Nothing is measured below 30 VA per channel | In the panel, wired to 230 V by an electrician |
The right tool depends on the question you are asking:
- “How much does my NAS draw?” A power meter is enough. Plug it in, let it run through 24 hours of normal use and read the cumulative energy: that is Step 1 of the walkthrough below.
- “What does this setting change?” (drive hibernation, a new container, shutting down at night). You need a curve over time, so a smart plug or the Shelly EM Gen3, logged in Home Assistant.
- “What does the whole rack, or the whole circuit, draw?” A smart plug under the rack’s power strip works as long as the total load stays under its limit (10 A for the Nous A1Z, 12 A for the Shelly Plug S Gen3). Beyond that, or to track a whole room, the Shelly EM Gen3 measures the circuit at the panel. For three-phase installations, Shelly offers the Pro 3EM (120 A clamps, rated accuracy of ±1%).
The Shelly EM Gen3 is not designed to measure a small NAS on its own: per its spec sheet it measures nothing below 30 VA per channel, and a device like the DS224+, rated at 14.69 W in access mode, can stay under that threshold. For a single device, a plug or the power meter is a better fit.
Smart plug: Wi-Fi or Zigbee
This is the simplest way to track a device over time without calling in an electrician. There are two families:
- Wi-Fi, such as the Shelly Plug S Gen3. It joins your 2.4 GHz Wi-Fi network directly, works locally and is added to Home Assistant through the same Shelly integration as the EM Gen3 module (Step 7). Its maximum load is 12 A / 2500 W. The TP-Link Tapo P110 is another Wi-Fi plug with energy monitoring, rated at 16 A / 3680 W by its spec sheet.
- Zigbee, such as the Nous A1Z or the Aqara Smart Plug SP-EUC01. They don’t use Wi-Fi: you need a Zigbee coordinator (a USB dongle plugged into the Home Assistant server, for example), then Zigbee2MQTT or Home Assistant’s Zigbee integration. The Nous spec sheet lists 10 A, 2500 W and 0.5 W of standby self-consumption. For the Aqara SP-EUC01, we don’t have a verified manufacturer spec sheet: check its maximum load before plugging a power strip into it. To set up the coordinator, see our Zigbee2MQTT tutorial.
The spec sheets we gathered for these plugs don’t state a measurement accuracy. For comparison, the Shelly EM Gen3’s sheet lists ±2% on voltage and on current between 1 and 50 A, and ±5% below 1 A. To find out whether your plug is reliable, plug the same device into the power meter and then into the plug, and compare the two readings.
How much does a NAS draw, and why the figure varies
There is no single figure. The DS224+ reference point quoted above was obtained by Synology under its own conditions, with its own drives. Its 60 W power adapter does not tell you its consumption, only the most it can supply.
What moves real-world consumption:
- Hard drives. A 3.5-inch drive draws several watts while reading and writing, and more at start-up (spin-up). The figures are in each drive’s detailed datasheet, not always on the product page: the WD Red Plus 4 TB (WD40EFPX) page, for example, doesn’t give them. With four drives, the gap between idle and activity becomes significant.
- Drive hibernation (spin-down). The DS224+‘s two values match these two states: drives stopped on one side, drives active on the other. The trade-off is that the first request after sleep waits a few seconds for the drives to spin back up, and stopping and restarting them too often wears them out.
- Constant activity. A service that keeps reading or writing to the drives prevents them from hibernating, and a CPU under constant load (transcoding, virtual machines) draws more than at idle.
- The gear around it. PoE switch, router, external USB enclosure: each one adds to the bill. To include them, measure the rack’s power strip rather than the NAS alone.
- Heat. In a closed cupboard, fans spin faster and draw more power.
To turn a reading into a yearly cost, take the energy measured over 24 hours (in kWh), multiply it by the number of days in a year, then by the price per kWh on your contract. A full day of measurement is better than an instantaneous power reading taken at a quiet moment: it accounts for overnight backups and periods of activity.
Tutorial prerequisites
- An up-to-date, supported Linux server: Debian 12 or 13, or Ubuntu 22.04, 24.04 or 26.04 LTS (the versions Docker Engine supports according to its documentation).
- A user account with
sudo. - For outlet measurements: a Brennenstuhl PM 231 E. According to its manual, do not plug in any device (or loaded power strip) that draws more than 16 A. Check the manual for your unit.
- To track a device over time: a Shelly Plug S Gen3 (2.4 GHz Wi-Fi), or a Zigbee plug and its coordinator.
- For circuit measurements: a Shelly EM Gen3 (supplied with a 50 A clamp; the 80 A clamp is compatible), 2.4 GHz Wi-Fi, and a qualified electrician to do the wiring in the panel.
- The
curlandjqtools on the server. - No ports to open to the Internet: everything stays on the local network (Home Assistant listens on TCP port 8123 by default).
Walkthrough: from the power meter to the Energy dashboard
Step 1: Measure a device at the outlet with the Brennenstuhl PM 231 E
Plug the PM 231 E into the wall outlet, then plug the device you want to measure into it (NAS, mini PC, switch, or the rack’s power strip if the total load stays under the manual’s limit). Let it run through a representative usage cycle, for example 24 hours, then read the instantaneous power and the cumulative energy on the display. Its spec sheet mentions 3 LR44 backup batteries, included.
Because the meter is not connected, record your readings in a file so you can compare them later. Replace the values in angle brackets with your own readings:
mkdir -p ~/homelab-energie
echo "date,appareil,puissance_W,energie_kWh,duree_h" > ~/homelab-energie/releves.csv
echo "$(date +%F),<nom_appareil>,<puissance_W>,<energie_kWh>,<duree_h>" >> ~/homelab-energie/releves.csv
Check: display the file to confirm the line was saved.
column -s, -t ~/homelab-energie/releves.csv
Step 2: Install the Shelly EM Gen3 in the electrical panel (electrician)
⚠️ 230 V hazard. According to Shelly, installation on the power grid must be done by a qualified electrician. The work is done with the power off: main breaker switched off and absence of voltage verified.
According to Shelly’s documentation, the wiring is as follows:
Module power : live -> terminal L, neutral -> terminal N
Upstream protection : 2 A breaker, B or C curve (6 kA breaking capacity)
Clamp A (CT A) : around the LIVE conductor of the measured circuit -> input IA
Clamp B (CT B) : around the live conductor of a second circuit (optional) -> input IB
Clamp direction : K -> L arrow in the direction of current flow (towards the load)
Conductors : 0.5 to 4 mm², stripped 6-7 mm, tightened to 0.4 Nm
A clamp must go around a single conductor, the live wire. If it goes around live and neutral together, the two currents cancel out and the reading is wrong. The module also has a relay (2 A max) that you don’t need here.
Check: once power is restored, the Shelly broadcasts a Wi-Fi access point named ShellyEMG3-XXXXXXXXXXXX, visible from a phone or a PC.
Step 3: Connect the Shelly to Wi-Fi and secure it
There are two methods: the Shelly app, or the built-in web interface. For the web interface, connect to the ShellyEMG3-… access point, then open http://192.168.33.1 (the access-point-mode address used in the Shelly API documentation). In the interface:
- in the Wi-Fi settings, enter your 2.4 GHz network (SSID and password), then disable the access point once the connection is confirmed;
- in the authentication settings, set an access password;
- update the firmware from the dedicated section.
Exact menu labels may change between firmware versions: check the documentation for your version. Then create a DHCP reservation on your router so the Shelly always keeps the same IP address.
Check: query the module from the server. The Shelly.GetDeviceInfo method responds even when authentication is enabled:
SHELLY=192.168.1.50 # replace with your Shelly's reserved IP
curl -s "http://$SHELLY/rpc/Shelly.GetDeviceInfo" | jq
You should get a JSON object with the device’s ID and firmware version.
Step 4: Read measurements through the RPC API
Gen2 and Gen3 devices don’t use the old Gen1 /status endpoint; they use the RPC API. The Shelly EM Gen3 exposes two EM1 components (instantaneous readings, id 0 and 1) and two EM1Data components (energy counters, in Wh). If you enabled authentication, add --digest -u admin:YOUR_PASSWORD (the username is admin):
# Instantaneous reading for channel A: voltage (V), current (A), active power (W)
curl -s --digest -u admin:YOUR_PASSWORD \
"http://$SHELLY/rpc/EM1.GetStatus?id=0" | jq '{voltage, current, act_power, pf}'
# Cumulative active energy for channel A, in Wh
curl -s --digest -u admin:YOUR_PASSWORD \
"http://$SHELLY/rpc/EM1Data.GetStatus?id=0" | jq '.total_act_energy'
Check: switch a known load on the measured circuit on and then off. The act_power value should change to match. According to Shelly’s spec sheet, the module treats anything below 30 VA per channel as no load. The same sheet states that the module stores at least 10 days of one-minute data on the device itself.
Step 5: Install Docker Engine from the official repository
Docker’s documentation advises against the get.docker.com script in production. Use the apt repository instead. The commands below detect Debian or Ubuntu automatically:
sudo apt update
sudo apt install -y ca-certificates curl jq
DISTRO=$(. /etc/os-release && echo "$ID") # debian or ubuntu
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL "https://download.docker.com/linux/$DISTRO/gpg" -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/$DISTRO
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Check:
sudo systemctl status docker --no-pager
sudo docker run --rm hello-world
docker compose version
You can add your user to the docker group (sudo usermod -aG docker $USER). You then need to log out and back in for it to take effect. Be aware that this group grants root-equivalent rights.
Step 6: Deploy Home Assistant (container)
Home Assistant supports Shelly devices natively and includes an Energy dashboard. The file below follows the official compose.yaml example. It does not mount the Docker socket:
mkdir -p ~/homeassistant/config && cd ~/homeassistant
# ~/homeassistant/compose.yaml
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- ./config:/config
- /etc/localtime:/etc/localtime:ro
- /run/dbus:/run/dbus:ro
restart: unless-stopped
stop_grace_period: 60s
privileged: true
network_mode: host
environment:
TZ: Europe/Paris
network_mode: host lets Home Assistant discover devices on the local network. privileged: true is in the official example (for hardware access: USB, Bluetooth), which is also what you need if you plug a Zigbee dongle into this server.
sudo docker compose up -d
Check:
sudo docker compose ps
curl -sI http://localhost:8123 | head -n 1
The container should be running and the curl command should return an HTTP response. Then open http://SERVER_IP:8123 from your local network and create the owner account.
Step 7: Add the Shelly and the plugs, and set up the Energy dashboard
The Shelly often shows up by itself as a Discovered device. If it doesn’t, go to Settings > Devices & services > Add integration > Shelly, then enter the module’s IP address and password. Mains-powered Gen2+ devices need no extra configuration, and no cloud connection is required. Power measurement depends on time synchronisation (SNTP): the Shelly must be able to reach its SNTP server.
A Shelly Plug S Gen3 is added the same way, through the Shelly integration. A Zigbee plug (Nous A1Z, Aqara SP-EUC01) is paired from Zigbee2MQTT or from Home Assistant’s Zigbee integration; its power sensors then show up just like the Shelly’s.
Next, open the Energy configuration (Settings > Dashboards > Energy in recent versions; the path may vary with your version). Add the energy sensors (kWh) of the Shelly or the plugs under device or circuit consumption. Power-only sensors (W) can be converted to energy with the Integral (Riemann sum) integration.
Check: in Settings > Devices & services > Shelly, open the device and confirm that the power shown matches the value returned by curl in Step 4.
Verification
# The container is running and restarts automatically
sudo docker inspect -f '{{.State.Status}} {{.HostConfig.RestartPolicy.Name}}' homeassistant
# The Shelly responds and is measuring
curl -s --digest -u admin:YOUR_PASSWORD "http://$SHELLY/rpc/EM1.GetStatus?id=0" | jq .act_power
Finally, take a device you measured with the PM 231 E and compare its reading with the power change the Shelly, or the smart plug, sees when you switch it on. The two values should be consistent, within measurement tolerances.
Security and best practices
- Never expose Home Assistant or the Shelly web interface to the Internet. For remote access, use a VPN (WireGuard, for example).
- Restrict port 8123 to the local network. With
ufw, allow SSH before enabling the firewall so you don’t lock yourself out:
sudo ufw allow from 192.168.1.0/24 to any port 22 proto tcp
sudo ufw allow from 192.168.1.0/24 to any port 8123 proto tcp
sudo ufw enable
sudo ufw status verbose
- Protect the Shelly with a password, disable its access point, and keep its firmware up to date. If you can, put IoT devices on a separate VLAN.
- Never mount
/var/run/docker.sockin a container that doesn’t need it. - Back up the
~/homeassistant/configfolder. Update withsudo docker compose pull && sudo docker compose up -d.
Troubleshooting common errors
- Unexpected negative power: the clamp is installed backwards. Have the electrician check the K → L direction, with the power off.
- Power reads 0 while devices are running: the load is below the 30 VA threshold, the clamp goes around live and neutral together, or it is on the wrong circuit.
curlreturns a 401 error: authentication is enabled. Add--digest -u admin:PASSWORD.404on/status: that is the Gen1 API. Use/rpc/EM1.GetStatus?id=0.- The Shelly is not discovered: add it manually by IP address. Check that the container uses
network_mode: hostand that the server and the Shelly are on the same network. - No energy data: check that the Shelly has the correct time (SNTP server reachable).
- The Zigbee plug won’t pair: check that the coordinator is recognised by Zigbee2MQTT or by the Zigbee integration, and that pairing is open when you put the plug into pairing mode (see its manual).
Comparing the consumption of 4-bay NAS units (DS923+, TS-464, DXP4800 Plus)
4-bay NAS comparisons often pit the Synology DS923+, the QNAP TS-464 and the UGREEN NASync DXP4800 Plus against each other. We have not yet included a verified consumption figure for these three models, so this page cannot say which one draws the least. On paper, they mainly differ in:
- the CPU: a 2-core, 4-thread AMD Ryzen R1600 in the DS923+, a 5-core Intel Pentium Gold 8505 in the DXP4800 Plus;
- networking: 2 × 1 GbE ports on the DS923+, with an optional 10 GbE module (E10G22-T1-Mini); 2 × 2.5 GbE ports on the TS-464; one 10 GbE port and one 2.5 GbE port on the DXP4800 Plus;
- extras: 2 M.2 NVMe slots on all three, a 4K 60 Hz HDMI output on the TS-464 and the DXP4800 Plus.
To compare their consumption, test them with identical drives (same number, same model), in the same state and over the same period: 24 hours on the power meter once the NAS is set up with its services, then a second reading after enabling drive hibernation. If you can’t measure before buying, compare the “access” and “HDD hibernation” values on each manufacturer’s spec sheet, checking which drives they were obtained with. To choose a model on the other criteria, see our 4-bay NAS comparison.
Reducing the consumption of a NAS or home server
Once measurement is in place, every setting can be checked on the Home Assistant curve:
- Enable drive hibernation. Synology DSM, TrueNAS and Unraid support it natively. If the curve never drops after the delay you set, a service is accessing the drives constantly: find out which one before blaming the setting.
- Stagger drive start-up (staggered spin-up) when the NAS or the controller card allows it. This avoids the current spike of every drive starting at once, which strains the power supply and the UPS.
- Choose drives from their detailed datasheet. In a NAS, prefer CMR drives to SMR drives, such as the WD Red Plus 4 TB (WD40EFPX); then compare the active and idle power figures each manufacturer publishes.
- Size the NAS to your needs. Two spinning drives draw less than four. If two bays are enough, the Synology DS224j is the brand’s entry-level 2-bay NAS, limited for virtualisation; the DS224+ (Intel Celeron J4125) is aimed at people who run containers. Compare their consumption on the Synology spec sheets.
- For a DIY build, aim for a low-power platform. A low-voltage CPU (an Intel N100, for example) and an 80 Plus Gold or better power supply; consumption then depends entirely on the components you choose, which is why it is worth measuring.
- Ventilate the room. A closed cupboard raises the temperature, and with it the speed and consumption of the fans.
The UPS: protecting the NAS, not measuring its consumption
A UPS with a USB port, such as the APC Back-UPS Pro 900VA, is first and foremost there to shut the NAS down cleanly during a power cut: it alerts the NAS over USB, which shuts down before the battery runs out. It reports its status and load, but it is not a measuring instrument: for reliable watts, the power meter, a smart plug or the Shelly EM Gen3 remain the reference.
Measurement does, however, help you size the UPS: start from the power measured on the rack’s power strip, not from the rating of the power supply. The calculation is explained in what UPS capacity for a NAS, and setting up automatic shutdown in our NUT tutorial. If you put the power meter between the wall outlet and the UPS, the reading also includes what the UPS itself draws: that is what you actually pay for.
FAQ
Can I plug the Shelly EM Gen3 into an outlet?
No. It is wired to L/N terminals in the electrical panel or in an enclosure, and it measures with clamp-on current transformers. To measure at the outlet, use a plug-in power meter such as the PM 231 E or a smart plug with energy monitoring.
Can the Brennenstuhl PM 231 E send its readings to Home Assistant?
No: it has no Wi-Fi or other network interface. It is for one-off readings, device by device, which you record yourself. For tracking in Home Assistant, use a smart plug.
What should I measure with the Shelly’s two channels?
For example, the circuit feeding your homelab rack on channel A and a second circuit on channel B. The Shelly EM Gen3 measures single-phase power. A three-phase installation needs a three-phase meter such as the Shelly Pro 3EM.
Do I need a Shelly Cloud account?
No. Home Assistant and the RPC API work entirely locally, as do Zigbee plugs with their coordinator.
Key facts
Our picks
Affiliate links · same price for youAqara Smart Plug SP-EUC01
Amazon · price and availability on the listing
WD Red Plus 4 TB (WD40EFPX)
Amazon · price and availability on the listing
See all our recommended gear in the shop.