Entity state formatting
· One min read
In the Home Assistant Core 2023.9 release, we introduced 3 new methods to the hass
object to allow entity state formatting with localization support for custom cards:
hass.formatEntityState
hass.formatEntityAttributeValue
hass.formatEntityAttributeName
Example:
hass.formatEntityState(hass.states["cover.living_room_shutter"]);
// It will return "Open" if the user language is English.
// It will return "Ouvert" if the user language is French.
For more details, refer to the entity state formatting documentation.