Closed EP-u-NW closed 5 years ago
You could say that a device first have to go a a $state!=ready, republish topics and then back to $state=ready. But an mqtt broker is not required to keep the message order or provide any guarantees about the timing. A topic publishing might take a 1 minute.
That's why I said that it is sufficient to just change the $nodes and $properties and a controller is required to watch those attributes for changes.
So I conclude that its allowed.
OT: openHAB seems to be the only "complete" controller out there (and you impelemted the binding for it), and it's the one I plan using. How would openHAB react if a Homie device changes it's nodes and properties without changing its state?
The OH mqtt binding subscribes to $nodes and all $properties topics and adapts the tree like in-memory representation of nodes and properties and informs OH about new channels and removed channels.
The mqtt binding cannot handle the situation if only attributes like $name or $unit are changed.
What if I then add a "void"-property to a node, also list it in the $properties topic and then remove it. Will other changed attributes of the node also be updated?
A node does not have many attributes anyway, mainly $name and $type. And $name is afaik a subscribed topic with changes propagated back to openHAB channel names. If that is not the case I'd consider that a bug.
Is a device allowed to add nodes and properties after going the the ready state? I have not found a passage in the convention that clearly forbbids this. But I'm still not sure, because of this passage:
I'm not sure if a node or a property counts to the announcements category. If so, the above could imply, that it is forbidden to add new nodes and properties after the device reached the ready state. Also, what would that mean for changing an attribute of a node or property?
Contradicting the above interpreation is @davidgraeff comment in #162. While there it's stated that properties might be unpublished at any time, it also says, that no Homie controller yet supports this.
I'm asking all this, since my dart implementation of Homie currently does not allow to add nodes and properties after creation of a device. Also, attributes can not be changed. Maybe this needs to be reworked.