miio icon indicating copy to clipboard operation
miio copied to clipboard

New device MI IR REMOTE

Open DAVIZINH0 opened this issue 6 years ago • 6 comments

Hello, I have a xiaomi wifi device, the MI IR REMOTE https://www.youtube.com/watch?v=sEO9WA1cFQY

Device ID: 55301292 Model info: Unknown Address: 192.168.1.73 Token: "HEX VALUE" via auto-token Support: Unknown

i dont have knowledge of wireshark but i can learn! :-)

DAVIZINH0 avatar Sep 19 '17 20:09 DAVIZINH0

Thank you for this feature request! I'm interested in supporting this device, I have access to a device but not enough time right now to investigate the API it uses. If you can provide a Wireshark-dump or information about the calls I think we could work together to add support for the basics quite easily.

The documentation should help to get you started with creating a dump and testing the commands.

aholstenson avatar Nov 04 '17 17:11 aholstenson

Hello. In september i tried to obtain a wireshark dump but i can´t (im new with this). Can you tell me the basic steps

i did this:

  • install "nox" in my windows pc and mihome in the android emulator
  • install wireshark
  • start capturing packets in wireshark
  • push en mihome app in emulator a order to IR (in this case, power ON a lamp by IR)
  • stop capturing packets

and i not find any UDP trafic

i not an expert and my english is so poor but, you understand me? any idea. its a pleasure to me help you in with this device, but i need some help :-(

DAVIZINH0 avatar Nov 04 '17 19:11 DAVIZINH0

Sounds like you've done exactly the right thing, but it might be that device doesn't use the local API and instead sends things via the Xiaomis Cloud API.

The weird thing is that there should be some UDP traffic, the Mi Home app sends UDP traffic to look for devices on the network. Maybe the emulator you use can't reach your network somehow. I've used Bluestacks before on my Mac laptop when I did the initial work on the library. Is that available for you to use?

aholstenson avatar Nov 05 '17 09:11 aholstenson

hello again this morning i installed bluestacks and the same. Nothing in UDP :-(

DAVIZINH0 avatar Nov 05 '17 14:11 DAVIZINH0

hello again. My english is so poor and i dont understand so much of miio diferences. i found this: https://github.com/rytilahti/python-miio#id27 thant have a library that allow the IR. this is usable with you project?

and i find info of home assitant that maybe help: https://community.home-assistant.io/t/xiaomi-chuangmi-ir-universal-ir-remote-controller/25821/56

DAVIZINH0 avatar Dec 08 '17 20:12 DAVIZINH0

Let me share my working example: let ircontrol = await miio.device({address:"your.ip.address",token:"youtoken"}) let learnresult = await ircontrol.call('miIO.ir_learn',{'key':'1'}) await delay(10000)//wait for 10 seconds let coderesult = await ircontrol.call('miIO.ir_read',{'key':'1'}) let playresult = await ircontrol.call('miIO.ir_play',{'freq':38400,'code':coderesult.code})

lanma avatar Feb 09 '19 04:02 lanma