Xiaomi Remote Learning & Sending Commands for AC

Did you fill in the correct IP and is your mi remote in the correct position. Meaning, can your components revive receive the IR commands?

Else if nothing else works you should activate logger mode to see the loggs

Yes I’ve tested the Mi Remote with the Mi Home App it works perfectly for my TV and AC.
And I can learn commands from remote so it’s connected to the HA.

Let me try and get some more logs.

I have turned on debug, but I dont get anything new in the log…

logger:
  default: warn
  logs:
    homeassistant.components.remote.mi_remote: debug

I also found a pronto hex code for a similar Mitsubishi AC, so i tried that --> same result …

off_test3:
  alias: off2
  sequence:
  - service: remote.send_command
    entity_id: 'remote.mi_remote' 
    data:
      command:
        - pronto:0000 006C 0000 006A 0000 004C 0000 001C 0000 001C 0000 001C 0000 001C 0000 004B 0000 001C 0000 001C 0000 004B 0000 004B 0000 004B 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 004B 0000 001C 0000 001C 0000 001C 0000 004B 0000 004B 0000 001C 0000 001C 0000 004B 0000 004B 0000 004B 0000 004B 0000 004B 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 0169 0000 004C 0000 001C 0000 001C 0000 001C 0000 001C 0000 004B 0000 001C 0000 001C 0000 004B 0000 004B 0000 004B 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 004B 0000 001C 0000 001C 0000 001C 0000 004B 0000 004B 0000 001C 0000 001C 0000 004B 0000 004B 0000 004B 0000 004B 0000 004B 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 0192

As I know mi remote new version has no way to get multiple ir code, AC should have “state + execute”, but It sends state or execute only.

I wonder who has this solution. : ) Perhaps he will be a Hero… !

So I use Harmony or ESPHOME IR node, when I use Air conditioner.

@minsuke thanks for your input. What about my LG TV I’m getting same results as my Mitsubishi AC. I guess maybe it’s easier to get a Broadlink mini?

I think you got Xiaomi Remote 2nd Edition, so I recommend you use raw, I set up from Home Assistant Integration Manual

I wish you succeed this setup

Thanks @minsuke that’s the guide I have followed with no luck :frowning:

should be “command”, not “comand”.

edit: my reply was to the error “failed to call service remote/send_command. required key not provided @ data[‘comand’]”

Hello @clyra, @minsuke let me summaries;

I am trying to connect my Mitsubishi AC (and LG TV but not main focus). I have used the integration @minsuke listed above (and advise here) to try and complete this setup;

remote.xiaomi_miio_learn_command
This command was used inside HA ‘Developer Tools’ > 'Services to learn the raw codes below.
Note: pronto hex codes were found online for a closely matching AC model for triail only.

configuration.yaml

logger:
  default: warn
  logs:
    homeassistant.components.remote.mi_remote: debug

# XIAOMI MI REMOTE v2:
remote:
  - platform: xiaomi_miio
    name: mi_remote
    host: 192.168.x.xxx
    token: <token>
    commands:
      ac_turn_off:
        command: 
          - raw:mc0mMwlkxm0ymEsmk2AIKZAGkARkzm4A/gQeAx4IXgM+Bl4GXgM+Az4EPgMeAx4DHgD+AP4A/gDpOQBymgC/gD+AP4A/gD+AP4A/gD+Gx4EHgD+Bx4HHgD+AOUAA
      tv_turn_off:
        command: 
          - raw:nMwm8wlk0mkzmEsm0ymEsmswAHaYgDrMZsAQwDEAD+APwGEAc+Az4BHgaeAP4EHhUcAPAFHgEeBF4BHgEbMIAA==

script.yaml

ac_turn_off:
  alias: Turn off AC
  sequence:
  - service: remote.send_command
    entity_id: 'remote.mi_remote' 
    data:
      command:
        - 'ac_turn_off'
        
tv_turn_off:
  alias: Turn off AC
  sequence:
  - service: remote.send_command
    entity_id: 'remote.mi_remote' 
    data:
      command:
        - 'tv_turn_off'

off_test2:
  alias: Test remote 2
  sequence:
  - service: remote.send_command
    entity_id: 'remote.mi_remote' 
    data:
      command:
        - raw:mc0mMwlkxm0ymEsmk2AIKZAGkARkzm4A/gQeAx4IXgM+Bl4GXgM+Az4EPgMeAx4DHgD+AP4A/gDpOQBymgC/gD+AP4A/gD+AP4A/gD+Gx4EHgD+Bx4HHgD+AOUAA
        
