Xiaomi Chuangmi_ir (Universal IR Remote Controller)

I think I see the difference. @hangy and @ec-blaster are using the component as switch(es). You are trying to use the send_packet service, right?

1 Like

Right, i’m using Developer Tools
Domain chuangmi
Service send_packet_IP
Service_data:
{“packet”:“command_captured”}
I was trying to make it work with developer tools but now i’ve tried to add this command to switch configuration and it works perfectly.

Thanks for all the help.

I made some changes. The service should work now. Please test the latest revision! :slight_smile:

1 Like

I cannot test it right now, but I remember that the packet must be an array of strings (may be just with one element). If you send the parameter as a string, the service interprets it as an array of chars and sends a lot of packets making the device collapse. Most of the times you have to reset or disconnect it to make it work again.

Mine works flawlesly as a switch. But I have an automatio based on a slider that aims to set the air conditioner temperature sending different IR codes for each temperature setting. It uses the component service, but it fails as I must provide the packet as an array of one string element, and I don’t have the expression set very well yet…

You are totally right. I removed the multiple packets support. It’s a single packet now and the input is validated. I also tried to handle everything with one “connection” instead of spin-up additional ones. Concurrency should be reduced now.

1 Like

i’ve updated your component and tryed the send_packet… perfectly works :wink:

Sorry if this is totally obvous but can I install this on Hassio? How?

I asked the same question a hassio user recently. This is the answer:

Just copied to custom_components under configuration directory, like it would be standard installation.

1 Like

I think I am pretty near to having this working, my only issue is that I didn’t have any learned commands. Is there a way of using an online IR database for the codes or generating the commands?

I don’t know how to convert command from the IR database to the needed base64 format of the controller. May be you are able to figure it out. I took one of the captured commands from the manual and tried this:

echo "Z6VLAAkCAABpAgAAYgYAAKYIAACJEQAAoSMAAKScAABYeQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFAQEBAQEBAQEhISEhISEhIQEBISEBAQEBISEBASEhISFhNXE1AQ==" | base64 -d | hexdump
0000000 a567 004b 0209 0000 0269 0000 0662 0000
0000010 08a6 0000 1189 0000 23a1 0000 9ca4 0000
0000020 7958 0001 0000 0000 0000 0000 0000 0000
0000030 0000 0000 0000 0000 0000 0000 0000 0000
0000040 0000 0000 0145 0101 0101 0101 2101 2121
0000050 2121 2121 0121 2101 0121 0101 2101 0121
0000060 2101 2121 6121 7135 0135               
000006a

Could you capture the command of a well known remote control also available in an online IR database? So we can compare both values.

if you want a can test same ir codes with the broadlink mini…

Cool. Some sample commands in different formats (xiaomi capture, broadlink mini capture, online database) would be nice for comparison. Hopefully they are all the same in different representations.

I seem to be running into some issues. Any advice would be greatly welcomed:

Error Log:

2017-09-18 13:15:36 ERROR (MainThread) [homeassistant.config] Invalid config for [switch.chuangmi_ir]: length of value must be at least 1 for dictionary value @ data[‘switches’][‘reciever’][‘command_off’]. Got ‘’
length of value must be at least 1 for dictionary value @ data[‘switches’][‘reciever’][‘command_on’]. Got ‘’. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.chuangmi_ir/

Config:

  - platform: chuangmi_ir
    name: "livingroomirremote"
    host: <REDACTED>
    token: <REDACTED>
    switches:
      reciever:
        command_on: ''
        command_off: ''
      wcfan:
        name: 'wcfan'
        command_on: 'Z6VLAAkCAABpAgAAYgYAAKYIAACJEQAAoSMAAKScAABYeQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFAQEBAQEBAQEhISEhISEhIQEBISEBAQEBISEBASEhISFhNXE1AQ=='
        command_off: 'Z6VHAPEBAACBAgAASQYAAIYIAABqEQAAySMAAECcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFAQEBAQEBAQEhISEhISEhIQEBASEhAQEBISEhAQEhISFhNQE='

Just remove the switch with the empty commands:

 - platform: chuangmi_ir
    name: "livingroomirremote"
    host: <REDACTED>
    token: <REDACTED>
    switches:
      wcfan:
        name: 'wcfan'
        command_on: 'Z6VLAAkCAABpAgAAYgYAAKYIAACJEQAAoSMAAKScAABYeQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFAQEBAQEBAQEhISEhISEhIQEBISEBAQEBISEBASEhISFhNXE1AQ=='
        command_off: 'Z6VHAPEBAACBAgAASQYAAIYIAABqEQAAySMAAECcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFAQEBAQEBAQEhISEhISEhIQEBASEhAQEBISEhAQEhISFhNQE='

Still giving me the same error…

If I do it with both wcfan removed:

2017-09-18 19:02:36 ERROR (MainThread) [homeassistant.config] Invalid config for [switch.chuangmi_ir]: expected a dictionary for dictionary value @ data['switches']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch.chuangmi_ir/

Okay, I will check it in detail tonight.

Doing a compare between original github and syssi’s modifications:

I saw following change:

-REQUIREMENTS = [‘python-miio==0.0.8’]
+REQUIREMENTS = [‘python-mirobo’]

Is that right? Is not mirobo component thought for Xiaomi Mi Robot?

This is right. python-mirobo implements the miio protocol. It’s just a bad name. We extended the component to support multiple miio xiaomi devices. python-miio is just a very old and buggy fork.

1 Like

Hey,

I have this all up and running now. Learning commands has been great and everything seems to be working.

I did have one question. For my yamaha rx-v550,I don’t have the original remote and have been using the Mi Home app to control the volume.

This gives me the issue that I can’t teach the ir blaster the code, but it must actually know the code.

I have also been looking through the com.xiaomi.smarthome data pulled from my phone (I thought that the codes may be stored somewhere in there), or there may be a log of all of the commands that are sent out from the IR blaster.

I have been hunting around and have been able to find the NEC IR Code (7A 1A). Used (http://www.hifi-remote.com/jp1/yamaha.html) to convert to IR Hex and then (http://tomeko.net/online_tools/hex_to_base64.php?lang=en1 to convert to Base64. But am getting no joy.

I am a little bit stuck now on what to try next to find the code required for this. Any tips out there?!