After some testing and debugging I’m posting here also a MQTT “native” configuration for this thermostat.
I have a 2 pipes fancoil device with Modbus and MQTT settings available (MQTT OR Modbus, not both)
This config allow for HA to subscribe and publish relevant messages to read and write settings to the device.
The config has been only lightly tested so it may contain some errors, post here if you find some.
MQTT
PRO: all feature available by design (fan, modes), with a little patience it should be possible to also send scheduling programs
CONS: no direct connection from HA to MC6, so if a message is lost/gets error the feedback is missing and the climate entity revert to its previous state when MC6 publish a new message; missing power command options (needs separate MQTT switch, with the same problems as the climate entity)
MODBUS
PRO: direct connection with the thermostat, automation gets immediate response to action (or get immediately an error)
CONS: missing fan mode feature, ATM needs modification to HA modbus code to modify temp settings
mqtt:
- climate:
name: MC6 Climate
object_id: mc6_1
unique_id: mc6_1
# MC6 gets updates immediately but sends status messages only after some minutes, so it's better to update the UI optimistically
optimistic: true
# MC6 in MQTT config supports only 4 modes, cooling,heating,fan only and dehumidifying
# MC6 discard the dry mode when sent by mqtt, it may report it's status if the dehumid settings is enabled on the thermostat (not tested)
modes:
- "cool"
- "heat"
- "fan_only"
- "dry"
mode_state_topic: "updData/MACADDRESS-lowercase"
# from MC6 manual: mode(1 cool, 2 heat, 3 vent, 4 auto), but in my thermostat the Auto fnction is replaced by Dehumid
mode_state_template: >-
{% if value_json.mode == 1 %}
cool
{% elif value_json.mode == 2 %}
heat
{% elif value_json.mode == 3 %}
fan_only
{% elif value_json.mode == 4 %}
dry
{% endif %}
mode_command_topic: "MACADDRESS-lowercase"
mode_command_template: >-
{% if (value | string) == "cool" %}
{ "mode": 1 }
{% elif (value | string) == "heat" %}
{ "mode": 2 }
{% elif (value | string) == "fan_only" %}
{ "mode": 3 }
{% elif (value | string) == "dry" %}
{ "mode": 4 }
{% endif %}
# from MC6 manual: fan speed(1 high, 2 medium, 3 low, 4 auto)
fan_modes:
- "High"
- "Medium"
- "Low"
- "Auto"
fan_mode_state_topic: "updData/MACADDRESS-lowercase"
fan_mode_state_template: >-
{% if value_json.fan == 1 %}
High
{% elif value_json.fan == 2 %}
Medium
{% elif value_json.fan == 3 %}
Low
{% elif value_json.fan == 4 %}
Auto
{% endif %}
fan_mode_command_topic: "MACADDRESS-lowercase"
fan_mode_command_template: >-
{% if value == "High" %}
{ "fan":3 }
{% elif value == "Medium" %}
{ "fan":2 }
{% elif value == "Low" %}
{ "fan":1 }
{% elif value == "Auto" %}
{ "fan":4 }
{% endif %}
min_temp: 5
max_temp: 30
temp_step: 0.5
current_temperature_topic: "updData/MACADDRESS-lowercase"
# dividing by 10 when reading the settings
current_temperature_template: "{{ value_json.temp | float / 10 }}"
temperature_state_topic: "updData/MACADDRESS-lowercase"
# dividing by 10 when reading the settings
temperature_state_template: "{{ value_json.settemp | float / 10 }}"
temperature_command_topic: "MACADDRESS-lowercase"
# multiplying by 10 when writing the settings
temperature_command_template: "{ \"settemp\":{{ (value * 10) | int }} }"
current_humidity_topic: "updData/MACADDRESS-lowercase"
# dividing by 10 when reading the settings
current_humidity_template: "{{ value_json.humi | int / 10 }}"
precision: 0.1
retain: false
qos: 1
- switch:
unique_id: mc6_1_switch_onoff
object_id: mc6_1_switch_onoff
name: "MC6-1 Switch-onoff"
state_topic: "updData/MACADDRESS-lowercase"
optimistic: true
state_on: "ON"
state_off: "OFF"
value_template: >-
{% if value_json.onoff == 1 %}
"ON"
{% elif value_json.onoff == 2 %}
"OFF"
{% endif %}
command_topic: "MACADDRESS-lowercase"
payload_on: '{"onoff":1 }'
payload_off: '{"onoff":2 }'
template:
- sensor:
- name: "MC6-1-Humi"
device_class: humidity
unit_of_measurement: '%'
state: "{{ state_attr('climate.mc6_hvac', 'current_humidity') | float }}"