off_test3:
  alias: Test Remote 3
  sequence:
  - service: remote.send_command
    entity_id: 'remote.mi_remote' 
    data:
      command:
        - pronto:0000 006C 0000 006A 0000 004C 0000 001C 0000 001C 0000 001C 0000 001C 0000 004B 0000 001C 0000 001C 0000 004B 0000 004B 0000 004B 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 004B 0000 001C 0000 001C 0000 001C 0000 004B 0000 004B 0000 001C 0000 001C 0000 004B 0000 004B 0000 004B 0000 004B 0000 004B 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 0169 0000 004C 0000 001C 0000 001C 0000 001C 0000 001C 0000 004B 0000 001C 0000 001C 0000 004B 0000 004B 0000 004B 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 004B 0000 001C 0000 001C 0000 001C 0000 004B 0000 004B 0000 001C 0000 001C 0000 004B 0000 004B 0000 004B 0000 004B 0000 004B 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 001C 0000 0192

entity-button error:: There is no error when i call scripts.

entity-button

entity: remote.mi_remote
hold_action:
  action: more-info
name: Turn Off AC
show_icon: true
show_name: true
tap_action:
  action: call-service
  service: remote.send_command
  data:
    command:
      - ac_turn_off
type: entity-button

entity-button error:

failed to call service remote/send_command. required key not provided @ data[‘command’]

hm… I may have made a wrong assumption. When you call the script directly (using developers tools) it works, but using the entity button not? If the later, maybe the entity button has a bug. I dont use to use entity button as I use hadashboard to build my remotes.

I have played around with it more.

TV works by calling the script.
AC does NOT work calling script. I am assuming this is a problem with the raw code, not sure how to resolve this…

After doing some more testing today, I have use the learn command while sending the instruction from the Mi Home App which correctly activated the AC unit as well as receiving the command inside HA.

My assumption is the AC unit takes multiple commands for example when on turning on the following is set;
Turn On / Temperature = 20deg / Auto = On / Mode = Heating.

My assumption is that “/” splits those commands? (I could be wrong, I havn’t researched it yet).

example learnings

mc0nMwlkxm04mEsAISZTQAjpmAyc2ADKZAH1MwIDAMIBjwGMmMyAROagBlMQU7AUOYADqBkgDFzGZAXGCIU0CG8I/wdoAYgFRACzBtwBhwhqCocGNwD4AjMA9wpXA3oGDwR/BH8EfwR8EW8BjwYPFh8XrwKPB58YDwQGCS+YzCAA

mc1mMwlkxm04mEsmgAZTGZTUAgpyAQc0AIWZgMnMwAyAPsCmAGPAYuYzIBUppNgAymQKfgVGAx4BEgOnMAj/CP8HZwGPAY8BjwqJBjcA9AqjAPMG4xECCl8EfwR/BHgA9wR/BH8KjwGPBg8GCxFEC1gCjw0aBZUHpwNCmMym4GPiB/MIAA==

I did try splitting them into individual commands no luck, maybe this is an integration limitation?

Good that your TV is now working. I don’t know how to fix the AC unit, but for the entity button why not call the script instead?

@Infineghost yes thanks finally got something working. Since the primary reason was for AC control I am thinking only solution is to go Logitech harmony hub.

Agree the script can be called from entity-button.

Just wish I could get the AC control working.

I’ve read something only about your AC in the following link Reverse engineering the Mitsubishi AC Infrared protocol.

Maybe you can do something with that, seems that the complete settings got send with every command.

Yes you are correct, I did see this project a while back but didn’t have enough time to decipher how to convert this into a raw code…

Unfortunately this was one of the last pieces to do before by wife gives birth and I have just ran out of time to keep working on this. I’ve conceded and bought a Harmony Hub.

Negative Point:

  • Cost AUD$120
  • I have to learn alot of commands, as Logitech don’t have this stored. (as you mentioned every instruction sends all instructions to the AC)

Positive Point:

  • HA configuration is super easy and all commands are imported.
  • I will make scripts to easily call each instruction.
  • Tested and it’s working!!!

I may come back to this later post baby. I appreciate help from @Infineghost @clyra @minsuke.

1 Like

My projector have same crazy ir encode. I try capture raw and I receive different codes for the same button (tv remote works fine). I find pronto code but not work. Can you help me?

commands:
  projector_turn_off:
    command:
      - pronto:0000 006d 0010 0011 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 003c 0014 003c 0014 0014 0014 0014 0014 003c 0014 003c 0014 003c 0014 0014 0014 0014 0014 003c 0014 003c 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 0014 02e6:3

I have the same problem. Did you solve it?

No, but i have idea throught xiaomi home app works good, i bought another Xiaomi IR blaster (waiting for transport) and i will try transmit code from one ir blaster from Mi home app to another connected to Home Assistant. Maybe also it will works with universal IR remote.