Successfully Integrating Shelly 3EM with MQTT in Home Assistant

Hey everyone, I wanted to share my recent success in integrating my Shelly 3EM energy monitor with Home Assistant using MQTT. I’ve been trying to get this working for a while, and I thought I’d document my process in case others are struggling with the same thing.

First, I set up my MQTT broker using Mosquitto, which I’ve been really happy with. Once that was up and running, I followed the Shelly documentation to configure the device to publish its data to my MQTT broker. The key was making sure the device was on the same network as my broker and that the MQTT settings were correctly configured in the Shelly app.

After some trial and error, I managed to get the Shelly 3EM publishing energy consumption data to topics like shellies/shellyem3-xxxx/emeter/0/power. To make this data usable in Home Assistant, I created a custom MQTT sensor configuration. Here’s a snippet of what I added to my configuration.yaml:

yaml
sensor:

  • platform: mqtt
    state_topic: “shellies/shellyem3-xxxx/emeter/0/power”
    name: “Shelly 3EM Power Usage”
    unit_of_measurement: “W”
    value_template: “{{ value_json }}”

This setup allows me to monitor my energy usage in real-time within Home Assistant. I also set up some automation rules to notify me if the power usage spikes beyond a certain threshold, which has been really helpful for identifying energy-hungry appliances.

One thing I struggled with initially was ensuring that the MQTT client ID and password were correctly configured on the Shelly device. I recommend double-checking these settings if you’re not seeing data in your broker. Also, make sure your firewall isn’t blocking MQTT traffic!

If anyone else is working on a similar setup, feel free to reach out—I’d be happy to help troubleshoot or share more details about my configuration. Happy automating! :blush:

1 Like