Mitsubishi Heat Pump

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.