MQTT HVAC: separate mode and power topics

Hello everyone!

I have mqtt air conditioning controller, that have separate topics for operation mode (cool, heat, fan, dry) and power (on, off).
But in Home Assistant “off” is one of modes.
Is there any decision to write MQTT HVAC configuration for my case natively without intermediate mqtt topics and automations reading from and publishing to different topics?

MQTT topics:

For Operation Mode state and command can be:

  • 0 - Cool Mode
  • 1 - Heat Mode
  • 2 - Auto Mode
  • 3 - Dry Mode
  • 4 - Fan Mode

For Fan Speed:

  • 0 - Low
  • 1 - Medium
  • 2 - High
  • 3 - Auto

For Power:

  • 0 - Off
  • 1 - On

My current config:

  mqtt:
    climate:
      - name: Thermostat - Office
        object_id: thermostat_office
        unique_id: thermostat_office
        current_temperature_topic: "ac_office/Room Temperature (L1.100)"
        modes:
          - "cool"
          - "heat"
          - "fan_only"
          - "dry"
          - "auto"
        mode_state_topic: "ac_office/Operation Mode (L1.100)"
        mode_state_template: >
            {{ ['cool', 'heat', 'auto', 'dry', 'fan_only'][value | int] }}
        mode_command_topic: "ac_office/Operation Mode (L1.100)/control"
        mode_command_template: >
            {{ {'cool': 0, 'heat': 1, 'auto': 2, 'dry': 3, 'fan_only': 4}[value] }}
        temperature_state_topic: "ac_office/Set Temperature (L1.100)"
        temperature_command_topic: "ac_office/Set Temperature (L1.100)/control"
        fan_mode_state_topic: "ac_office/Fan Speed (L1.100)"
        fan_mode_state_template: >
            {{ ['low', 'medium', 'high', 'auto'][value | int] }}
        fan_mode_command_topic: "ac_office/Fan Speed (L1.100)/control"
        fan_mode_command_template: >
            {{ {'low': 0, 'medium': 1, 'high': 2, 'auto': 3}[value] }}
        fan_modes: 
          - "auto"
          - "low"
          - "medium"
          - "high"
        temp_step: 1
        precision: 0.1
        min_temp: 16
        max_temp: 30
        optimistic: false
        retain: true

But with such config I can’t turn it off.
power_command_topic doesn’t work because AC should report it’s “off” state to mode_state_topic, but it doesn’t, obviously.

Thanks for any advice!

Did you resolve this? I’m in the same boat!

No, I created separate mqtt topic helper with HVAC Mode where 0 - off, 1 - cool, 2 - heat etc.
And I used automation to translate HVAC Mode helper state to device original topics ‘Operation Mode’ and ‘Power’. And one more automation to translate state back from device original topics to my helper.