homieiot / convention

🏡 The Homie Convention: a lightweight MQTT convention for the IoT
https://homieiot.github.io/
Other
705 stars 59 forks source link

Added information about unpublishing/removing a device #278

Closed schaze closed 8 months ago

schaze commented 10 months ago

The specification did not yet contain any information about how a device is to be removed/unpublished from the broker and also how a controller can detect this. This PR adds this information by specifying a zero length payload has to be sent to the $state topic first before any other topics are cleared.

schaze commented 10 months ago

Should we also add a note on controller behaviour? eg. since they should keep track of revisions of the description JSON by its id.

So should a controller upon detecting a deletion, remove and clear all cached data/knowledge it has on the deleted device?

I would not specify this in the convention. Any controller is free to handle this any way it likes. We also do not specify what the controller should do with the data of a device when it is discovered. IMHO a device that is not existing any more is of no use so the default would be to clear all data of it, except if there is a specific use case the controller likes to implement for it - whatever that may be.

Tieske commented 10 months ago

IMHO a device that is not existing any more is of no use so the default would be to clear all data of it, except if there is a specific use case the controller likes to implement for it - whatever that may be.

Agreed, but not specifying it leaves it too open imho, so can we specify this as a "should", as to say; this is expected behaviour, but in rare circumstances one can deviate.

Tieske commented 10 months ago

my addition ended up here: https://github.com/schaze/convention/pull/1