Track Your Electricity Consumption with Shelly Pro 2PM: Advantages and Home Assistant Integration
Track Your Electricity Consumption with Shelly Pro 2PM: Advantages and Home Assistant Integration
Ever stared at your electricity bill and wondered, “How did I use that much power?" I certainly have. That’s why I decided to take control by monitoring my home’s energy consumption in real-time using the Shelly Pro 2PM—a versatile, Wi-Fi-enabled energy monitoring device. In this guide, I’ll walk you through setting it up, integrating it with Home Assistant, and turning raw data into actionable insights.
Why Shelly Pro 2PM?
The Shelly Pro 2PM is a powerhouse (pun intended) for energy monitoring. Here’s why I chose it:
- Dual-channel monitoring: Track two circuits independently (e.g., HVAC and appliances).
- Local control: No cloud dependency—perfect for privacy-focused setups.
- Home Assistant friendly: Native integration via MQTT or REST API.
- Compact and DIN-rail mountable: Fits neatly in your electrical panel.
What You’ll Need
- Shelly Pro 2PM: amazon
- Screwdrivers (flathead and Phillips)
- Basic electrical safety knowledge (or a friend who has it)
- Home Assistant installed (I’m using version 2025.1)
- Optional: Grafana for fancy dashboards
Step 1: Installing the Shelly Pro 2PM
Wiring It Up
- Turn off the main power at the breaker. Verify it’s off with a voltage tester.
- Mount the Shelly Pro 2PM on a DIN rail in your electrical panel.
- Connect the power supply (L/N) to the Shelly’s input terminals.
- Attach the CT clamps (current transformers) around the live wires of the circuits you’re monitoring. Ensure arrows on the clamps point toward the load.
Powering On
- Restore power and check the Shelly’s LED. It should blink blue during Wi-Fi setup.
- Connect to its hotspot (SSID:
ShellyPro2PM-XXXX
) and configure Wi-Fi via the web interface (192.168.33.1
).
Step 2: Configuring Home Assistant Integration
Option 1: MQTT (Recommended)
Enable MQTT in Home Assistant (if not already done):
# configuration.yaml mqtt: broker: [YOUR_MQTT_BROKER_IP] username: !secret mqtt_username password: !secret mqtt_password
Configure Shelly to use MQTT:
- Go to Shelly’s web interface → Internet & Security → MQTT.
- Enter your broker details and set the topic to
shelly/pro2pm
.
Add sensors in Home Assistant:
# sensors.yaml - platform: mqtt name: "Living Room Power" state_topic: "shellies/pro2pm/emeter/0/power" unit_of_measurement: "W" device_class: "power"
Option 2: REST API
For a cloud-free setup, use Shelly’s REST API:
# configuration.yaml
sensor:
- platform: rest
resource: http://[SHELLY_IP]/status
name: "Shelly Pro 2PM Power"
value_template: "{{ value_json['emeters'][0]['power'] }}"
unit_of_measurement: "W"
Step 3: Visualizing Data in Home Assistant
Energy Dashboard
- Enable the Energy Dashboard in Home Assistant:
# configuration.yaml energy: dashboard: - name: "Electricity" source: sensor.living_room_power
- Group sensors for a unified view:
# groups.yaml energy_consumption: name: "Energy Overview" entities: - sensor.living_room_power - sensor.kitchen_power
Grafana (Optional)
For advanced users, push data to InfluxDB and visualize in Grafana:
# influxdb.yaml
sensor:
- platform: influxdb
host: [INFLUXDB_IP]
database: home_assistant
queries:
- name: "Hourly Power Usage"
query: "SELECT mean(value) FROM W WHERE time > now() - 1h GROUP BY time(1m)"
Troubleshooting Tips
- Shelly won’t connect to Wi-Fi: Double-check credentials and ensure 2.4GHz band is enabled (Shelly doesn’t support 5GHz).
- No power readings: Verify CT clamps are securely attached and facing the correct direction.
- MQTT issues: Test connectivity using
mosquitto_pub
(e.g.,mosquitto_pub -h [BROKER_IP] -t test -m "hello"
).
Going Further
- Automate alerts: Notify yourself when consumption exceeds a threshold:
automation: - alias: "High Power Alert" trigger: platform: numeric_state entity_id: sensor.living_room_power above: 1500 action: service: notify.telegram data: message: "⚠️ High power usage detected!"
- Compare with utility data: Use the Utility Meter integration to track daily/monthly totals.
FAQ
Q: Can Shelly Pro 2PM monitor 3-phase power?
A: No, but you can use multiple Shelly devices (one per phase).
Q: Is cloud required for Shelly Pro 2PM?
A: Nope! It works 100% locally with Home Assistant.
Q: What’s the max current it can handle?
A: 50A per channel with the included 50A CT clamps. For higher loads, use external 100A clamps.
Ready to take control of your energy usage? With Shelly Pro 2PM and Home Assistant, you’ll never be blindsided by your electricity bill again. For more smart home projects, check out my guides on Zigbee2MQTT and ESP32 temperature monitoring.