Yesterday, I finally got an electrician to install a Shelly Pro 3EM smart meter for me. So it was time to set it up right.
Until now, I used the cloud connection of my Zendure SolarFlow 800 Pro (via the Zendure-HA integration) in my Home Assistant to manage the solar outcome and used multiple smart plugs and the Powercalc integration to calculate the power consumption (which was roughly 70 % of my overall consumption).
Also, the default setup of Shelly is to use its cloud to receive the data. Having it local via MQTT was a no-brainer.
I already tried setting up the SolarFlow 800 Pro with MQTT in the past but didn’t get it running. Probably because of an issue that does not update the values before you reload the integration.
Now, I started with the Shelly Pro 3EM and what I thought was an easy step was a bigger effort in the end. Long story short: I needed to enable using Python scripts in Home Assistant (add python_script: to the configuration.yaml and then restart Home Assistant – the latter is very important – reloading the configuration alone does not work). Afterwards, I used ha-shellies-discovery-gen2 to setup discovery in MQTT. Then, it worked.
For the SolarFlow 800 Pro, I switched to the zenSDK connection, which uses MQTT in the background, and reloaded the integration. However, it didn’t work. After enabling and checking the debug log I noticed the following error:
[custom_components.zendure_ha.api] Client local connected to MQTT broker, return code: Not authorized
Turns out: in earlier attempts setting up MQTT I added user credentials for my MQTT broker that were no more available (since I deleted them after the failed tests). So, after adding working credentials, everything works fine now.
I also verified it by disabling the internet connection of both devices in my router and they both keep updating every five seconds just fine. 🎉
P.S.: There are many sources that are 2 – 3 years old regarding integrating the Shelly, but the firmware seems to have changed a lot. So they won’t work anymore.
Leave a Reply