Hi, I have a problem with sending json data to control my climate via mqtt with using esp32, I’m already try to send ON/OFF data, which are in my integration True/False, so I “translate” ‘heat’ to ‘True’ and ‘Off’ to ‘False’ (similar thing I do on state and work perfectly) on “on” , but HA don’t sending ‘Off/False’ data, always sending ‘Heat/True’ data when click ‘heat’ or ‘off’ button on dashboard and I can only activate climate, but can’t turn it off.
Tech tree is here:
Climate <—> ESP32<–>mqtt broker<—>HA
Topics:
ACesp32/command
ACesp32/state
My template code:
{% set value_json = [
{
"ist": 23,
"aussen": 34.5,
"conf": {
"on": true,
"turbo": false,
"eco": false,
"soll": 22,
"melle": false,
"mode": 1,
"fan": 0
}
}
] %}
{{value_json[0]['conf']['soll'] | int}}
{{value_json[0]['conf']['on'] | abs}}
“on” value here is what I want to change (later also “soll”, but I will do it later)
Config code:
climate:
- name: "Climate 211"
modes:
- "off"
- "heat"
#command on/off
mode_command_topic: "ACesp32/command"
mode_command_template: "{% if mode_command_topic == heat %} {\"on\": true} {% elif mode_command_topic == off %} {\"on\": false} {% endif %}"
#Change temp command (don't released yet)
temperature_command_topic: "ACesp32/command"
#temperature_command_template: "{% if temperature_command_topic == 'float' %} {\"soll\": temperature_command_topic} {% elif mode_command_topic == off %} {\"soll\": false} {% endif %}"
#Climate state ON/OFF (DONE)
mode_state_topic: "ACesp32/state"
mode_state_template: "{% if value_json[0]['conf']['on'] | abs == 1 %} heat {% else %} off {% endif %}"
#Temperature state (DONE)
current_temperature_topic: "ACesp32/state"
current_temperature_template: "{{ value_json[0]['conf']['soll'] | int }}"
max_temp: 35
min_temp: 15
precision: 1.0
HA dashboard
Thanks for help