I have the code below but OVER and UNDER temperatures are not displaying in the card.
log error
2024-01-18 12:49:21.372 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'ThermostatOvertemp' when rendering '{{ value_json.ThermostatOvertemp}}'
2024-01-18 12:49:21.373 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'ThermostatUndertemp' when rendering '{{ value_json.ThermostatUndertemp}}'
2024-01-18 12:49:21.376 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'dict object' has no attribute 'ThermostatUndertemp' (value: {"IP_STARSSI":-27}, template: {{ (value_json.ThermostatUndertemp|float) + states(afterburner_desired_temperature|float) }})
2024-01-18 12:49:21.377 ERROR (MainThread) [homeassistant.components.mqtt.climate] Could not parse temperature_low_state_template from {"IP_STARSSI":-27}
2024-01-18 12:49:21.379 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'dict object' has no attribute 'ThermostatOvertemp' (value: {"IP_STARSSI":-27}, template: {{ (value_json.ThermostatOvertemp|float) }})
2024-01-18 12:49:21.379 ERROR (MainThread) [homeassistant.components.mqtt.climate] Could not parse temperature_high_state_template from {"IP_STARSSI":-27}
basically I have a sensor AFB_desired_temp
which is my target temperature and I need to display above and below AFB_thermostat_under_temperature
and AFB_thermostat_over_temperature
I have been following the doc there
Can you tell me why it is not working ? everything else works fine
mqtt:
sensor:
- name: AFB Desired Temperature
unique_id: AFB_desired_temp
state_topic: "AFB/sts/TempDesired"
device_class: temperature
unit_of_measurement: °C
state_class: measurement
- name: AFB Thermostat Over Temperature
unique_id: AFB_thermostat_over_temperature
state_topic: "AFB/JSONout"
value_template: "{{ value_json.ThermostatOvertemp}}"
state_class: measurement
- name: AFB Thermostat Under Temperature
unique_id: AFB_thermostat_under_temperature
state_topic: "AFB/JSONout"
value_template: "{{ value_json.ThermostatUndertemp}}"
state_class: measurement
climate:
- name: AFB
action_topic: "AFB/sts/RunState"
action_template: >
{% if value in ("0", "1", "6", "7", "8") %}
off
{% elif value in ("10", "12") %}
idle
{% else %}
heating
{% endif %}
current_temperature_topic: "AFB/sts/TempCurrent"
max_temp: 35
min_temp: 8
modes:
- "off"
- "auto"
- "heat"
mode_state_topic: "AFB/sts/Run"
mode_state_template: >
{% if value == "1" %}
heat
{% elif value == "10" %}
auto
{% else %}
off
{% endif %}
mode_command_topic: "AFB/cmd/Run"
mode_command_template: >
{% if value == "heat" %}
1
{% elif value == "auto" %}
-1
{% else %}
0
{% endif %}
precision: 0.1
temperature_command_topic: "AFB/cmd/TempDesired"
temperature_state_topic: "AFB/sts/TempDesired"
temp_step: 0.5
retain: false
unique_id: AFB_climate_control
temperature_high_command_topic: "AFB/JSONout"
temperature_high_state_topic: "AFB/JSONout"
temperature_high_state_template: >
{{ (value_json.ThermostatOvertemp|float) + states(AFB_desired_temperature|float) }}
temperature_low_command_topic: "AFB/JSONout"
temperature_low_state_topic: "AFB/JSONout"
temperature_low_state_template: >
{{ (value_json.ThermostatUndertemp|float) + states(AFB_desired_temperature|float) }}