Koenkk / zigbee2mqtt

Zigbee šŸ to MQTT bridge šŸŒ‰, get rid of your proprietary Zigbee bridges šŸ”Ø
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.49k stars 1.62k forks source link

[Feature request]: Allow Definition And User Selection Of Model Variants #20820

Open danieledwardgeorgehitchcock opened 5 months ago

danieledwardgeorgehitchcock commented 5 months ago

Is your feature request related to a problem? Please describe

This was originally discussed in Koenkk/zigbee-herdsman-converters#4996.

I originally wrote the device converter for the Philips Hue Beyond fixture (zigbeeModel: LLM001).

This was intended for the Pendant / Suspension version of the device (model: 7121131PU): Pendant / Suspension

However, the Ceiling version of the same range (model: 7120131PH) has the exact same fingerprint as the Pendant and for all intents and purposes functions the same: Ceiling

Furthermore, I have a suspicion that the Table Lamp version of the same range (model: 7120231PU) may also share the same fingerprint too: Table Lamp

At present, Z2M only allows for a concatenated string of device models in the model field

Describe the solution you'd like

Add a new array / object field variant that can be used in the device definition. This could function in a similar way to the whiteLabel property of the device, but is user definable. Something along the lines of (but could contain more (optional) entries):

variant: [
    7121131PU: {
        description: "Hue Beyond Pendant",
        image: "https://www.assets.signify.com/is/image/PhilipsLighting/cbdcacae27d74a7991a4a9b9009dc223?&wid=360&hei=360&$jpglarge$"
    },
    7120131PH: {
        description: "Hue Beyond Ceiling",
        image: "https://www.assets.signify.com/is/image/PhilipsLighting/a4ebe3c75fe24a8c81d4a9b9009db07f?&wid=360&hei=360&$jpglarge$"
    },
    7120231PU: {
        description: "Hue Beyond Table",
        image: "https://www.assets.signify.com/is/image/PhilipsLighting/ce5674baf4c64b8f9beaa9b9009db96c?&wid=360&hei=360&$jpglarge$"
    },
]

By default, Z2M will pick the first index entry of the device however, this could then be set in the frontend or via an MQTT set command.

This could be extremely useful for TuYa devices which share similar fingerprints yet are vastly aesthetically different in form.

Describe alternatives you've considered

Just using the model field as it currently exists

Additional context

N/A

danieledwardgeorgehitchcock commented 5 months ago

Another example of the same fingerprint, but different variants:

Iolloi Smart Dimmer Switch:

Iolloi Smart Cord Dimmer:

Iolloi Smart Inline Dimmer: