Is it possible to map states to a human friendly value for a sensor?

I have a sensor that displays the current state of what my ducted heat pump is currently doing. The numerical statue values returned from the device are 0 = Fan/Idle, 1 = Heating, 2= Cooling. When someone opens the sensor the history shows the numerical state so they have to remember what number means what. It looks like this currently:
image

Is it possible to customise the current sensor so that the history shows a name I assign to each value instead, without having to make a new template sensor?

Maybe. If its config is defined in YAML and it supports a value_template. If so, share the config for your existing sensor.

Otherwise a template sensor is required.

state: >
  {% set mapper =  {
    '0' : 'Fan/Idle',
    '1' : 'Heating',
    '2' : 'Cooling' } %}
  {% set x = states('sensor.foobar') %}
  {{ mapper[x] if x in mapper else 'Unknown' }}

Or you can display that info using custom:button-card and the label function.

show_state: false
show_label: true
label: >
  [[[
    if (entity.state == '0') return 'Fan/Idle'
    ...
  ]]]

It’s a modbus sensor, which doesn’t support a value_template from what I can see, unfortunately. Looks like I’ll have to make do with a template sensor