Automatic device discovery in MQTT?

That’s exactly how the Zigbee2mqtt integration works, devices are automatically discovered ^^

I still don’t understand!

When I connect a device to the broker (I don’t go through z2mqtt) I have to create a device in Gladys in which I enter the MQTT topic.

But couldn’t Gladys detect devices that connect to the broker directly?

When I connected my vacuum to my broker, it automatically appeared in my devices on HA.

The MQTT protocol is a pub/sub protocol that allows clients to communicate with each other (just as the HTTP protocol allows a client and a server to communicate with each other)

Like the HTTP protocol, the MQTT protocol does not define the content of messages; it only defines how to communicate.

So there’s no magical way to detect that a device connects to a broker and add it automatically; you necessarily have to code compatibility for each type of device.

On the HA (Home Assistant) side you probably have the impression it’s magical because they’ve coded a lot of integrations; if we want the same result we have to do the same work in Gladys :wink:

It’s something I want, but it requires a lot of resources :grin:

2 Likes

@McFlyPartages Don’t forget to vote for the request, we prioritize based on votes :wink:

1 Like

Yes it’s magic lol.

Is it not possible to make it generic? Or at least bump the topic when there’s a new post?

Otherwise, how do you code compatibility? Is it complicated for a non-developer?

1 Like

No, there is no standard for the message format, it’s a jungle :slight_smile:

Each compatibility must be coded individually

You need to submit a PR (pull request) to Gladys!

There is full documentation on the site:

Also, I’ve made quite a bit of YouTube content.

However, for a non-developer it’s impossible to contribute — no magic, it’s still code, and on Gladys the development bar is quite high (in terms of code quality, automated tests, linting, etc…), which allows us to have a very stable and « pro » product :grinning_face_with_smiling_eyes:

1 Like

Yes, I’ve started watching the live coding streams

1 Like