I am now at HA 0.97.1 and using MQTT HVAC to replace a custom component for the Mitsubishi Heatpump. It works well but the pop-up history graph does not show a green fill when operating ie. hvac_modes is cool (or something other than off)
operation_mode was recently renamed to hvac_modes so maybe that is the problem?
Here is my configuration code:
climate:
- <<: &mitsu_platform
platform: mqtt
modes:
- "off"
- heat
- dry
- cool
- fan_only
- auto
fan_modes:
- AUTO
- QUIET
- "1"
- "2"
- "3"
- "4"
swing_modes:
- AUTO
- "1"
- "2"
- "3"
- "4"
- "5"
- SWING
current_temperature_template: "{{ value_json.roomTemperature }}"
temperature_state_template: "{{ value_json.temperature }}"
swing_mode_state_template: "{{ value_json.vane }}"
fan_mode_state_template: "{{ value_json.fan }}"
mode_state_template: >
{% if value_json.power == "OFF" %}
off
{% elif value_json.mode == "FAN" %}
fan_only
{% else %}
{{ value_json.mode|lower }}
{% endif %}
- <<: *mitsu_platform
name: "Mitsubishi Heatpump"
current_temperature_topic: "heatpump/status"
temperature_command_topic: "heatpump/_set/temperature"
temperature_state_topic: "heatpump"
swing_mode_command_topic: "heatpump/_set/vane"
swing_mode_state_topic: "heatpump"
fan_mode_command_topic: "heatpump/_set/fan"
fan_mode_state_topic: "heatpump"
mode_command_topic: "heatpump/_set/mode"
mode_state_topic: "heatpump"
I am not sure what
- <<: &mitsu_platform
does as I copied this code from here
I just stripped it down for one heatpump. There is the following automation that goes with this.
- alias: 'Redirect all MQTT HVAC set commands to the heatpumps'
trigger:
- platform: mqtt
topic: heatpump/_set/+
action:
- service: mqtt.publish
data_template:
topic: '{{ "heatpump/set" }}'
payload: >
{% if trigger.topic.split("/")[-1] == "mode" %}
{% if trigger.payload|upper == "OFF" %}
{"power":"OFF"}
{% elif trigger.payload == "fan_only" %}
{"power":"ON","mode":"FAN"}
{% else %}
{{ "{\"power\":\"ON\",\"mode\":"|safe + trigger.payload|upper|tojson + "}" }}
{% endif %}
{% else %}
{{ "{" + trigger.topic.split("/")[-1]|tojson + ":" + trigger.payload|tojson + "}" }}
{% endif %}