homieiot / convention

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

Proposal: ignore any bytes after the number. #193

Closed kollokollo closed 4 years ago

kollokollo commented 4 years ago

May I propose, that the contents of a (numeric) topic may have stuff following the number, separated by a space (blank, comma, tab), which will be ignored by the homie compatible devices.

Example:

/path/property --> "12.4 V"

In this example, the Unit would be ignored, however the number can be interpretted correctly.

I do not see any downside, this would relax the specifications and make more devices compatible automatically. (BTW: This is how MQTT-Hyperdash (https://github.com/kollokollo/MQTT-Hyperdash) interprets numbers).

mjcumming commented 4 years ago

While there is little downside, I think this muddies the convention with edge cases and would cause problems with existing implementations. Any other comments?

Thalhammer commented 4 years ago

I dont see how this would cause problems with existing implementations. It adds support for devices which would not have been supported before, but any device supported before the change should still be fine.

That said: Homie is a pretty huge convention with lots of required topics, so I dont think it would actually make any more devices compatible since they would also need to publish all the other topics (which they dont).

piegamesde commented 4 years ago

This will cause problems with every implementation that has a reasonably strict number parser. Especially since the current specification is pretty clear about it:

No other characters including spaces (” “) are permitted

Thalhammer commented 4 years ago

@piegamesde It wont for existing devices. Those devices which include other chars would not have been supported in the current spec. The only case it would cause in compatibility is if a "new" device tries to talk to an old controller, so maybe we could include it in the next mayor version to be sure.

That said I vote against the change as it muddies the convention and I dont see a real benefit.

mjcumming commented 4 years ago

I'll close it. If the OP wanted, they could send this as a string value and process as required on the consumer(controller)