I had a look at the 32 instances of CONF_UNIQUE_ID across the components code. For many of them, it seems that they just from homeassistant.const import CONF_UNIQUE_ID (among others), and then declare it as optional in the extension of the platform schema. It looks like it is not used afterwards.
Is this the minimal implementation for unique_id?
I understand that it can be set to a specific value (a serial number for instance, like for the hue component), or reused afterwards - I am just wondering whether merely importing it and adding to the extension of the platform is enough to have HA recognize it (and make efficient use of it by unlocking the GUI edition, maintaining it in .storage etc.)
I don’t know, I’m not a dev I assume there might be more in order that the integration doesn’t assign an already used unique_id. To be honest I don’t care so much, I don’t need to be able a binary_sensor or similar in the UI when I can do it in YAML.
Yes, this is true but this dualism between the YAML and the UI is messy. I would prefer to keep the elements clearly separated: either here or there.
A nice milestone (before having a separation) would be to have a unique_id available in the YAML, and make the whole configuration in the UI. Today for instance I can add a input_boolean both in the YAML and in the UI. They both meet as “entities” but keeping track which is where is not optimal.