-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
feat: Generate definition for unknown devices #6692
feat: Generate definition for unknown devices #6692
Conversation
Many thanks for this PR. The biggest question for me now is more conceptual, for most automatically generated definitions (but not the ones for your use case since those are DIY) we want users to contribute them back such they e.g. show up on the supported devices page. There should be an easy way to contribute confirmed working generated definitions back. So I guess this is something that should be done from the frontend. Maybe we can show a generated external converter in the frontend? Based on this users can then easily create a PR or issue. CC: @kirovilya @nurikk @sjorge |
I think this should be a manual action tied in with the frontend. A simple way can just be to opt-in the device for auto generation, or a more complex, something like the rough flow below:
We can then simply ask the user to submit the generated external converter, we could name it something like |
I understand this idea and it is fair. But also my "vision"/understanding for this feature was to be kinda similar to ZHA from user perspective: even if device is not known - do your best to support it. So list of supported devices by this definition may not be necessary. General device information(i.e. description and picture) is more useful indeed.
I think for most this would be good approach in the beginning. In the UI, on the device page with generated definition it can mention that device support is generated based on device information(as it does in the device description in this PR), so that if device is not supported 100% - users may do some action to improve the situation. For example, as you mentioned, to click a button in UI to create a new issue on Github with some text based on device make/model/endpoints & user description. |
I support the idea of supporting such general-devices (I even started working on it). These can be either DIY devices or numerous light bulbs, switches, and sensors. Those, this should work for devices that comply with the classic ZCL and HA profile. This works in ZHA and in many hubs. Now about the process of identifying general-devices. Yes, we talked earlier about the need to generate definition for such devices so that the user can make a PR to the converters repo. |
The thing I have against generating the definitions without having any incentive to contribute it back, is that we are basically killing the supported device page. The supported device page is unique, (projects like Deconz and ZHA don't have this) and is highly valued by users as you know upfront whether a device is supported and what features it will support. We should therefore make it extremely easy to contribute it back (with a click on the button from the frontend) |
I see. In no way I wanted to say that it is not useful, or diminish it's value. I am sorry for misunderstanding. But now I also better understand the benefit of it. In this case what I would think of is contributing back device information: user-facing(manufacturer, name, icon, description maybe) and for documentation generation(endpoints, clusters & available attributes). Having this information together with device doc generator would allow to generate documentation for supported features of the device. Again: I appreciate your(and this community's as well) work on this project, and don't want to "force" any opinions 🙂 |
@ffenix113 I think basically what we can do is in the frontend link to an issue template where the user can fill in the generated definition, a description, a proper model names (because the zigbee ones are usually bad) and a link to the picture I will probably have some time to work further on this during the Christmas holidays. |
On the other note: I wanted also to add to this PR ability to make extenders configurable to support optional features, but for that cluster attributes are required. Unfortunately they seem not to be present after device interview and I don't know if/where they could be fetched by using |
They should be fetched during the device interview somewhere around here. It would be great if you could already start on that! |
@ffenix113 I think we should already merge this PR without the changes in Update: if I understand correctly, the functionality is disabled by default? ( |
Might need a rebase now that temperature and humidity modernExtends that handle reporting got merged |
Many thanks, this is a huge step for z2m 😄 |
Continuation of Koenkk/zigbee2mqtt#20173.
Support generating device definition for unknown devices. Only will be used when specifically allowed.