Hello
I am trying to get some config running with a template.
I don’t fully get the generation of the unique IDs for the stuff:
wlanthermo_channel_1_all is named “template_wlanthermo_channel_1_all”
wlanthermo_channel_1_color is named correctly “wlanthermo_channel_1_color”. If I suffic that with a “2” that also gets added as I’d expect
wlanthermo_channel_1_max is named “1_none_maximum” which feels like during Entry ID generation the name-template is not yet resolved or s.th (so the name gets replaced by none) and it is just creating a slug from the name instead of utilizing the unique_id as with the two above entries
Unique_id’s are not really meant to be human readable or usable. They exist as a back-up name HA uses if you want to change the device_id or bring up functions in the UI.
The highly suggested best practice is to create them so that you can do things like change the display decimal and unit of measure right from the UI, but use random characters so you don’t forget and try to refer to them in your code. They are only available to you in places that you can add them. They never really show up or are available anywhere else.
I use UUID’s for them because if you use the Code Server add-on and/or VSC as your editor, there is a button to generate a random one automagically in the F1 menu.
Hello
yes understood so far. Nevertheless I dont get why they are not generated as exepected.
In one case it is generated as given in the other it is not given as expected causing issues later on
In my specific config the entities are not configurable in the UI so I have to create them in yaml anyways
I think they are generated as expected? The entity id is never based on the unique id, it is based on the name. The entity id I would assume is only generated once, when the template is first loaded. At that time the state machine is not yet fully populated. If there had been an entity id field, and it had supported templates at all, you can bet it would only support limited templates.