homieiot / convention

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

Clarification: Broadcast #195

Closed rezreal closed 4 years ago

rezreal commented 4 years ago

I do not quite understand the broadcast topicId (level from the example).
Is homie/$broadcast/foo/bar considered a valid broadcast topic? I see the terms:

Now I am a bit confused if a broadcast topic may have multiple levels :) At least the homie-esp8266 implementation does not support that, and I am wondering what the intention of the spec was.

davidgraeff commented 4 years ago

MQTT topic matching is mostly based on string matching on the client and server side. I do not see a point in restricting a broadcast topic to just one level, technically. So "homie/$broadcast/foo/bar" would be a fine topic. Any other opinions?

mjcumming commented 4 years ago

I agree. @Thalhammer ?

Thalhammer commented 4 years ago

I dont see any problem with supporting multilevel ids for broadcasts. However we should make sure all (or at least the reference) implementations correctly subscribe to homie/# instead of homie/+ before we change the comvention.

mjcumming commented 4 years ago

I don't use this feature and I don't recall any conversations on the OpenHAB forum discussing it. The spec defines this as a controller broadcast. Do we allow devices to use this mechanism as well? I see more utility for this feature if we are able to develop some predefined device types. Ie. if there was a light device and a broadcast could turn all lights on/off.

piegamesde commented 4 years ago

Ie. if there was a light device and a broadcast could turn all lights on/off.

Wouldn't this be the job of a home automation system?

mjcumming commented 4 years ago

Ie. if there was a light device and a broadcast could turn all lights on/off.

Wouldn't this be the job of a home automation system?

Yes, a controller could do this but in this instance rather than iterating over all homie light devices and sending separate set commands, a single broadcast would cover them.

mjcumming commented 4 years ago

clarified in https://github.com/homieiot/convention/commit/d68076d00e50b1b276e4eab52915961232050e8f

rezreal commented 4 years ago

awesome, thanks!