Modern template sensor definition style: how to initially set entity_id and friendly_name (and what about availability variables)?

If that’s your intentions, this is not the thread to post in. Make a separate post in Community Guides highlighting your findings.

I was going to post a general announcement in the near future once it’s done, it’s still a work in progress at the moment so too early to post the code.

I know I am a little late to the game. Yet, you’re wrong, see Add object_id to template entities (sensor, binary_sensor, button...) by chammp · Pull Request #122067 · home-assistant/core · GitHub

Don’t know how to feel about it. In my eyes it’s a deficiency of the core model and strategy, and I think the team is wrong, but I might be alone here, so that’s that.

5 Likes

Does object_id set final entity name if mqtt entity is a part of a device? I’ve asked about that over here, but got no answer. Now incidentally I found this your answer.

Yep, however it’ll _1 the entity_id if the same id already exists.