-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broadcast: change in the convention the name "level" with channel and define some common home #82
Comments
But what if you have 30+ devices, all listening to I'd go for the dumber way: just listening for |
Read level (level id) as a complete topic string, this way you can have coarse and very fine grained controll using just one topic string. |
The entire broadcast thing is actually flawed in my opinion. A controller is usually a bigger machine, and is capable of publishing a value to a wildcard topic |
Found a nice use-case in another issue: #81 (comment) |
Remember homies origin is embedded systems, and we have to keep these low level systems in mind as does the mqtt protocol. The broadcast was designed for IOT devices to directly talk to each other or share data that one device might use later for calibrating sensors or something. It could do with some fix ups thought, and this ticket makes a valid example of that |
Indeed, the point of the broadcast channel was to allow devices to react to very specific events that every device might subscribe to, typically, an intrusion. The @fermuch comment linked above represents a great example. It should be clarified in the convention, though. |
I use it for two purposes:
|
other uses
|
Mqtt topic wildcards can be used for all mentioned use cases. In my opinion broadcasts are still... Useless :D the one big reason is: they are untyped. On a controller stand point I would not know what do to with broadcasts. Should I display them to the user, like notifications? But then the source is missing. I really have no idea what to do with them. |
Only if you already know in advance what you need to change. If you don't know, but need to send an alert system-wide, broadcasts are still useful. Let's build an ideal system with homie: home control with intruder and fire alerts. The structure is something like:
Now, let's imagine a common use case:
But now, let's see how it should work when no one is @ home:
The smoke detector system is pretty similar. It detects a small amount of smoke (maybe a cigarrete?) and after a while of constant smoke, switches to "fire" mode. On this mode, the door unlocks, all lights are turned on, etcetera. Without broadcasts, building such a system (at least for me!) would be very difficult. Each device in the network would need to keep a full image of what other devices are, what nodes they have, and the state of the properties of each node, so they can select when to switch modes. This, for an embedded system, is no easy task. How I see you're thinking of it (I'm sure I'm wrong! Please correct me!):
This is not ideal, since you need to keep track of the whole network in your camera/smoke sensor, which involves computing, storing the network in ram, and a lot of code to keep track of everything added / disconnected. Even if you go the other way around, and the door subscribes to the cameras to switch mode if they detect an intruder, it is still not ideal. Why? Because now the door needs to build the whole network to filter for the appropiate nodes, and subscribe to each; also, now the door system needs to keep track of every device connection status (did the device set their status to And what would happen if tomorrow you add a device that should still enable / disable the locking of the home security system? I see |
@davidgraeff I'd recommend you implement them as notification Chanel's like you said, but allow the user to configure which ones they want to show in ESH as alerts or something. Or just don't implement them. If sender information is a concern then we could recommend a message structure that includes this but is not required. Please keep in mind that were not modelling homie around ESH. |
@timpur Of course there is a use for them in ESH, too. However, broadcasts cannot be configured with auto-discovery. But thats exactly the reason why there a needed. If you have two devices with an "alert" node (e.g. that flashes and turns on a buzzer) and they would announce them as "alert" system, the auto-discovery of the home-automation system still would not know that these two alerts are the same channel. In the long term we could think about defining some standard information channels from the central controller to the devices, so devices can announce that they will subscribe to the related topic. However, to keep things simple, for now I don't see the need for such a feature to be on the roadmap . |
As long as MQTT does not support wildcard publish, broadcasts are probably necessary. I see the point. |
People have seem to agreed that broadcast levels are not a requirement for now. They should also be specified in a separate document. (Because removing/updating/renaming a broadcast level later on is a major version update, and we want as few as possible for this mqtt discovery convention). |
Implements the idea of having different channel of broadcast communication
instead of this
having this
Some predefined channels are defined by the standard
The text was updated successfully, but these errors were encountered: