I'm looking for a proper way to rename an entity's friendly name programmatically within an automation in Home Assistant.
Here's the issue I'm encountering:
- Currently, friendly names appear as attributes of the entity’s state, rather than as properties you can directly manipulate via automation actions.
- Oddly, it's possible to manually update an entity's friendly name via Developer Tools → States, by editing the entity’s state and specifying the
friendly_nameattribute in the YAML field. However, I don't see an equivalent method exposed for automations.
Questions:
- Is there an officially supported or recommended method to rename entities (specifically their friendly names) from an automation script?
- If not, is my only solution to call the state API directly (replicating the Developer Tools behavior)?
- What's the rationale behind treating friendly names as part of an entity’s state/attributes? It feels unintuitive.