I’ve setup my Xiaomi IR device in the Xiaomi Home app and integrated it as a device into Home Assistant. However, I have no idea what I have to do next inorder to be able to send commands from the device. The integrations page talks about commands being learned or pronto values etc, but it’s not very clear as to how you get these commands.
I’d really appreciate some assistant as to how I can now start adding commands to my HA config and then get them sent via the IR device.
P.s. I have my remote setup in the Xiaomi Home app along with my TV and Soundbar.
I’ve tried that but i just get a notification at the bottom of the screen saying "Failed to call remote/learn_command
And this is what I’m getting in the logs:
2020-02-08 17:45:35 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.2366024624]
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
connection.context(msg),
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/core.py", line 1226, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/core.py", line 1251, in _execute_service
await handler.func(service_call)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_component.py", line 198, in handle_service
self._platforms.values(), func, call, required_features
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 356, in entity_service_call
future.result() # pop exception if have
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 384, in _handle_service_platform_call
result = await result
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/remote/__init__.py", line 134, in async_learn_command
await self.hass.async_add_executor_job(ft.partial(self.learn_command, **kwargs))
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/remote/__init__.py", line 130, in learn_command
raise NotImplementedError()
NotImplementedError
I did the setup exactly as mentioned. I do receive raw codes, I did make the commands but when I am trying to send them, the light of the Mi Remote blinks, it looks like the code is being sent but my IR devices do not respond.
Any tips? Also my received raw codes don’t look as long as yours.
IT works perfectly for me. I did notice that after calling the service that I needed to wait for the led to blink before holding down the key on the remote that I want to clone. Then just keep the key pressed until you get the notification bubble on the sidebar icon.
Be sure to include the entity_id of your miio remote device. This may not be the same as the name you gave it in config. Go to unused entities and search for miio, then you should see the actual entity_id of your miio remote.
unfortunately for me, i checked against the unused entities and it matched what i used in the automation yaml. i managed to capture the code from remote that i wanted to copy, just could not get it to transmit the copied IR (with magic error) and it didnt blink at all.
Is it possible for you to share your code for automation? and also the confi.yaml
edit: nvm. i managed to get it to work. somehow, when i learn the command, i need to only momentarily press the button to get the right code. Press a bit too long, the code learnt is different (longer code, with == at the end). The correct code doesnt have == at the back and shorter. This might be right only for my Panasonic Ceiling Fan, but that is the idea.
hello
i learn how send command to xiaomi ir.
But seems impossible to read a command for automation, for a trigger.
I’m wrong?
there is some solution?
Thanks