Xiaomi Chuangmi_ir (Universal IR Remote Controller)

Hi,
Any luck on connecting to wifi without using app?
In the current version of the iOS app it is not supported anymore…

I tried the “miio discover” command while connecting to the remote directly (wifi), but can’t find a way to connect the IR remote to my wifi network.

Hi there. No. Unfortunately not. So far, I played a bit with the MiHomeApp. Next challenge will be the AC integration…

does ur device disconnected after, let say ,a few days?

my device keep dc after a few days, and need to be re-paired. it is so troublesome.

After some experiments:

  1. learn function (or hardware) is very unstable, producing raw codes data differently from time to time, and making impossible to learn some remotes (i.e. Sony RM-U305)
  2. Chuangmi.remote.v2 has raw protocol incompatible with python-miio library used in HA component, so it’s unusable for Pronto codes conversion.
  3. So, I made a small lib, producing raw config strings to deal with it. It converts Pronto HEX codes of any remote (can be found on remotecentral.com) to usable raw data, and works as a charm with three of my remotes. Feel free to use it: https://github.com/kuzin2006/miio_ir_raw_converter
1 Like

[Eugene_Kuzin]
How can i use this?

yeah I have the same issue - the device drops off the network completely.
Luckily I had an old sonoff lying around that I used as a power cycler once an hour.

I’m thinking this as well. Does the auto power cycle every hour fix the connection lost issue?

Yeah it does.
I found it would lose connectivity one or twice a day so hourly reboots completely removed the problem.

Hi @macinr,

I know that it was long time ago but I’ll give it a try :slight_smile:

I have a device which is controlled by remote control Daikin ARC458A4 from Daikin Air Purifier.
I’ve bought Xiaomi IR Controller (chuangmi.remote.v2) to control my device via Homebridge.
When I add remote for air purifier device (Daikin) in MiHome it works fine but I cannot make it to learn button codes from my remote - every time it is different and it is much shorter than it should be.

I was looking for existing codes on the internet and found yours. Once converted into V2 codes my Xiaomi controller can play them and control my device.

I am wondering if you still have those devices and can record few other buttons from your remote control so I can use them with my device? I am missing three buttons: “TURBO”, “FAN SET” and “ANTI-POLLEN”.

Thanks in advance!
Sergii

Trying to get this to work, I used @Eugene_Kuzin’s script to convert pronto code’s for my office air conditioner. The conversion went well, it spit out raw:xxxxx==:38381

Now, how do I get Home Assistant to play this command?

My configuration.yaml :

remote: 
  - platform: xiaomi_miio
    host: ipaddress
    token: xx
    slot: 3
    timeout: 30 
    commands: 
      officeair_power: 
        command: 
          - raw:mEsmM5nEwlkwlk3mU5AF8AVJjOZrNAEvASUAbQOfAy8CTwS/Af8GXwBvAu8AXwBfAF8AXwBfAF8AXwBdnM0mE1CXQUvw0vC28NfwIPAF8CTwGPAf8BnwBvAu8AXwBfAF8AXwBfAF8AXwBfCQOYTSbzMUzwBfC38ObwIPAF8EXwGPBE8BnwBvAu8E7wBfAF8AXwBfAF8AXwBfKY8Uvw0vC28NfwIPAF8EXwGPBE8BnwBvAu8AXwBfAF8AXwBfAF8AXwBfKYiAAA==
      officeair_power2: 
        command: 
          - raw:base64:mEsmM5nEwlkwlk3mU5AF8AVJjOZrNAEvASUAbQOfAy8CTwS/Af8GXwBvAu8AXwBfAF8AXwBfAF8AXwBdnM0mE1CXQUvw0vC28NfwIPAF8CTwGPAf8BnwBvAu8AXwBfAF8AXwBfAF8AXwBfCQOYTSbzMUzwBfC38ObwIPAF8EXwGPBE8BnwBvAu8E7wBfAF8AXwBfAF8AXwBfKY8Uvw0vC28NfwIPAF8EXwGPBE8BnwBvAu8AXwBfAF8AXwBfAF8AXwBfKYiAAA==

I call this by using Developer Tools -> Services :
Service = remote.send_command
entity = remote.xiaomi_miio_entity
service data =
command: officeair_power

And hitting the ‘call service’ button.

The second one (officeair_power2) fails in the HA log. The first one leaves no message but does not seem to work. I do think it’s being sent (tiny ‘off’ in the blue LED)

What am I screwing up?

I’m in desperate need of a solution. Just got myself one of these Xiaomi IR-devices but can’t figure out how to tell:

  1. Which model it is
  2. How to convert pronto hex code to the code my device accepts

The raw format looks like this when learning from a remote:

mc0m0wlkxm8zmEsmk0ADIAcwAymMzmABkgB

I’m not expecting anyone to help me but I’m desperate at this point. I tried to use the code @Eugene_Kuzin posted but I’m not that technical.

I’m getting this from my mac terminal:

File "miio_ir_pronto_encoder.py", line 22
    return f"raw:{base64.b64encode(heatshrink2.encode(times.encode())).decode()}:{freq}"
                                                                                       ^
SyntaxError: invalid syntax

When I inspect the file it says:

import base64
import heatshrink2
import miio

What does this mean? Am I missing some files?

Huge thanks to anyone who bothers helping me.

Hi! This is because of Python version you’re using to run the script, such formatting is legal for Python versions above 3.6. Try to open the console at type python -V, it will show you the version used by default, and that will probably be 2.7 by default (my Mac tells me so, at least). The simplest workaround for that is to try runnin it with python3 /path/to/the/script.py, hope it helps.

Got it to work :smiley:

Can you please describe how you got it to work. I have same issue, I got raw format when learning from remote like this:

mUznMwlk2mMwlkxmM4AIWagDnMgEPAQgAggEHAY8BjwB8mEA

and I have no idea what to do next because that code called from home assistant do nothing. I am using hassos on rpi3b+.

Thx in advance

Did to try to send the command via Developer tools>Services in HA?

Using remote.send_command and the following YAML:

entity_id: remote.xiaomi_miio_192_168_X_X
command: mUznMwlk2mMwlkxmM4AIWagDnMgEPAQgAggEHAY8BjwB8mEA

Does the blue LED on the Xiaomi blink when you send the command?

Hi. Thx for your answer. Yes, blue led blink once when I send command but nothing happens. I read in your post that you were using ‘miio_ir_pronto_encoder.py’ to convert codes.

Alright. What I did was:

  1. Install Python 3 (or 3.8 or whatever, just download the latest version. Just search for python on a popular search engine and download it from the official website)
  2. Then I installed the heatshrink2 library via pypi (a sort of repository included in Python 3) as well as miio. There are pretty nice descriptions of how to do this on the pypi or python website, can’t remember which one (a popular search engine is your friend in this situation.)
  3. It’s important to use the pypi3 command and python3 command instead of the regular pypi and python commands.
  4. After that just type cd in your terminal and the path to the folder of the .py file (which you download here). Actually I don’t know if this step necessary.
  5. What I did next was to open the .py file and copy the contents, then type python3 in the terminal on my Mac. It will show >>> arrows which means it’s now accepting python3 code.
  6. So just paste the code, hit enter and you’ll have the script loaded and ready. It shouldn’t give you any error codes or any response at all, just show the >>> again.
  7. After that you can get the pronto codes for your device from https://irdb.globalcache.com/Home/Database. It’s kind of messy solution where you get the codes sent to your email, but it works.
  8. Then, in your terminal window call the command from the script by entering pronto_convert(“enter your pronto code here”) and it should spit out a raw code for you. Which you hopefully can use in Home Assistant.

Thank you for your time. I will try to follow your steps. Is your Xiaomi ‘chuangmi_remote_v2’ or some other version?

Happy to help :slight_smile: I’m not sure which version I have. Though I’d appreciate if you could tell how I can find that out :slight_smile:

I am struggling with python, never used it before so my problems will persist for a while :slight_smile: I thought that I should somehowe transfer codes received in HA during ‘xiaomi_miio.remote_learn_command’ to different format and that is it.
To answer your question, to find that out you should open xiaomi app log file on your android device, same txt file where you find out your token. You used it to find out token didn’t you?
Regards.