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?