-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[RFC] Revising MQTT bridge structure #3281
Comments
Can we also get a configuration.yaml option to disable the old behavior? |
IMHO To be of any use the "everything" to zigbee2mqtt/bridge should include for the devices the type of the device (this is also missing in the current config/devices/get). If type like lamp/color_temp/color/motionsensor/sensor/switch would be available, it can be used to auto create devices in application. Now this info is only available via homeassistant_discovery_topic but there are plenty applications around not really HA compatible. |
That would be nice, then maybe HA extension can maybe move to a seperate reposed ourside of the core.
But there would probably need to be a better way to show what a device supports, sort of like feature flags.
Type: bulb, features: on/off, colorxy, brightness,... not sure how feasible that is though.
~ sjorge
… On 5 Apr 2020, at 13:38, gdave321 ***@***.***> wrote:
IMHO To be of any use the "everything" to zigbee2mqtt/bridge should include for the devices the type of the device (this is also missing in the current config/devices/get). If type like lamp/color_temp/color/motionsensor/sensor/switch would be available, it can be used to auto create devices in application. Now this info is only available via homeassistant_discovery_topic but there are plenty applications around not really HA compatible.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Just my 2ct: if you publish 'everything' for zigbee2mqtt/bridge, the message could be huuuge. I've seen people on the issue list with 200 devices. Wouldn't it make sense to have a zigbee2mqtt/bridge/devices topic for that? |
On my earlier point, it doesn’t make sense for extensions to expose this over mqtt, the should be able to get this info some otherwise so disregard that remark. |
What i've been missing for a while is a Health Check topic, and that would fit really well in the Request/Response structure. |
Yes but i still use MQTT explorer sometimes to check things, Imho there should be a good balance in message size and number of topics. They didn't invent the hierarchy for nothing. For software it's not a big deal to do two requests to get information about the bridge and the devices. |
@nldroid indeed a valid point, so I think we should have |
Sorry I was late to respond... I'm over busy those days... a full time job at home + a full time daddy is asking a lot. Love the request id... I was about to suggest it when I read it :-). Love the idea of this refactoring. But my concern is about the migration from the old to the new topics. Z2MA is not the only tool right now... Do you think we should have a hybrid mode for the migration time? And... what is the timeline for that? I want to be ready on time for the release. Maybe @magpern can help too :-) (he's very helpful!). |
From the commits I'm seeing on |
@sjorge it will by @carldebilly there won't be a breaking change so the old API will still work. Timeline: not really soon, first want to have a proper discussion + prepare zigbee2mqtt internally for this. |
You make me blush! Yes, count me in. I have tonnes of day job disturbing my spare time right now, but it will calm down in 30 days or so. |
For me, the most important thing is the version. Best would be with latest commit number so you'll never have any doubt on what version people are. |
I would also suggest to split "everything" of Another thing: what about sending all logging output to some (separate) MQTT topic? IIRC, this is another desired feature of Z2MA. (I was thinking to develop a Qt based desktop application as a UI for Z2M.) |
@CodeFinder2 good idea will include this. |
perhaps rename |
@sjorge not sure, it's not only about the coordinator but just the whole stuff itself. Currently we didn't get into problems regarding conflicts with the old api. |
@Koenkk great, thanks! Maybe also split the various "attributes" into a dedicated JSON message (and not only provide a single string as printed in the log), like (at least) {
"type": "info",
"time": "2020-04-22 22:48:10",
"message": "... message as printed in Z2M's log ..."
} as this allows for a more fine-grained visualization (of the log). I don't know (yet) if it makes sense to even split (the content of) (In a UI frontend, I am also thinking about live-filtering the log based on some input pattern, e.g., to show only log entries for a specific device. For instance, this might be helpful in case of a pairing process where we are only interessted in observing pairing-device related messages. Also, showing all errors in the recent past would then be very easy.) |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days |
@kirovilya @nurikk I've added permit joining via a specific device. See https://github.com/Koenkk/zigbee2mqtt.io/blob/new_api/docs/information/mqtt_topics_and_message_structure.md#general |
New api is now enabled by default in the dev branch. |
I like the idea of using the power of the MQTT structure. To me that means smaller Jsons - and fewer of them! So instead of receiving a Json like {"temperature":20,"humidity":50}, you could subscribe to I would not recommend to include the type of device in its MQTT-topic. The type is an attribute, not an identifier. So I recommend: That way you can subscribe to exactly the information you want, instead of receiving a Json that may vary from one device to another. Still, I think there are still very good usecases for posting a massive Json with the entire device-list. |
Something less advanced that hat is already available https://www.zigbee2mqtt.io/information/configuration.html
|
Hello and thank you for a great job. Is it possible to add Sonoff mini 01MINIZB module support to the plug? |
@Koenkk This will be speed up the cleanup unfriendly names topic proccess, or you justl leave it in its own topic, but then the advantage is that it is isolated in it's own topic and not floating around in the root... ;-) |
@timoline were does this visualisation come from? (shouldn't it be fixed there?) |
no its just a visualisation of the realtime mqtt structure New paired device publish itself in the topic (e.g.) my request is to publih itself in: (or just some other defined topic) so it's easier to cleanup (after adding a friendly name/ or isolated in its own topic extra: |
this is fixed by 9b7ecff |
Problem
The current
zigbee2mqtt/bridge/#
topics are a mess. They are not well structured and don't provide a good reply/response mechanism. This makes it hard for other applications to integrate with Zigbee2mqtt. Therefore I propose the revise the structure while keeping the current working (so no breaking change).Proposal
I didn't work out the full new structure yet, but this is the general idea I have.@ anyone, feel free to review this, but I especially would like to request @carldebilly to review this (since I think it can be for great use of Zigbee2mqttAssistant).
The initial implementation has been completed and can be tested in the latest dev branch, to enable the new api set the following in
configuration.yaml
.In case you want to disable the legacy api add the following (not mandatory, legacy and new api can exist simultaneously)
The documentation can be found here.
Note that the api can still change as it's not officially released yet. The plan is to finalise it on 1 September 2020, any feedback resulting in a breaking change should be submitted before this date.
TODO
ID
->id
in payloads (requested by @sjorge [RFC] Revising MQTT bridge structure #3281 (comment)) (breaking)update
information (e.g.{"update": {"progress": 20, "state": "available/updating/idle"}
) to device state topics. (requested by @SeLLeRoNe FR - Have "update_available" set to "progress" #3634 (comment))The text was updated successfully, but these errors were encountered: