MQTT Thermostat Discovery not Completely Working

host_os HassOS 4.13
installation_type   Home Assistant OS
os_name Linux
os_version  4.19.127-v7
version 0.115.4

Background:
I have a (relatively obscure) home automation system that can be thought of as a hub for devices. It supports MQTT and I’m trying to expose its devices via MQTT discovery. I have most of the devices (lights, switches, sensors) working, but I’m having issues with a couple. One such device is a HVAC thermostat.

The thermostat reports its state via this MQTT message:

stat/Zone1/RESULT {"Control":"Hold","HVAC":"Off","Fan":"Auto","Temperature":56,"Setpoint":55}

As you can see, one state topic covers all of the thermostat’s settings.

I’ve installed an HVAC entity via MQTT discovery. This worked to an extent, but there are some issues.

Looking at its thermostat card:

  1. Displaying the temperature (“current_temperature”), setpoint (“temperature”) and the hold state (“hold”) works. It properly shows the current temperature, the setpoint and the Hold state (“Run” or “Hold”) as the corresponding state is sent via MQTT.
  2. I can change the temperature setpoint using the slider.
  3. I can’t change the Hold state.
  4. I can’t see the Mode or Fan states on the card face. I thought I should at least see the Mode, as the Hold state is shown on the card as " - Hold", assuming the Mode should show up before the dash.
  5. If I click on three dots on the card, I see “Fan Mode” dropdown has “Auto” and “On” as possibilities (correct), “Preset” (assumed “hold”?) has “None”, “Run”, and “Hold” (“None” shouldn’t be there), and “Operation” (assumed “mode”?) has four blanks in the dropdown. I think I should see “Off”, “Cool”, “Heat”, “Auto”. When I click on any of these blanks, I get the following error message:
Failed to call service climate/set_hvac_mode. value is not allowed for dictionary value @ data['hvac.mode']

Screenshot temp card

I send the following for MQTT discovery of the thermostat (expanded for clarity):

homeassistant/climate/HVXLb1d0d912ed315aad_HV_1/config
{
        "unique_id": "HVXLb1d0d912ed315aad_HV_1",
        "name": "HV_1 Zone1",
        "qos": 1,
        "retain": true,
        "modes": [
                "Off",
                "Cool",
                "Heat",
                "Auto"
        ],
        "fan_modes": [
                "Auto",
                "On"
        ],
        "hold_modes": [
                "Run",
                "Hold"
        ],
        "mode_command_topic": "cmnd/Zone1/POWER",
        "hold_command_topic": "cmnd/Zone1/POWER",
        "temperature_command_topic": "cmnd/Zone1/POWER",
        "fan_mode_command_topic": "cmnd/Zone1/POWER",
        "current_temperature_topic": "stat/Zone1/RESULT",
        "current_temperature_template": "{{ value_json.Temperature }}",
        "mode_state_topic": "stat/Zone1/RESULT",
        "mode_state_template": "{{ value_json.HVAC }}",
        "hold_state_topic": "stat/Zone1/RESULT",
        "hold_state_template": "{{ value_json.Control }}",
        "temperature_state_topic": "stat/Zone1/RESULT",
        "temperature_state_template": "{{ value_json.Setpoint }}",
        "fan_mode_state_topic": "stat/Zone1/RESULT",
        "fan_mode_state_template": "{{ value_json.Fan }}",
        "temperature_unit": "F",
        "precision": 1.0,
        "max_temp": 99,
        "min_temp": 55
}

I’m wondering if the fact that all the state info is sent up in one topic’s payload, that there are conflicts with that, but maybe I’m doing something else wrong?

I’d like to find a solution that uses MQTT discovery, as I would like to distribute my MQTT discovery feature to fellow users of the home automation system I am using.

I’ve read through the relevant documentation (as far as I could find), and searched for similar situations, but came up empty. Any help would be appreciated.

Thanks!

Solved

Turns out that the modes need to be lower case. .I’ve been able to modify the mode values and templates for them (since my HVAC device sends modes in Title case) to get this to work.