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)
Chuangmi.remote.v2 has raw protocol incompatible with python-miio library used in HA component, so it’s unusable for Pronto codes conversion.
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
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 know that it was long time ago but I’ll give it a try
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”.
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?
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)
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.
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.
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)
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.)
It’s important to use the pypi3 command and python3 command instead of the regular pypi and python commands.
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.
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.
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.
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.
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.
I am struggling with python, never used it before so my problems will persist for a while 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.