Finally found the time to integrate my Mitsubishi Heatpump. It turned out there are many a bit different tutorials available on how to achieve this - all using the great library from https://github.com/SwiCago/HeatPump, but with a bit different sketches - so no out-of-the-box solution (firmware).
I’m using ESPEasy for other sensors I have at home and really like how easy it is to set it up, do OTA, … therefore decided to give it a spin and integrate the above mentioned library into ESPEasy as a plugin.
The Mitsubishi Heatpump can now be added as simple as selecting it from the list, selecting the serial port used for connection - and we are ready:
Once we hit Submit, the plugin will start sending messages through controller, i.e. MQTT with payload:
{"roomTemperature":23.0,"wideVane":"|","power":"OFF","mode":"AUTO","fan":"QUIET","vane":"AUTO","iSee":false,"temperature":24.0}
to set topic, in above example that would be FF_Nik_Room/ac/settings
.
Message is send every time a change is detected (i.e. one changes settings using IR remote control) and every X seconds, as set in the settings (60 seconds in above screenshot).
Controlling AC is done through the same topic with /cmd
suffix, i.e. FF_Nik_Room/ac/settings/cmd
in our example. Payload:
-
MitsubishiHP,temperature,<value>
- set temperature, value can be between 16 and 31; -
MitsubishiHP,power,<value>
- value =ON
orOFF
; -
MitsubishiHP,mode,<value>
- value =HEAT
,COOL
,FAN
,DRY
orAUTO
; -
MitsubishiHP,fan,<value>
- value =1
,2
,3
,4
,AUTO
orQUIET
; -
MitsubishiHP,vane,<value>
- value =1
,2
,3
,4
,5
,SWING
orAUTO
; -
MitsubishiHP,widevane,<value>
- value =<<
,<
,|
,>
,>>
,<>
orSWING
.
Using info from here, this is how my OH config looks like:
.things
:
Bridge mqtt:broker:rasnas "MQTT Broker" [ host="192.168.2.51" ] {
Thing topic ffNikRoom {
Channels:
Type number:acRoomTemperature [ stateTopic="FF_Nik_Room/ac/settings", transformationPattern="JSONPATH:$.roomTemperature" ]
Type number:acTemperature [ stateTopic="FF_Nik_Room/ac/settings", transformationPattern="JSONPATH:$.temperature", commandTopic="FF_Nik_Room/ac/settings/cmd", formatBeforePublish="MitsubishiHP,temperature,%d" ]
Type string:acPower [ stateTopic="FF_Nik_Room/ac/settings", transformationPattern="JSONPATH:$.power", commandTopic="FF_Nik_Room/ac/settings/cmd", formatBeforePublish="MitsubishiHP,power,%s" ]
Type string:acMode [ stateTopic="FF_Nik_Room/ac/settings", transformationPattern="JSONPATH:$.mode", commandTopic="FF_Nik_Room/ac/settings/cmd", formatBeforePublish="MitsubishiHP,mode,%s" ]
Type string:acFan [ stateTopic="FF_Nik_Room/ac/settings", transformationPattern="JSONPATH:$.fan", commandTopic="FF_Nik_Room/ac/settings/cmd", formatBeforePublish="MitsubishiHP,fan,%s" ]
Type string:acVane [ stateTopic="FF_Nik_Room/ac/settings", transformationPattern="JSONPATH:$.vane", commandTopic="FF_Nik_Room/ac/settings/cmd", formatBeforePublish="MitsubishiHP,vane,%s" ]
Type string:acWideVane [ stateTopic="FF_Nik_Room/ac/settings", transformationPattern="JSONPATH:$.wideVane", commandTopic="FF_Nik_Room/ac/settings/cmd", formatBeforePublish="MitsubishiHP,wideVane,%s" ]
}
}
.items
:
Number FF_Nik_Room_ac_room_temp "Room temperature [%.1f °C]" <temperature> { channel="mqtt:topic:rasnas:ffNikRoom:acRoomTemperature" }
Number FF_Nik_Room_ac_temp "Temperature [%.1f °C]" <heating> { channel="mqtt:topic:rasnas:ffNikRoom:acTemperature" }
String FF_Nik_Room_ac_power "Power []" { channel="mqtt:topic:rasnas:ffNikRoom:acPower" }
String FF_Nik_Room_ac_mode "Mode []" <fan_ceiling> { channel="mqtt:topic:rasnas:ffNikRoom:acMode" }
String FF_Nik_Room_ac_fan "Fan" <fan> { channel="mqtt:topic:rasnas:ffNikRoom:acFan" }
String FF_Nik_Room_ac_vane "Vane" <flow> { channel="mqtt:topic:rasnas:ffNikRoom:acVane" }
String FF_Nik_Room_ac_widevane "Wide Vane" <flow> { channel="mqtt:topic:rasnas:ffNikRoom:acWideVane" }
.sitemap
:
Frame {
Text label="Nik's room" item=FF_Nik_Room_ac_room_temp icon="climate" {
Text item=FF_Nik_Room_ac_room_temp
Setpoint item=FF_Nik_Room_ac_temp minValue=16 maxValue=31 step=1
Switch item=FF_Nik_Room_ac_power mappings=[OFF="Off", ON="On"]
Switch item=FF_Nik_Room_ac_mode mappings=[COOL="Cool", HEAT="Heat", DRY="Dry", FAN="Fan", AUTO="Auto"]
Selection item=FF_Nik_Room_ac_fan mappings=[1="1", 2="2",3="3",4="4",AUTO="AUTO",QUIET="QUIET"]
Selection item=FF_Nik_Room_ac_vane mappings=[1="1", 2="2",3="3",4="4",5="5",AUTO="AUTO",SWING="SWING"]
Selection item=FF_Nik_Room_ac_widevane mappings=["<<"="<<","<"="<","|"="|",">"=">",">>"=">>",SWING="SWING"]
}
}
and result:
In my setup I’m using D1 mini ESP module since it can be powered directly from 5V so no additional components are needed, more or less just connecting 4 wires to it Details on how to connect AC and ESP module can be found in link above. Also thinking about adding an additional DHT22 into the AC to measure humidity in the room too … need to check if there is room in the AC for it
EDIT: commands now have a MitsubishiHP
prefix to distinguish them from other EspEasy commands .
EDIT2: Firmware images (releases) are available here, please note MitsubishiHP
plugin is part of test
images, i.e. ESP_Easy_mega-20200328_test_ESP8266_4M1M_VCC
and can be found within the zip
file (i.e. ESPEasy_mega-20200328.zip
).
EDIT3: PR was merged, image for devices with 1M flash (ESP-01, …) is here.
EDIT4: I already moved to OH3 so sharing setup for it too:
UID: mqtt:topic:homepi:acNikRoom
label: Air Conditioner Nik's Room
thingTypeUID: mqtt:topic
configuration:
payloadNotAvailable: Connection Lost
availabilityTopic: FF_Nik_Room/status/LWT
payloadAvailable: Connected
bridgeUID: mqtt:broker:homepi
location: Nik's Room
channels:
- id: acRoomTemperature
channelTypeUID: mqtt:number
label: AC Room Temperature
description: null
configuration:
stateTopic: FF_Nik_Room/ac/settings
transformationPattern: JSONPATH:$.roomTemperature
unit: °C
- id: acSetTemperature
channelTypeUID: mqtt:number
label: AC Set Temperature
description: null
configuration:
commandTopic: FF_Nik_Room/ac/settings/cmd
unit: °C
formatBeforePublish: MitsubishiHP,temperature,%d
stateTopic: FF_Nik_Room/ac/settings
transformationPattern: JSONPATH:$.temperature
- id: acPower
channelTypeUID: mqtt:switch
label: AC Power
description: null
configuration:
commandTopic: FF_Nik_Room/ac/settings/cmd
formatBeforePublish: MitsubishiHP,power,%s
stateTopic: FF_Nik_Room/ac/settings
transformationPattern: JSONPATH:$.power
- id: acMode
channelTypeUID: mqtt:string
label: AC Mode
description: null
configuration:
commandTopic: FF_Nik_Room/ac/settings/cmd
formatBeforePublish: MitsubishiHP,mode,%s
stateTopic: FF_Nik_Room/ac/settings
transformationPattern: JSONPATH:$.mode
- id: acFan
channelTypeUID: mqtt:string
label: AC Fan
description: null
configuration:
commandTopic: FF_Nik_Room/ac/settings/cmd
formatBeforePublish: MitsubishiHP,fan,%s
stateTopic: FF_Nik_Room/ac/settings
transformationPattern: JSONPATH:$.fan
- id: acVane
channelTypeUID: mqtt:string
label: AC Vane
description: null
configuration:
commandTopic: FF_Nik_Room/ac/settings/cmd
formatBeforePublish: MitsubishiHP,vane,%s
stateTopic: FF_Nik_Room/ac/settings
transformationPattern: JSONPATH:$.vane