Need help with mqtt climate yaml configuration

I am trying to improve the following yaml code (I did not write it) for a mqtt climate sensor with the following:

  • buttons do not display in the card at all; they display in the setting page as a dropdown menu only
  • I would like to add a third button (suspend) and I managed to do it but there is no icon and clicking on it does nothing, suspend should send an mqtt message
  • My sensor has an hysteresis temperature above and below the desired temperature but I am not sure how to display it. I assume I need to setup target_temperature_low and target_temperature_high in the TARGET_TEMPERATURE_RANGE as described by climate entity doc

I know this is a lot of question but if you could at least give me clues because the doc is very unclear to me :confused:

mqtt:
climate:
    - name: Climate Controller
      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"
        - "heat"
        - "suspend"
      mode_state_topic: "AFB/sts/Run"
      mode_state_template: >
        {% if value == "1" %}
          heat
        {% else if value == "10"%}
          suspend
        {% else %}
          off
        {% endif %}
      mode_command_topic: "AFB/cmd/Run"
      mode_command_template: >
        {% if value == "heat" %}
          1
        {% else if value == "suspend"%}
          10
        {% else %}
          0
        {% endif %}
      precision: 0.1
      temperature_command_topic: "AFB/cmd/TempDesired"
      temperature_state_topic: "AFB/sts/TempDesired"
      temp_step: 0.5
      retain: false

Your topic’s title indicates you are seeking assistance for configuring an MQTT-based climate entity (that’s the MQTT HVAC integration) but all three of your questions appear to be about what you want to display in a Thermostat card..

So what’s the actual issue here? Does the climate entity you created not work at all or are you having difficulty configuring the Thermostat card to display the climate entity’s data?

Thank you for the HVAC link it seems to be a great ressource for me. I’ll dig into that.

Each question has a bit of both:
for the suspend button; it does not work because it is not sending any mqtt message and has no icon in the card
The 3 buttons are not displayed on the card
for the hysteresis it is not implemented because I don’t understand where to put it; I tried adding target temperature in yaml but I get error all the time. Then when programmed I also need to display it on the circle to change it.

I think with the link you sent maybe I can get further but it does not seem to say how to display all buttons on the thermostat card in a row (no dropdown)

maybe I try further with your link and ask later when I get further

I would love to find a full example config to modify and do my own but the hvac example does not contain buttons or hysteresis feature

A climate entity’s modes (the “buttons” you refer to) are displayed by the Thermostat card if you configure it to display them.

If you are not seeing the ability to add the preset modes feature to the card then you are not using the latest version of Home Assistant.

thank you; I got 3 buttons displayed but no icon on my new mode.
according to the doc I cannot create custom modes with custom icons; that is why I have no icon, true ?

doc says

Needs to be a subset of the default values [“auto”, “off”, “cool”, “heat”, “dry”, “fan_only”]

That’s correct.