I am switching from openhab to homeassistant and I am facing issues to make my MQTT devices work.
THe problem is that if the mqtt topic “home/EMSHeizungCat/boiler_data” is under {{ value_json.burnGas }} ON then I want that the climate is in status HEAT and if not in status OFF
Can somebody please help me? I searched here but found no where that I need to extract first the status and then evaluate it.
climate: # https://www.home-assistant.io/integrations/generic_thermostat/
# https://www.home-assistant.io/integrations/#search/mqtt
- name: "Heizung Temperatur"
unique_id: Heizung_Thermostat
current_temperature_topic: "home/EMSHeizungCat/thermostat_data"
current_temperature_template: '{{ value_json.thermostat_seltemp }}'
temperature_command_topic: "home/EMSHeizungCat/thermostat_cmd_temp"
temperature_state_topic: "home/EMSHeizungCat/thermostat_data"
temperature_state_template: '{{ value_json.thermostat_seltemp }}'
max_temp: 25
min_temp: 15
modes:
- "off"
- "heat"
availability_topic: "home/EMSHeizungCat/status"
retain: true
mode_state_topic: "home/EMSHeizungCat/boiler_data"
mode_state_template: >
var x = {{ value_json.burnGas }};
{% if (x === "on") %}
heat
{% else %}
off
{% endif %}