Help connecting Shelly EM to Gladys via MQTT

Hello,

I went through the documentation indicated here MQTT | Gladys Assistant
But I don’t understand which values I need to fill in, and where, to make the connection between my Shelly EM and my Gladys instance work.

I have a setup on a Freebox network, my Shelly EM is on the network via Wi-Fi.
I deployed a Gladys instance inside a VM on my Freebox Delta.

I configured MQTT with the following values

On my Shelly EM side I saved the URLs and the connection account to Gladys’ MQTT broker

  • :1883

But then I don’t know at all how to configure an MQTT device nor the topics necessary to retrieve the metrics from my Shelly EM

I still get messages like « no value received ».
I’ve tried several syntaxes to declare the device, but each time I get « no value received »

On the Gladys side, when I click on <> Debug MQTT I get an empty table.

Could you explain how to configure the connection between my Shelly EM and Gladys?
My goal is to retrieve the metrics (power, consumption, etc…)

According to this Shelly documentation ( https://shelly-api-docs.shelly.cloud/gen1/#shelly-em-overview ) there are quite a few metrics that I should be able to retrieve but I don’t know how to do it.

Hi @jmarandet, welcome to the forum!

Have you taken a look at this thread?

Otherwise, you can use matterbridge to connect your Shelly devices and it will probably be simpler since you seem to be familiar with VMs:

Hello @mutmut
Thanks for your message — yes, I have read and taken note of the two pages you shared with me, but they don’t seem to address my goal.

For the first link marked as resolved, I don’t see « how » he configured things; the expected specifications for each of the different parameters remain a bit unclear to me.

For the second link about MatterBridge, I tried it as well, but it doesn’t seem to provide a fine-grained, advanced integration of the device.
Here are various screenshots of my MatterBridge configuration, and it seems to have only picked up the « switch » function

How do you get the fine-grained measurement and consumption metrics to be reported?

Note that on the MatterBridge side the same device (deviceID) seems to be recognized as being capable of reporting various metrics

But when I enter the pairing code from MatterBridge to Gladys, Gladys doesn’t seem able to correctly detect the modules and it only lists devices of type « switch »

So for me there are missing features on the Gladys/Matter side, given that the Matter integration is recent.

@pierre-gilles can you confirm the missing features?

I think there are missing features in the Matter integration on the Gladys side. @jmarandet could you give us the JSON that you can download from the Matter integration settings page please?

Indeed, for now we only handle the switch part for these devices via Matter, but if you give us the JSON, we can integrate the rest into Gladys quite easily!! :smiley:

If you want to do the configuration via the MQTT integration in the meantime, you need to use the topics provided by Shelly at the link you provided (https://shelly-api-docs.shelly.cloud/gen1/#shelly-em-overview), and insert those topics into a Gladys MQTT device in the field:

For example, if you want to retrieve the Shelly’s total energy consumption, you can create a new feature in Gladys:

Which you fill like this with the topic shellies/shellyem-<deviceid>/emeter/<i>/total where the Shelly publishes:

Of course you have to replace in the topic the « deviceid » (you must find it in the Shelly interface), and the « i ».

That presupposes that you are indeed receiving messages in the « Debug MQTT » tab.
If that’s not the case, the Shelly’s MQTT configuration is not correct. You should check on the Shelly side if everything is okay (are there logs to see what’s causing the problem, perhaps?)

Hello,
I think you should be able to retrieve the requested JSON from this sharing link

:sad_but_relieved_face: that’s exactly what I’m trying to do with a lot of trial and error, but I keep seeing messages like « No value received » from Gladys
Et without understanding the logic behind constructing these topics / endpoints I spend ages going round in circles without success…

Thanks for the JSON file @jmarandet !

I do indeed see some Matter clusters not managed by Gladys:

"id": "156",
"name": "PowerTopology",
"id": "144",
"name": "ElectricalPowerMeasurement",
"id": "145",
"name": "ElectricalEnergyMeasurement",

I’ve created a feature request to keep track of your request:

Even before talking about Gladys, I think you need to make sure everything works on the Shelly side.

Have you tried on your computer software like MQTTX that let you view the messages published to an MQTT broker?

The first step to get unstuck is to see where your Shelly is publishing!