How can I output HA’s existing device-specific formatted value of a binary sensor state in a template?
For example, output the state of a Door or Window sensor as Open or Closed, rather than on or off.
I have set the device_class attribute on the entities, and so they show correctly in the UI.
Yes, I understand that the state of the sensor is on or off.
I’m not asking how to use Jinga if/then macros to completely recreate the logic that HA has already implemented for display, everywhere.
Rather, I’m asking how I can use the UI formatted values that already exist in HA, without having to rebuild them for every sensor and template message.
There must be some way to use all of that existing HA configuration/localization code in some function call, right?