Help me use a ShellyPlus1PM with the MQTT integration in Gladys

Good evening,
I can’t control my Shelly Plus 1 PM (shellyPlus1PM) module with MQTTX (mqttx).
From the Shelly documentation:


I can’t use their instructions to find the right topic and the correct body.
It must be basic for some pros in the community, but in this area I’m a dunce.

Hi @l.dolle :slight_smile:

I suppose you want to control this switch from Gladys.

First you need to go to the « MQTT » integration and create this switch:

Give it whatever name you want, and add an « outlet - switch » feature:

This should give you this:

(Make sure to reproduce exactly what I did, uncheck « is this a sensor » in particular)

Scenes

You’ll need to create 2 scenes, one for turning on, and one for turning off:

Turn on

Create a trigger:

And an action:

Be sure to replace the « topic_prefix » and « id », I imagine you know them :slight_smile:

Turn off

Do the same, but with the off:


Conclusion

I understand that it can be a bit long to integrate Shelly devices like this into Gladys.

A more viable solution will come from Matter integration, I hope, this year :slight_smile:

Don’t hesitate if you have any questions.

PS: I don’t have a Shelly, this whole tutorial comes from my interpretation of Shelly’s documentation, I may be wrong.

Hello @pierre-gilles,
Thanks for the info. It works very well. I had already created the scenes but I hadn’t linked the scenes to my switch. Also, I kept insisting on trying to test from MQTTX when going through Gladys was much simpler.
I also made a simpler version (for testing) with the « toggle » command. The problem is that in case of a malfunction, the switch may end up reversed (turning off when it should turn on and turning on when it should turn off).
What do you think?
Thanks again for this info.

Indeed!

Also, I think Shelly handles state feedback; if you want to be properly synchronized (in case of control outside Gladys), you can set up the state feedback by listening on the correct MQTT topic. That can be done via a scene.

But it might be overkill if you only control via Gladys

1 Like

For info @l.dolle, we now fully support Shelly modules via the Matter integration :slight_smile:

Tutorial in the documentation :

Hello @pierre-gilles,

Thanks for thinking of me about the Shelly issue. I’ve already connected my test Shelly to Matterbridge, but I’m having a problem: Gladys has no IPv6 address to connect it to Matterbridge.

Can you tell us more about your setup so we can help you? :slight_smile:

The Gladys server was installed using the official docker-compose on a Proxmox VM behind a Freedombox gateway server on a VM as well.
I refer you to my post with @mutmut
https://community.gladysassistant.com/t/matter-erreur-si-ajout-appareil-sans-ipv6/

1 Like

Ah yes I remember your post.

In my opinion, given the complexity of your setup (multiple VMs), there must be a network problem in all that :slight_smile:

Matterbridge and Gladys really need to be able to communicate directly!

Ok, don’t hesitate if you need help once you’ve rebuilt everything :slight_smile:

Indeed, during a test, even with a Linux VM on my Windows PC, the Shelly devices are detected but matterbridge and Gladys do not communicate.
Afterwards I didn’t make many attempts, since I have what I need elsewhere.