Salut @pierre-gilles @Terdious, cool, feedback ![]()
Iâll try to share my thoughts on the points raised.
Yep. We agree that this is all the interest of MQTT, to be able to do push as well. We therefore need to define the ad-hoc topics.
Yes, yes, of course! I imagine that this thread is there to validate/improve it.
My bad. Of course, the idea would be that Glady listens to everything that concerns it
gladys/master/device/# or even just gladys/master/# but I donât see a use case (maybe for the pods later)
Indeed, this seems mandatory for that. However, I think we should allow, as is the case today, to create devices and add features via the Gladys UI (this topic should not be the only way to add an MQTT device, but it must be a solution)
Yes, and this is intentional. Will the device pass anything other than an update of the state of the feature concerned through this topic? That said, itâs not blocking to add the state mention, so why not.
Iâm not a big fan of the topic nomenclature but I share PGâs opinion:
Based on these first exchanges, and from what Iâve read about the different types of protocol applications from different manufacturers, we probably wonât be able to define an API compatible with all manufacturers or open-source firmware providers (Tasmota, ESPEasy).
A solution we could explore would be forwarding, i.e. the possibility for the Gladys MQTT client to forward messages to topics it also listens to. Let me explain:
We define a single and unique Gladys MQTT API based on our first reflections (which we refine and validate). For example, to update a feature:
payload: stateValue
// Or even
topic: gladys/master/device/external_id
payload: { features: [
{
"external_id": feature_external_id,
"state": stateValue
}
]
This allows us to have a clear and precise API, without ambiguity, and which does not require rocket science to implement.
For cases where we donât have control, like the MQTT service of unflashed Shelly devices. here the doc The integration takes the form of forwarding « proprietary » topics. For example:
payload: "off"
// Forwarded to
gladys/master/device/shelly:deviceid/feature/deviceid:onOff:1
payload: 0
Thus, we do not multiply the « public » routes of the API, and yet, we are able to manage « non-compliant » devices. Not to mention that the integration is nothing more than the addition of a forward. We can even imagine that the MQTT module, faced with a message on a proprietary topic, is able to create the associated device if it does not exist in the DB before forwarding it.