@pierre-gilles, after several attempts I went with the exact same approach you used for the MQTT integration. So it’s valid for all integrations that have access to modifying features.
Indeed, I looked into automating it the way zigbee2mqtt does, but in the end it didn’t seem appropriate because Tasmota devices create 3 energy metrics when a device is created:
They are not distinguished by type and therefore the last two are not worth exposing as consumption / cost.
So I decided that we should always create them manually. Is it worth creating a helper when adding a new device that contains at least one Energy feature to prompt creating it manually?