Formatting an if statement in a template

I have a sensor…

sensor:
  - platform: mqtt
    name: "Owl Intuition Heating State"
    state_topic: "tele/owl/heating"
    value_template: "{{value_json['Heating'].State}}"
    force_update: true

That values come as a single numeric digit [0,1,2,5,6,7].
I’m trying to decode that (ie 4 decodes as “Comfort - Up to Temperature”) and am doing it by creating a platform template called central_heating_status where the value comes from a series of if statements …

sensor:
  - platform: template
    sensors:
      central_heating_status:
        friendly_name: Central Heating Status
        value_template: >-
          {% if ('sensor.owl_intuition_heating_state' == 0) %}
            Standby
          {% elif ('sensor.owl_intuition_heating_state' == 1) %}
            Comfort - Running
          {% else %}
            Not Defined
          {% endif %}

I’ve tried many different syntaxes that have been hinted at in the docs and forum but none seem to work as I always get an error or “Not Defined”.
Am I going about this decoding thing in the right way to begin with and if so can someone put me out of my misery re the correct syntax?

Try to add ‘states’ to your sensor line, like this

{% if (states('sensor.owl_intuition_heating_state') == 0) %}

or this

{% if (states('sensor.owl_intuition_heating_state')| int == 0) %}

rewrite the elif line to the same format

Thanks. That did the trick. I’m sure I tried something very similar. The code block looks like this now…

        value_template: >-
          {% if (states('sensor.owl_intuition_heating_state')| int == 0) %} Standby
          {% elif (states('sensor.owl_intuition_heating_state')| int == 1) %} Comfort - Running
          {% elif (states('sensor.owl_intuition_heating_state')| int == 4) %} Comfort - Up to Temperature
          {% elif (states('sensor.owl_intuition_heating_state')| int == 5) %} Comfort - Warm Up
          {% elif (states('sensor.owl_intuition_heating_state')| int == 6) %} Comfort - Cool Down
          {% elif (states('sensor.owl_intuition_heating_state')| int == 7) %} Standby - Running - Below Standby Temperature
          {% else %} Not Defined
          {% endif %}