Personally I changed all my MQTT yaml definitions by automations running at home assistant start when they changed the syntax for MQTT in yaml. Since I had to rewrite it anyway. The good way is to set the payload as a variable where you can use yaml syntax that looks a lot like classical yaml definitions, then do a loop like that:
You can see that in the for_each I put settings in a config entry that look like the YAML for MQTT configuration (in fact I copy-pasted most of it). I decided to move unique_id out of the config because it is used in the discovery topic but I could as well have fetched it from the config and not needing to merge it afterwards.
The good part is that you can have common configuration without repeating it, and you also can use other kind of loops to create entities programmatically, as in the following (which is part of a recurring todolist implementation).
Also note I saw here or on GitHub discussions about devices made from the UI to group entities. AFAIU nobody is against it, it is just a matter of when/how to do that. I tend to think this is a bigger scale project with multiple ramifications so don’t hope too much I guess.
What is the implementation when working with other entities not related to MQTT? For example SNMP and templates?
I have a PDU that has switched outlets and power monitoring. I use SNMP switches to change the state and an SNMP sensor to monitor usage. All of the entities are separate in HA even through they are the same device.
Additionally if you create any template sensors it would be nice to tie them into the new or existing devices.
I have a SwitchBot Tilt on my blinds. To get the % open/closed correct you need to create a template cover. However, that template sensor is not part of the device in HA, making harder to manage that device and all related entities.