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.
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.
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:
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/
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/
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.
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.