Track Your Electricity Consumption with Shelly Pro 2PM: Advantages and Home Assistant Integration

April 25, 2025 · smart home, home automation, energy monitoring, Shelly Pro 2PM, Home Assistant, DIY

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:

What You’ll Need

Safety first! Always turn off power at the breaker before working with electrical wiring. If you're unsure, consult an electrician.

Step 1: Installing the Shelly Pro 2PM

Wiring It Up

  1. Turn off the main power at the breaker. Verify it’s off with a voltage tester.
  2. Mount the Shelly Pro 2PM on a DIN rail in your electrical panel.
  3. Connect the power supply (L/N) to the Shelly’s input terminals.
  4. 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

  1. Restore power and check the Shelly’s LED. It should blink blue during Wi-Fi setup.
  2. 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

  1. 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
    
  2. Configure Shelly to use MQTT:

    • Go to Shelly’s web interface → Internet & SecurityMQTT.
    • Enter your broker details and set the topic to shelly/pro2pm.
  3. 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

  1. Enable the Energy Dashboard in Home Assistant:
    # configuration.yaml
    energy:
      dashboard:
        - name: "Electricity"
          source: sensor.living_room_power
    
  2. 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


Going Further


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.

Building something like this in production?

I help teams turn setups like this into reliable, monitored infrastructure.

Get a free consulting call

Get my monitoring stack checklist

The exact checklist I use when setting up observability for a new team. No spam, unsubscribe anytime.