-
Notifications
You must be signed in to change notification settings - Fork 263
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
Match list of possible candidates off of the library #2663
Comments
Powercalc already does a match of manufacturer and model - it is just not in the model.json but the folder structure. This was a descision of the creator of powercalc and will likely not be changed and does not need to adress your problem. If your device model is not in the library, it might be as an alias. Since I have not had a device yet that was not a model but an alias, I am not sure how the config flow exactly handles it but I do know that @bramstroker descided to not show all the aliases of a model. His argument is that the list in some /many cases would be too long to reasonably manage. You need to lookup the aliases yourself. Not exactly knowing the config flow in this case, as stated, it might be necessary to emphasize this facte more clearly. To your second issue I think an extra step or more likely a checkbox could be added to ask the user if it wants to do advanced configuration and othervide skip that part. |
So instead of showing like 3–5 devices, we show all manufacturers and all devices, because that's easier to manage? ;) |
The livarno light is just added a few hours ago. Can you send screenshots of the device page upper left part in home assistant. These are the information powercalc uses for identification. |
The device info is in the PR. |
I have started working on this. #2681 |
Hey @bramstroker that's great, but I think that's the wrong way around: Say Powercalc has two lamps, like "lamp-a" and "lamp-b" as profiles, z2m would list them as "lamp-a/lamp-b" So following your approach Powercalc would need to add "lamp-a/lamp-b" as alias. But if the manufacturer puts out a "lamp-c" z2m would modify the string to "lamp-a/lamp-b/lamp-c" or similar and the alias would stop working. A better approach is to fetch the model name and vendor name and limit the search to the vendor. Then split the string into an array with "/" as split indicator and then search for each model name in the Powercalc database and show all matches to the user. This way "lamp-a/lamp-b", "lamp-c/lamp-b/lamp-a" etc. would all match without any alias to "lamp-a" profiles and "lamp-b" profiles. |
That can also be supported. Wouldn't be too hard. Mainly to support cases like this: Or these kind of lights: There are numerous more examples where integrations don't expose actual specific model id, but some more generic descriptor. Previously there was no way to support auto discovery for this lights as the model exposed in HA device info was way too generic. Basically currently Powercalc tries to find models by the following search phrases, and it search through the library on both the model_id and known aliases of a model if it matches any of these search phrases.
The last one is to support model ID between parenthesis. |
Agreed. In this case we need aliases of "TS0505B", because z2m uses the "white label" option here, instead of listing the models: https://github.com/Koenkk/zigbee-herdsman-converters/blob/963d9a9eaf06e64c0751f3adb4c623d9692729b1/src/devices/tuya.ts#L1684 The reason for this is, that the vendor is different. For those cases it might make more sense to add add support for identifies as "[vendor, model]" in the model files itself. So if there's a white label device of a Tuya TS0503B we just add |
For current version I'm working on that won't happen. profiles are first "filtered" by manufacturer / vendor, and than the models are searched. |
Alright, but this means we have to add Tuya to each We should at least make sure we add comments to the |
No this won't work as we cannot have duplicate aliases for manufacturers yet. So the case I mentioned about Tuya TS0505B won't be supported yet. But many other cases will be supported now, including the scenario you requested for the multiple models separated by slash.
JSON does not support comments so that's not an option. |
You can switch the files from .json to .yaml, as JSON is just a subset of yaml. Yaml supports comments. :) Shouldn't require much change in the parsing code, normally.
Ah! okay, makes sense. Thanks for the explanation! |
Yes I know YAML supports comments. But I don't like YAML.
So this will not happen :-) |
PR merged and initial version release with 1.16.0-beta.0 |
Checklist
Is your feature request related to a problem? Please describe.
I noticed that there are several profiles for lights I have in PowerCalc, which do not show up with the auto detection feature.
For example the Livarno Lux HG08131A and the Müller Licht 45311.
The issue here is, that there are more than one Model with this Zigbee identification. For Livarno Lux they seem to use the Zigbee Manufacturer string as model identification, and then still release like 2-3 Lamps with the same string.
Describe the solution you'd like
I was wondering if we could add Zigbee Manufacturer + Zigbee Model to each profile and then build a lookup table based on that (or the details shown in HA if not a Zigbee device). And then show the list of matches to the user, so they can decide if it's on the list or not.
I think that would be a bit easier than the current approach, where I need to add each light which doesn't have an exact match and add it manually, with a lot of options a user usually doesn't want to touch, like these:
So my suggestion would be to extend the current UI by having a choice option, if such a device is found, to select one of the already existing entries which match the manufacturer/device string.
Describe alternatives you've considered
None
Additional context
None
The text was updated successfully, but these errors were encountered: