Skip to content

Automating a MrCool Mini Split Air Conditioner with Home Assistant

This image has an empty alt attribute; its file name is image-3.png
This is how I displayed it in my UI.

This tutorial works off of a couple of assumptions:

  • You have a working Home Assistant installation
    • Better tutorials than I can write have been written
  • You have installed the “Home Assistant Community Store” (HACS)
  • You have a temperature and humidity sensor installed in the room you are trying to automate
    • This isn’t required but takes the project from nice to having that polished feel.
  • You need to be comfortable editing the configuration.yaml. (This is subject to change, as home assistant is moving towards UI configuration for at least some of this)

Required Hardware:

Required Software:

First, we need to install the SmartIR Custom Component into Home Assistant.

In HACS, paste the SmartIR repository link and set the category to integration:

https://github.com/smartHomeHub/SmartIR
Pay attention that category is set to integration.

Once you do this, install the SmartIR Integration into Home Assistant.

Note that I am searching integrations.

Follow the instructions to connect your Broadlink device to your Wifi. Remember, this device will only work on 2.4GHZ networks.

Then, add it to your configuration as a remote. My configuration looked a bit like this:

remote:
  - platform: broadlink
    host: 192.168.1.111  ##You will need to change this
    mac: c1:f1:11:11:11:11  ##And change this

Now, restart Home Assistant.

Test your Broadlink device to make sure it is working, I use the broadlink.learn service and point a tv remote at it. If this is successful, you should get a notification with a code. If you don’t have a remote, you can wait until it times out and you will also get a notification that no signal was received.

One you have tested your Broadlink device, you need to go into your home assistant configuration directory and navigate to /config/custom_components/smartir/codes/climate. If any of these directories do not exist, you will need to create them. You will probably have the “smartir” directory and need to create “codes” and “climate“. Inside the climate folder, download this file.

Your next step is to add your climate component. Notice that device code is 3001. This is because the custom code file you downloaded is called 3001.json. If the project gets updated to contain a 3001 device before I can get a pull request, then you can simply change this line and the filename to match.

Add the following to your climate section. Your temperature, humidity, and power sensors are all optional, but I like to have them. These are separate sensors from the ones on your A/C unit or anything on your Broadlink, you would need to already have them setup in home assistant.

climate:
  - platform: smartir
    name: Bedroom AC
    unique_id: bedroom_ac
    device_code: 3001
    controller_data: 192.168.0.111  #change this to your broadlink ip.
    temperature_sensor: sensor.bedroom_temperature
    humidity_sensor: sensor.bedroom_humidity
    #power_sensor: binary_sensor.ac_power
To control some of the other functions, add the following to the switch section of your configuration.yaml
switch:
  - platform: broadlink
    host: 192.168.0.111
    mac: c1:f1:11:11:11:11
    switches:
      # MRCOOL Remote Functions:
      ac_display:
        friendly_name: "AC Display"
        command_on: 'JgDKAIuOEjQTERIzExESERIQEjQTEBIRExESEBISEjMTEBMQEhETMxI0EzMUMhMzFDIUMhUxEzQSNBI0EzMTMxI0EzMSNBMzEjQSNBMzEjQTMxMzEjQSERMzEjQSNBISEjMTEBI0EqmQjhIREjQSERMzEzMSNBMREjMTMxM0EjMUMhMQEzMUMhMzFA8UEBIQExAUEBIQExIRERIQExATERIQFBASEBMREhESERIQExESEBMREhAUEBIREjMUEBIRExATMhQQEzMSERMADQUAAAAAAAAAAAAAAAAAAA=='
        command_off: 'JgDKAIyOEjQSERMzEhETEBMRETQSERMQEhESERIREjQTEBMQFBARNBI0EjQSNBI0EzMTMxMzEjQTMxI0EjQSNBMzEzMTMxQyEjQTMxMzEjQTMxMzEjQTEBI0EzMTMxMQEzMUEBIzE6iQjxMQEzMTEBI0EjQSNBIREjQTMxI0EjQTMxISEjMSNBMzExATERESERESEhIRERESERMQEhETEBIRExASERIRExASERISEREVDxEREhESERIREzMTEBMREhERNBIREzMTEBMADQUAAAAAAAAAAAAAAAAAAA=='
      ac_swing:
        friendly_name: "AC Swing"
        command_on: 'JgDKAI2MFTEVDhUxFQ4VDhUPFDEVDhUOFQ4VDhUOFQ4VDhUxFQ4VMRQyFDIUMhQyFDIUMhQyFDIUMRUxFTEVMRUxFTEVMRUxFTEVMRUxFTEVMRUxFTEVDhUxFTEVMRUxFTEVMRUOFaaSjBQPFDIUDxQyFDIUMhQPFDIUMhQyFDEVMRUxFTEVDxQxFQ4VDhUOFQ4VDhUOFQ4VDhUOFQ4VDhUOFQ8UDhUOFQ4VDhUOFQ4VDhUOFQ4VDhUOFTEVDhUOFQ4VDhUOFQ8UMRUADQUAAAAAAAAAAAAAAAAAAA=='
        command_off: 'JgDKAI2MFTEV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AVMRUxFDIVMRUxFTEVMRUxFTEVMRUxFTEVMRUxFTEVMRUxFTEVDhUxFTEVMRUPFDEVDhUPFKaTjBQPFDIUDxQyFDIUMhQPFDIUMhQyFDIVMRUOFTEVMRUOFQ8UDxQPFA8UDhUPFA8UDxQOFQ4VDhUPFA8UDxQPFA8UDxQPFA8UDhUPFA8UDhUPFDEVDxQPFA8UMRUOFTEVMRUADQUAAAAAAAAAAAAAAAAAAA=='
        command_off: 'JgDKAI2MEjQSEhE0EhIREhESETQTERIRERISERIREjMTERIQEzMTMxMzEzMTMxMzEzMTMxMzEzMTMxM0EjQSNBI0EjQSNBI0EjQSNBI0EjQSNBI0EjQSEhE0EjQSNBISETQSEhESEamSixQQEzMTERIzEzMTNBIREjQSNBI0EjQSNBIREjQSNBISERIREhESERIREhESERIREhESERIREhESERIREhESERIREhESERIREhESERIREhESETQSEhESERIRNBISETQSNBIADQUAAAAAAAAAAAAAAAAAAA=='
      ac_sleep:
        friendly_name: "AC Sleep"
        command_on: 'JgDKAI2MFTEVDhUxFQ8UDxQPFA8UMRUxFQ4VMRUOFQ4VDxQxFTEVDxQxFTEVDhUxFQ8UDxQxFTEVMRUxFTEVMRUxFTEVMRUxFTEVMRUxFTEVMRUxFTEVDhUxFQ8UDxQPFDEVDhUPFKaTixUPFDIUDxQyFDIUMhQyFA8UDxQyFBATMhQyFDIUDxQQEzIVDhUOFTEVDhUxFTEVDhUPFA8UDxQPFA8UDxQPFA8UDxQOFQ8UDxQPFA8UDxQPFDEVDxQxFTEVMRUPFDEVMRUADQUAAAAAAAAAAAAAAAAAAA=='
        command_off: 'JgDKAI6MFDIUDxQyFA8UDxQPFA8UMhQyFDIUMhQPFBATEBMyFDIUDxQyFDIUDxQyFA8UDxQyFDIUMhUxFTEVMRUxFTEVMRUxFTEVMRUxFTEVMRUxFTEVDxQPFA8UDxQPFDEVDxQPFKaTixUOFTEVDxQxFTEVMRUyFA8UDxQPFA8UMhQyFDIUDxQQEzIUEBMPFDIUEBQxFTEVDhUPFA4VDxQPFA8UDxQPFA8UDxQPFA8UDxQPFA8UDhUPFDEVMRUxFTEVMRUOFTEVMRUADQUAAAAAAAAAAAAAAAAAAA=='
      ac_fan_auto:
        friendly_name: "AC Fan Auto"
        command_on: 'JgDKAIqPEzMTEBQyExASERIREhESNBMzEhESNBIRExASNBMQEhESERMzEjQSNRE0EjMTNBIREjQTMxMzEzMSNBI0EzMTMxI0EjQTMxMzEzMTMxMzEzMTEBQyExESMxQyFA8TNBMyE6mQjhIREzMSERI0EzMVMRI0FA8SEhIzEhETMxMzExASNBMzEzMTEBMQExATEBMQEhESNBMQExASEhESERESERIRExATEBMRERIRERMQEhESERMQEzMREhI0ExAVDhI0EhISEBMADQUAAAAAAAAAAAAAAAAAAA=='
        command_off: 'JgDKAIqPEzMTEBQyExASERIREhESNBMzEhESNBIRExASNBMQEhESERMzEjQSNRE0EjMTNBIREjQTMxMzEzMSNBI0EzMTMxI0EjQTMxMzEzMTMxMzEzMTEBQyExESMxQyFA8TNBMyE6mQjhIREzMSERI0EzMVMRI0FA8SEhIzEhETMxMzExASNBMzEzMTEBMQExATEBMQEhESNBMQExASEhESERESERIRExATEBMRERIRERMQEhESERMQEzMREhI0ExAVDhI0EhISEBMADQUAAAAAAAAAAAAAAAAAAA=='
      ac_fan_low:
        friendly_name: "AC Fan Low"
        command_on: 'JgDKAIqPEjMUDxQzEhAUDxQPFA8UMhQyExATEBQQEzMSMxQPExAUDxMzFDIUMhQyFDIUMhQQEjMTMxMzEzMUMhMzFDIUMxMyFDMTMhQzEzMTMhQzEzMSERMzEzMTMxMQEhETMxMzE6iRjRMQEzMTEBI0EzMTMxI0EhETEBI0EjQSNBMQExASNBMzEzMTEBIRExATEBMQEhETMxMQEhETEBIRExASERMQExATEBIREhETEBIRExASERMQEzMSERMQExATMxI0ExATEBMADQUAAAAAAAAAAAAAAAAAAA=='
        command_off: 'JgDKAIqPEjMUDxQzEhAUDxQPFA8UMhQyExATEBQQEzMSMxQPExAUDxMzFDIUMhQyFDIUMhQQEjMTMxMzEzMUMhMzFDIUMxMyFDMTMhQzEzMTMhQzEzMSERMzEzMTMxMQEhETMxMzE6iRjRMQEzMTEBI0EzMTMxI0EhETEBI0EjQSNBMQExASNBMzEzMTEBIRExATEBMQEhETMxMQEhETEBIRExASERMQExATEBIREhETEBIRExASERMQEzMSERMQExATMxI0ExATEBMADQUAAAAAAAAAAAAAAAAAAA=='
      ac_fan_med:
        friendly_name: "AC Fan Med"
        command_on: 'JgDKAIqPEzMSERMzEhESERMQExASNBI0ExESERE0ExATMxMRERESERMzEjQTMxI0EjQSNBIREzMSNBMzEjQTMxMzEjQSNBMzEzMSNBMzEjQTMxMzFDITERIzEzMSERI0ExASNBI0EqmQjhMQEjQSERMzEjQTMxMzExATERIzEzMTEBMzExATMxMzEzMUDxMQFBATDxMQFA8TMxMQExATERIQExETEBIQExATERIQExESERQPExATEBIREzMTEBIREjQTEBMzEhESERIADQUAAAAAAAAAAAAAAAAAAA=='
        command_off: 'JgDKAIqPEzMSERMzEhESERMQExASNBI0ExESERE0ExATMxMRERESERMzEjQTMxI0EjQSNBIREzMSNBMzEjQTMxMzEjQSNBMzEzMSNBMzEjQTMxMzFDITERIzEzMSERI0ExASNBI0EqmQjhMQEjQSERMzEjQTMxMzExATERIzEzMTEBMzExATMxMzEzMUDxMQFBATDxMQFA8TMxMQExATERIQExETEBIQExATERIQExESERQPExATEBIREzMTEBIREjQTEBMzEhESERIADQUAAAAAAAAAAAAAAAAAAA=='
      ac_fan_high:
        friendly_name: "AC Fan High"
        command_on: 'JgDKAIyNEzMTEBI0FA8SERMQExERNBQyExATEBMzEzMUMhMQExESERE0FDITMxMzFDIUMhQQETUTMxMyFDMSNBMzEzMSNBI0EzMSNBI0EzMTMxI0EzMTEBMzEzMSERIREhESNBI0EqmRjRIREzMSERI0EzMTMxMzEhESERI0EzMTERESERIRNBMzEjQTERERExAREhISEhESMxMRERESERMREhATEBMQEhETEBMQExESEBQQEhESERIQEzMUEBEREzMUMhM0EhESERIADQUAAAAAAAAAAAAAAAAAAA=='
        command_off: 'JgDKAIyNEzMTEBI0FA8SERMQExERNBQyExATEBMzEzMUMhMQExESERE0FDITMxMzFDIUMhQQETUTMxMyFDMSNBMzEzMSNBI0EzMSNBI0EzMTMxI0EzMTEBMzEzMSERIREhESNBI0EqmRjRIREzMSERI0EzMTMxMzEhESERI0EzMTERESERIRNBMzEjQTERERExAREhISEhESMxMRERESERMREhATEBMQEhETEBMQExESEBQQEhESERIQEzMUEBEREzMUMhM0EhESERIADQUAAAAAAAAAAAAAAAAAAA=='

That’s it, you’re done. Go ahead and restart home assistant and admire your work. If you want a pretty UI like mine, you can download the following custom Lovelace cards.

Lovelace Simple Thermostat Custom Card

Lovelace Vertical Stack in Card (Custom)

Once you have this, you can use the following code in Lovelace to make your card.

cards:
  - entity: climate.bedroom_ac
    sensors:
      - entity: sensor.bedroom_humidity
        name: Humidity
    step_size: 1
    type: 'custom:simple-thermostat'
  - cards:
      - entity: switch.ac_fan_auto
        hold_action:
          action: toggle
        icon: 'mdi:angle-acute'
        name: Fan Auto
        show_icon: false
        show_name: true
        state_color: false
        tap_action:
          action: toggle
        type: button
      - entity: switch.ac_fan_low
        hold_action:
          action: more-info
        icon: 'mdi:air-filter'
        name: Fan Low
        show_icon: false
        show_name: true
        state_color: false
        tap_action:
          action: toggle
        type: button
      - entity: switch.ac_fan_med
        hold_action:
          action: more-info
        icon: 'mdi:led-on'
        name: Fan Medium
        show_icon: false
        show_name: true
        state_color: false
        tap_action:
          action: toggle
        type: button
      - entity: switch.ac_fan_high
        hold_action:
          action: more-info
        icon: 'mdi:car-turbocharger'
        name: Fan High
        show_icon: false
        show_name: true
        state_color: false
        tap_action:
          action: toggle
        type: button
      - entity: switch.furnace_blower
        hold_action:
          action: none
        icon: 'mdi:fan'
        name: Blower
        state:
          - spin: true
            value: 'on'
        state_color: true
        tap_action:
          action: toggle
        type: 'custom:button-card'
    type: horizontal-stack
  - cards:
      - entity: switch.ac_direct
        hold_action:
          action: toggle
        icon: 'mdi:angle-acute'
        name: Direction
        show_icon: true
        show_name: true
        state_color: false
        tap_action:
          action: toggle
        type: button
      - entity: switch.ac_swing
        hold_action:
          action: more-info
        icon: 'mdi:air-filter'
        name: Swing
        show_icon: true
        show_name: true
        state_color: false
        tap_action:
          action: toggle
        type: button
      - entity: switch.ac_display
        hold_action:
          action: more-info
        icon: 'mdi:led-on'
        name: Display
        show_icon: true
        show_name: true
        state_color: false
        tap_action:
          action: toggle
        type: button
      - entity: switch.ac_turbo
        hold_action:
          action: more-info
        icon: 'mdi:car-turbocharger'
        name: Turbo
        show_icon: true
        show_name: true
        state_color: false
        tap_action:
          action: toggle
        type: button
      - entity: switch.ac_sleep
        hold_action:
          action: more-info
        icon: 'mdi:sleep'
        name: Sleep
        show_icon: true
        show_name: true
        state_color: false
        tap_action:
          action: toggle
        type: button
    type: horizontal-stack
type: 'custom:vertical-stack-in-card'

Notes and Caveats:

  • The dry function is not yet added into my list.
  • I did a bad job of fan control, and I think it is perhaps changing the temperature as well. It works how I would expect about half of the time.

One Comment

  1. Didi767 Didi767

    You’re a king!

Leave a Reply

Your email address will not be published. Required fields are marked *