Xiaomi Chuangmi_ir (Universal IR Remote Controller)

If you are not afraid of reverse engineering, you could start by taking a command you know both input and output and start solving the puzzle piece by piece :slight_smile: The more commands (inputs & outputs) you know, you will probably start noticing patterns in them which will help you further.

Hi,
Is there a way to get host and token without rooting the phone?
Thanks
Marcin

See https://github.com/rytilahti/python-miio#finding-the-token for instructions :slight_smile: edit: actually https://github.com/jghaanstra/com.xiaomi-miio/blob/master/docs/obtain_token_mirobot_new.md for direct instructions.

1 Like

IR Sensor works great, thank you.

One thing:
I have a Robot, which I control with the IR Remote.
Setup works fine and the commands work, but the switches are internally called switch.chuang_mi_ir_switch, switch.chuang_mi_ir_switch_2, switch.chuang_mi_ir_switch_3 and so on.
And each time I restart HA, each switch is bound to a different command/switch than before.

e.g.: switch_1 => clean; switch_2 => home
Restart RPI
switch_1 => home; switch_2 => clean

Code:

  - platform: chuangmi_ir
    name: "IR Remote"
    host: IP
    token: token
    switches:
      robot_clean:
        command_on: 'XXX'
        command_off: 'XXX'
      robot_home:
        command_on: 'YYY'
        command_off: 'YYY'

Any suggestions?
Thanks in advance.

This is a bug. We could/should use the keys (robot_clean, robot_home) of the list as suffix of the different switches.

Hi, I have an air conditioner MIDEA and I can’t capture the commands neither from the android application nor from this component. In the android application I can use a predefined MIDEA remote control but from HASS I do not know how to make it work. I think it has compound commands.Any idea?

Hi Everyone,
I am slighlty confused … I am using this IR for air purifier (daikin) and managed to capture 4 hex codes for commands I want to use, i.e. ON, OFF, AUTO mode, Night mode.
I thought it will be just a matter of configuring it as such:

 - platform: chuangmi_ir
   name: "hallremote"
   host: <hidden>
   token: <hidden>
   switches:
     airfilter:
       name: 'airfilter'
       command_on: 'Z6UHAbgBAAD4BAAAsAYAALsNAAC0dAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjEAAAABAAAAAAEAAQEAAQEBAQEAAQAAAQAAAAABAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEBAQAEAjEAAAABAAAAAAEAAQEAAQEBAQEAAQAAAQAAAAAAAAAAAQEBAQAAAAEBAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAA='
       command_off: 'Z6UHAbgBAAD4BAAAsAYAALsNAAC0dAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjEAAAABAAAAAAEAAQEAAQEBAQEAAQAAAQAAAAABAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEBAQAEAjEAAAABAAAAAAEAAQEAAQEBAQEAAQAAAQAAAAAAAAAAAQEBAQAAAAEBAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAA='
       command_autofan: 'Z6UHAYgBAADcAQAA7wQAAKwGAADCDQAAo3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0IQEBASEBAQEBIQEhIQEhISEhIQEhAQEhAQEBASEhISEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBIQEBISEhAVE0IQEBASEBAQEBIQEhIQEhISEhIQEhAQEhAQEBAQEBAQEhISEhAQEBIQEhAQEBAQEBAQEBAQEBAQEhIQEBIQEBAQE='
       command_sleep: 'Z6UHAYYBAADdAQAA7AQAAKsGAAC/DQAAoXQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0IQEBASEBAQEBIQEhIQEhISEhIQEhAQEhAQEBASEhISEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBIQEBISEhAVE0IQEBASEBAQEBIQEhIQEhISEhIQEhAQEhAQEBAQEBAQEhISEhAQEBISEhIQEhAQEBAQEBAQEBAQEBAQEhASEBAQE='

But above setup does not result in possibility to set this air purifier into different switch states (only on and off work correctly, for the other two, I get the error in the log that the command is unknown). What am I missing here? I have a feeling there is a fixed list of commands that are acceptable and I cannot just create a new one, but on the other hand, why not? If I know the hash for the command that should not be a problem, but I guess it might not work that way

Thanks for help!
Marcin

I tried to address the switches by switch.robot_home and switch.robot_clean.
But this doesn’t work, the only way seams to be switch.chuang_mi_ir_switch.

I guess because the device is treated like a switch, you can only have two actions/states. Switch it on (command_on) or switch it off (command off).
But I could be wrong.

Also in my opinion a kind of button-like behavior would make more sense.
But I don’t think thats supported by HA.

you cant assign more than on and off buttons
a way to create more buttins is to create scripts for the buttons you need

example:
denon_vol_up:
sequence:
- service: chuangmi.send_packet_192_168_1_133
data:
packet: ‘Z6UrAaQBAADmBAAAiQYAACcNAACgIgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjAAAQABAAEAAAEAAAEBAAAAAAAAAQABAAEAAAAAAAEAAAAAAAAAAQABAAAAAQABAAQCMAABAAEAAQAAAQAAAQEAAAAAAAABAAEAAQAAAAAAAQAAAAAAAAABAAEAAAABAAEABAIwAAEAAQABAAABAAABAQAAAAAAAAEAAQABAAAAAAABAAAAAAAAAAEAAQAAAAEAAQAAA’

the create a group for the commands:

1 Like

Finally, I managed to set all up. Thank you @endallas and @teprrr for direct help and everyone else for indirect J

Thanks to everyone. I finally managed to set all up. @syssi @endallas

Hi guys,
Can someone point me from which repository can I get the python-miio>=0.3.0 ? I got lost in so many forks of the same stuff.

python-miio>=0.3.0 is unreleased and will be available here soon: https://github.com/rytilahti/python-miio

Just check my last commit a few seconds ago: https://github.com/syssi/chuangmi_ir

1 Like

Yes, I already removed the requirement locally and used the script from rytilahti. Managed just now to see each other but got some issue with config ( i believe token is wrong)

So I got it working, but I must say it was some pain in the …
Btw, in my case autodiscovery found the right token for the IR, so no need to play with backups.

wow! PITA but i got the token. is it possible to run this in hassio?

AWESOME!!! got my device today… token was pita as my phone is decrypted but found a way… if needed i will share… but anyway… works well :slight_smile: THANKS!!!

1 Like

@thundergreen considering you got it decrypted (with miio-extract-tokens or some other way?), could you help a fellow user in Xiaomi Mi Vacuum Token from iOS? ?

@teprrr It was a kind of PITA… u will have to install java addn zu be able to decrypt the file… i my case my phone was encrypted with a password. I could then decrypt it after addind java addons… just tell me where u r stuck mate :slight_smile: