Hi
This makes me crazy - can anyone help me understand what i am doing wrong?
I have a heatpump giving me a operation status of 1 - 7, 98, 99 and 100.
I want those to be human readable.
So, whit a litlte help i wrote:
modbus:
- type: tcp
name: Thermia
host: nnn.nnn.nnn.133
port: 502
sensors:
- name: wp_Operation_state
scan_interval: 10
And
- sensor:
- name: wp_operationmode_tekst
unit_of_measurement: state
state: >-
{%- if is_state('sensor.wp_Operation_state', '0') %}
'None'
{%else%}
{%- if is_state('sensor.wp_Operation_state', '1') %}
'Manual operation'
{%- elif is_state('sensor.wp_Operation_state', '2') %}
'Defrost'
{%- elif is_state('sensor.wp_Operation_state', '3') %}
'Hot water'
{%- elif is_state('sensor.wp_Operation_state', '4') %}
'Heat'
{%- elif is_state('sensor.wp_Operation_state', '5') %}
'Cool'
{%- elif is_state('sensor.wp_Operation_state', '6') %}
'Pool'
{%- elif is_state('sensor.wp_Operation_state', '7') %}
'Anti legionella'
{%- elif is_state('sensor.wp_Operation_state', '98') %}
'Standby'
{%- elif is_state('sensor.wp_Operation_state', '99') %}
No demand
{%- elif is_state('sensor.wp_Operation_state', '100') %}
'Off'
{% else %}
Ukendt
{%- endif %}
{%endif%}
When using “Templates” in Developer tools, it seems to work. But when inserting it to configuration.yaml it gives state “Unknown”.
Can anyone help me not loosing my mind?
Best regards
Thomas