Reflection on the MQTT API

Sorry for the multiple responses, I’m thinking about it and noting down the ideas that come to mind here :smiley:

In your proposal gladys/master/device/custom:12/feature/custom:12:temperature:1 for example, there is no mention in the topic of what we are creating/updating.

If I publish 19.8 in the subject, what is 19.8? It’s a new state! However, from the name of the topic, we don’t know which attribute is concerned by this update. (Ok, we know because it’s us who code the topic, but nothing is stated in the name of the topic)

If we follow the logic taken here, we would need to add a last suffix to the topic type « state Â», or « last_value Â» if we take the exact attribute in DB to have something like:

gladys/master/device/custom:12/feature/custom:12:temperature:1/last_value

What do you think?

I’m thinking that in the future, on other types of topics, we might want to have a topic that takes the entire JSON object and updates the entire object in the DB (for example in the case where the remote device has been updated, and now manages more features, it can update its « device Â» with a new device)