ZHA quirks v2 - How to define entity names

Hello,

I’m working on a quirk for NodOn SIN-4-FP-21 pilot wire module (from discussion here.
This modulet is a kind of smart plug that can control a connected heating device through a dedicated wire (known as pilot wire).
The pilot_wire can set several levels : OFF, ECO, COMFORT, FROST_PROTECTION, COMFORT - 1°C, COMFORT - 2 °C.

As of today, I have a working solution (see link above), but the entity that is created for the “pilot_wire_mode” attribute is reported as “select.radiateur_sam_none”. I would like to have it reported as “select.radiateur_sam_pilotwiremode” or similar.

However, I haven’t found where I could define this suffix ? Any idea where I should start ?
Is it in the QuirkBuilder().enum() instruction ?
Is it in my CustomCluster class definition ?

Thanks for your help

I don’t believe this is possible currently. You can define the translation_key and if there is a translation for that key, you will get that as the entity name. We need to be able to set the fallback_name for this to work correctly. The logic is present in HA core/homeassistant/components/zha/entity.py at f1e4229b23ef7837bb4e46877f55d6533f8d4607 · home-assistant/core · GitHub, but not in Zigpy, once Expose fallback_name in v2 quirks by puddly · Pull Request #1474 · zigpy/zigpy (github.com) is merged, you should be good.