Mitsubishi Heat Pump

I disconnected the CN105 and rechecked the pins. They looked OK.

In the advanced tools, the serial port was enabled. I disabled it.

The log now looks more like it should, I believe:

69374: M-AC - OUT: FC 42 1 30 10 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7B
69673: M-AC - IN: FC 62 1 30 10 2 0 0 0 8 B 0 0 0 0 3 A8 0 0 0 0
69674: M-AC: didTransition: UpdatingStatus -> StatusUpdated
69674: M-AC: didTransition: StatusUpdated -> UpdatingStatus
69674: M-AC: US: 1
69675: M-AC - OUT: FC 42 1 30 10 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7A
69973: M-AC - IN: FC 62 1 30 10 3 0 0 8 0 0 A5 0 0 0 0 0 0 0 0 0
69974: M-AC: didTransition: UpdatingStatus -> StatusUpdated
69974: M-AC: didTransition: StatusUpdated -> ScheduleNextStatusUpdate
69975: M-AC: didTransition: ScheduleNextStatusUpdate -> WaitingForScheduledStatusUpdate
71373: M-AC - IN: FC 62 1 30 10 2 0 0 0 8 B 0 0 0 0 3 A8 0 0 0 0
71374: M-AC: didTransition: UpdatingStatus -> StatusUpdated
71374: M-AC: didTransition: StatusUpdated -> UpdatingStatus
71375: M-AC: US: 1
71375: M-AC - OUT: FC 42 1 30 10 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7A
71673: M-AC - IN: FC 62 1 30 10 3 0 0 8 0 0 A5 0 0 0 0 0 0 0 0 0
71674: M-AC: didTransition: UpdatingStatus -> StatusUpdated
71674: M-AC: didTransition: StatusUpdated -> ScheduleNextStatusUpdate
71674: M-AC: didTransition: ScheduleNextStatusUpdate -> WaitingForScheduledStatusUpdate
74775: M-AC: US: 1
74775: M-AC - OUT: FC 42 1 30 10 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7A
75073: M-AC - IN: FC 62 1 30 10 3 0 0 8 0 0 A5 0 0 0 0 0 0 0 0 0
75074: M-AC: didTransition: UpdatingStatus -> StatusUpdated
75074: M-AC: didTransition: StatusUpdated -> ScheduleNextStatusUpdate
75074: M-AC: didTransition: ScheduleNextStatusUpdate -> WaitingForScheduledStatusUpdate
76172: M-AC: didTransition: WaitingForScheduledStatusUpdate -> UpdatingStatus

And even more importantly, it looks like MQTT updates are now being provided, as seen in MQTT Explorer. See screen capture:

Look like we are real close now, thanks to your great advice.

I can now report that the commands sent through the infrared remote (e.g. power ON, set temperature to 22) are being echoed in an update state published in MQTT.

On the OH side, the received updates are working, in the sense that if I change a setting with the infrared remote, the corresponding setting gets updated in the OH interface.

However, at this point, the commands sent through OH are not working yet.

Thanks again.

Great to hear - now the hard part is over :partying_face:

What is your OH MQTT config?

Here is my mqtt.things:

Bridge mqtt:broker:mosquit "MQTT Broker" [ host="127.0.0.1" ] {
  Thing topic ESP_Easy1 {
    Channels:
      Type number:acRoomTemperature [ stateTopic="ESP_Easy1/Thermopompe-CdM/settings", 
                                      transformationPattern="JSONPATH:$.roomTemperature" ]

      Type number:acTemperature [ stateTopic="ESP_Easy1/Thermopompe-CdM/settings", 
                                  transformationPattern="JSONPATH:$.temperature", 
                                  commandTopic="ESP_Easy1/Thermopompe-CdM/settings/cmd", 
                                  formatBeforePublish="Thermopompe-CdM,temperature,%d" ]

      Type string:acPower [ stateTopic="ESP_Easy1/Thermopompe-CdM/settings", 
                            transformationPattern="JSONPATH:$.power", 
                            commandTopic="ESP_Easy1/Thermopompe-CdM/settings/cmd", 
                            formatBeforePublish="Thermopompe-CdM,power,%s" ]

      Type string:acMode [ stateTopic="ESP_Easy1/Thermopompe-CdM/settings", 
                           transformationPattern="JSONPATH:$.mode", 
                           commandTopic="ESP_Easy1/Thermopompe-CdM/settings/cmd", 
                           formatBeforePublish="Thermopompe-CdM,mode,%s" ]

      Type string:acFan [ stateTopic="ESP_Easy1/Thermopompe-CdM/settings", 
                          transformationPattern="JSONPATH:$.fan", 
                          commandTopic="ESP_Easy1/Thermopompe-CdM/settings/cmd", 
                          formatBeforePublish="Thermopompe-CdM,fan,%s" ]

      Type string:acVane [ stateTopic="ESP_Easy1/Thermopompe-CdM/settings", 
                           transformationPattern="JSONPATH:$.vane", 
                           commandTopic="ESP_Easy1/Thermopompe-CdM/settings/cmd", 
                           formatBeforePublish="Thermopompe-CdM,vane,%s" ]

      Type string:acWideVane [ stateTopic="ESP_Easy1/Thermopompe-CdM/settings", 
                               transformationPattern="JSONPATH:$.wideVane", 
                               commandTopic="ESP_Easy1/Thermopompe-CdM/settings/cmd", 
                               formatBeforePublish="Thermopompe-CdM,wideVane,%s" ]
  }
}

Basically, I copied your stuff changing “FF_Nik_Room” for “ESP_Easy1” and “ac” for “Thermopompe-CdM”.

And here are my relevant items:

Number ESP_Easy1_ac_room_temp "Room temperature [%.1f °C]" <temperature> { channel="mqtt:topic:mosquit:ESP_Easy1:acRoomTemperature" }
Number ESP_Easy1_ac_temp "Temperature [%.1f °C]" <heating> { channel="mqtt:topic:mosquit:ESP_Easy1:acTemperature" }
String ESP_Easy1_ac_power "Power []" { channel="mqtt:topic:mosquit:ESP_Easy1:acPower" }
String ESP_Easy1_ac_mode "Mode []" <fan_ceiling> { channel="mqtt:topic:mosquit:ESP_Easy1:acMode" }
String ESP_Easy1_ac_fan "Fan" <fan> { channel="mqtt:topic:mosquit:ESP_Easy1:acFan" }
String ESP_Easy1_ac_vane "Vane" <flow> { channel="mqtt:topic:mosquit:ESP_Easy1:acVane" }
String ESP_Easy1_ac_widevane "Wide Vane" <flow> { channel="mqtt:topic:mosquit:ESP_Easy1:acWideVane" }

And my relevant part sitemap portion:

     Frame label="Thermopompe CdM" {
	Text item=ESP_Easy1_ac_room_temp label="CdM: actuel"
	Setpoint item=ESP_Easy1_ac_temp label="CdM:cible [%.1f \u00B0C]" minValue=16 maxValue=31 step=1
	Switch item=ESP_Easy1_ac_power mappings=[OFF="Off", ON="On"]
	Switch item=ESP_Easy1_ac_mode mappings=[COOL="Cool", HEAT="Heat", DRY="Dry", FAN="Fan", AUTO="Auto"]
	Selection item=ESP_Easy1_ac_fan mappings=[1="1", 2="2",3="3",4="4",AUTO="AUTO",QUIET="QUIET"]
	Selection item=ESP_Easy1_ac_vane mappings=[1="1", 2="2",3="3",4="4",5="5",AUTO="AUTO",SWING="SWING"]
	Selection item=ESP_Easy1_ac_widevane	mappings=["<<"="<<","<"="<","|"="|",">"=">",">>"=">>",SWING="SWING"]
	}
1 Like

You should not change the content of formatBeforePublish, this defines the payload and must stay the same, i.e.

formatBeforePublish="MitsubishiHP,power,%s"

Yes, I should have thought better. The problem, I guess, is that I do not have a very clear view of how the whole thing works.

Anyway, now my OH interface is working perfectly well. Huge thanks to you for all the fantastic help!

I can now replace the cover on my heatpump. My ID is to leave the D1 mini inside the heatpump, underneath the cover. I suppose that the wifi is good enough to reach in there. But I need to ensure that nothing will mess up with the electrical contacts of the D1. Are you leaving your D1 in your heatpump? If so do your cover it with something (maybe just electrical tape) to prevent any electrical accident?

I found a small spot that I thought is dry and safe from any humidity, also no metal around … and put/tucked D1 there and closed the cover. So I guess you will need to trust your own judgment on this, specially since it depends on the type of AC how much space is left and where …

One more thing - I turned on the CPU Eco Mode in Tools | Advanced, not sure how much effect it has, but should reduce the D1 module heating … just FYI … not that I had any problem with heating in the first place …

OK will follow your advice. That closes chapter 1 of my heatpump stuff. Chapter 2 will be opened a bit later. It is about another Mitsubishi indoor unit that is being fed by the same exterior unit. Since both units are same brand, same generation, one might think that doing the second will be straightforward, but I do have a couple of concerns. First. this second unit has a completely diffrent layout because rather than a floor model, it is a “cassette”-type unit, embedded in the ceiling of my solarium. The second difference is that rather than being operated by an infrared remote, it has a wired wall-mounted remote. If there is a CN105 plug on the board of that unit, it may already be occupied by that existing wired remote. I don’t know if it is possible to “Y” two such connections together. Anyway, I will try to look into that in a few weeks from now.
Cheers, --Pierre

Using custom widget for ACs (based on [SOLVED] UI Widget: Intesis aircon controller; No commands send to items, thx to @hmerk and others) :

ezgif-4-3699f4add539

widget yaml:

uid: air_conditioner
tags: []
props:
  parameters:
    - description: Title
      label: Title
      name: title
      required: false
      type: TEXT
    - context: prefix
      description: The name prefix of widget items
      label: Prefix
      name: prefix
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Jan 8, 2021, 1:40:45 PM
component: f7-block
config:
  class:
    - no-padding
slots:
  default:
    - component: Label
      config:
        text: =props.title
        style:
          text-align: center
          font-size: 16px
    - component: f7-row
      config:
        class:
          - margin
          - align-items-center
      slots:
        default:
          - component: oh-link
            config:
              action: toggle
              actionItem: =props.prefix + "_Power"
              actionCommand: ON
              actionCommandAlt: OFF
              class:
                - display-flex
                - flex-direction-column
            slots:
              default:
                - component: f7-icon
                  config:
                    f7: power
                    size: 28
                    color: '=items[props.prefix + "_Power"].state === "OFF" ? "red" : "green"'
                - component: Label
                  config:
                    class:
                      - margin-top-half
                    text: ON/OFF
                    style:
                      color: var(--f7-text-color)
                      font-size: var(--f7-badge-in-icon-font-size)
          - component: Label
            config:
              text: =items[props.prefix + "_RoomTemperature"].state.displayState || items[props.prefix + "_RoomTemperature"].state
    - component: f7-row
      config:
        class:
          - justify-content-center
      slots:
        default:
          - component: oh-knob
            config:
              min: 16
              max: 31
              stepSize: 1
              size: 270
              item: =[props.prefix + '_SetTemperature']
    - component: f7-row
      config:
        class:
          - margin-half
      slots:
        default:
          - component: oh-repeater
            config:
              fragment: true
              for: mode
              in:
                - value: AUTO
                  icon: arrow_2_circlepath
                - value: HEAT
                  icon: thermometer_sun
                - value: DRY
                  icon: drop
                - value: FAN
                  icon: wind
                - value: COOL
                  icon: thermometer_snowflake
            slots:
              default:
                - component: f7-col
                  slots:
                    default:
                      - component: oh-link
                        config:
                          class:
                            - display-flex
                            - flex-direction-column
                          action: command
                          actionItem: =props.prefix + "_Mode"
                          actionCommand: =loop.mode.value
                        slots:
                          default:
                            - component: f7-icon
                              config:
                                style:
                                  color: '=(items[props.prefix + "_Mode"].state === loop.mode.value) ? "green" : "gray"'
                                f7: =loop.mode.icon
                            - component: Label
                              config:
                                class:
                                  - margin-top-half
                                text: =loop.mode.value
                                style:
                                  color: '=(items[props.prefix + "_Mode"].state === loop.mode.value) ? "green" : "gray"'
                                  font-size: var(--f7-badge-in-icon-font-size)
    - component: f7-row
      config:
        class:
          - padding-top-half
          - margin-half
      slots:
        default:
          - component: oh-repeater
            config:
              fragment: true
              for: setting
              filter: items[props.prefix + loop.setting.suffix].state != "-"
              in:
                - suffix: _Fan
                  icon: chart_bar
                  iconColor: yellow
                - suffix: _Vane
                  icon: arrow_up_down_circle
                  iconColor: teal
                - suffix: _WideVane
                  icon: arrow_left_right_circle
                  iconColor: teal
            slots:
              default:
                - component: f7-col
                  slots:
                    default:
                      - component: oh-link
                        config:
                          action: options
                          actionItem: =props.prefix + loop.setting.suffix
                          class:
                            - display-flex
                            - flex-direction-column
                        slots:
                          default:
                            - component: f7-icon
                              config:
                                color: =loop.setting.iconColor
                                f7: =loop.setting.icon
                            - component: Label
                              config:
                                class:
                                  - margin-top-half
                                text: =items[props.prefix + loop.setting.suffix].state
                                style:
                                  color: var(--f7-text-color)
                                  font-size: var(--f7-badge-in-icon-font-size)

one needs to append following suffixes as below when defining items:

  _RoomTemperature
  _SetTemperature
  _Power
  _Mode
  _Fan
  _Vane
  _WideVane

for example, my living room AC (label/name pairs):

Air Conditioner (gGF_Living_AC)
  Room Temperature (gGF_Living_AC_RoomTemperature)
  Set Temperature (gGF_Living_AC_SetTemperature)
  Power (gGF_Living_AC_Power)
  Mode (gGF_Living_AC_Mode)
  Fan (gGF_Living_AC_Fan)
  Vane (gGF_Living_AC_Vane)
  Wide Vane (gGF_Living_AC_WideVane)

Note: one can omit i.e. _WideVane and it will not be rendered (not all my ACs have wide vane) …

Following above rules AC widget can be added as simple as

- component: widget:air_conditioner
  config:
    prefix: gGF_Living_AC
    title: Living Room AC

For completeness adding mqtt yaml too (please note allowedStates that contains values one can pick in the widget, as seen in the attached animated gif):

UID: mqtt:topic:homepi:acLivingRoom
label: Air Conditioner Living's Room
thingTypeUID: mqtt:topic
configuration:
  payloadNotAvailable: Connection Lost
  availabilityTopic: GF_Living_Room/status/LWT
  payloadAvailable: Connected
bridgeUID: mqtt:broker:homepi
channels:
  - id: acRoomTemperature
    channelTypeUID: mqtt:number
    label: AC Room Temperature
    description: null
    configuration:
      stateTopic: GF_Living_Room/ac/settings
      transformationPattern: JSONPATH:$.roomTemperature
      unit: °C
  - id: acSetTemperature
    channelTypeUID: mqtt:number
    label: AC Set Temperature
    description: null
    configuration:
      commandTopic: GF_Living_Room/ac/settings/cmd
      unit: °C
      formatBeforePublish: MitsubishiHP,temperature,%d
      stateTopic: GF_Living_Room/ac/settings
      transformationPattern: JSONPATH:$.temperature
  - id: acPower
    channelTypeUID: mqtt:switch
    label: AC Power
    description: null
    configuration:
      commandTopic: GF_Living_Room/ac/settings/cmd
      formatBeforePublish: MitsubishiHP,power,%s
      stateTopic: GF_Living_Room/ac/settings
      transformationPattern: JSONPATH:$.power
  - id: acMode
    channelTypeUID: mqtt:string
    label: AC Mode
    description: null
    configuration:
      commandTopic: GF_Living_Room/ac/settings/cmd
      allowedStates: HEAT,COOL,FAN,DRY,AUTO
      formatBeforePublish: MitsubishiHP,mode,%s
      stateTopic: GF_Living_Room/ac/settings
      transformationPattern: JSONPATH:$.mode
  - id: acFan
    channelTypeUID: mqtt:string
    label: AC Fan
    description: null
    configuration:
      commandTopic: GF_Living_Room/ac/settings/cmd
      allowedStates: 1,2,3,4,AUTO,QUIET
      formatBeforePublish: MitsubishiHP,fan,%s
      stateTopic: GF_Living_Room/ac/settings
      transformationPattern: JSONPATH:$.fan
  - id: acVane
    channelTypeUID: mqtt:string
    label: AC Vane
    description: null
    configuration:
      commandTopic: GF_Living_Room/ac/settings/cmd
      allowedStates: 1,2,3,4,5,SWING,AUTO
      formatBeforePublish: MitsubishiHP,vane,%s
      stateTopic: GF_Living_Room/ac/settings
      transformationPattern: JSONPATH:$.vane
  - id: acWideVane
    channelTypeUID: mqtt:string
    label: AC Wide Vane
    description: null
    configuration:
      commandTopic: GF_Living_Room/ac/settings/cmd
      allowedStates: <<,<,|,>,>>,<>,SWING
      formatBeforePublish: MitsubishiHP,wideVane,%s
      stateTopic: GF_Living_Room/ac/settings
      transformationPattern: JSONPATH:$.wideVane
1 Like

i am using this widget as well as a popup widget for 2 thermostats so thank you all for your work here.

one question, how do you achieve this:

image

I would like to use this in another widget? It does not seem to be part of the posted YAML, isn´t it?

As stated above

you can see

allowedStates: 1,2,3,4,5,SWING,AUTO

but the same can be achieved with adding OPTIONS as metadata to item.

Thank you for this! Can you tell me how to get this in to Google home/assistant?

Hi
How are you.
I just finished transferring from arduino to ESPEasy and it does works besides one thing.
The operational status is no longer beeing received:
{“roomTemperature”:24,“operating”:false}
Is it normal? I had this feature in my old systems and it was very handy to mesure the system when it’s in function. Thanks for your precious help

Plugin is returning the following info currently

{"roomTemperature":23.5,"wideVane":"|","power":"OFF","mode":"COOL","fan":"AUTO","vane":"5","iSee":true,"temperature":22.0}

I guess you mean

bool operating; // if true, the heatpump is operating to reach the desired temperature

This one is not currently part of ESPEasy plugin but should be easy to add …

Hi

That’s right.
The [SwiCago] arduine schema does include it and I used it for around 3 years.

bool HeatPump::getOperating() {
return currentStatus.operating;
}

Thanks for your precious help
José

Added support for operating and compressor frequency, test fw for ESP 8266, 4M1M can be downloaded here.

Sample output

{"roomTemperature":25.5,"wideVane":"|","power":"OFF","mode":"COOL","fan":"AUTO","vane":"AUTO","iSee":true,"operating":true,"compressorFrequency":5,"temperature":24.0}

Code

Thank you for your help
I will test it tomorrow :grinning:

José Cordeiro

Hi

Thanks for your help. it works :slight_smile:

1 Like

Was merged so you can use “official” releases, FYI.