Manage Xiaomi MITV emulating the remote control as it is an android bluetooth device

Good day all,
On the proxy option I found in github this project using an esp32 to mimic a xiaomi remote.

I’ve tested it myself and with the tv on it does indeed control it. However, with the tv off the power button is unable to turn the tv on.

I’m adding an issue to the repo in the hope the developer may take a look at this.

Moreover, if anyone here has the knowledge and could support this package it would finally make a decent solution.

Hi,
I think you have closed issue on github so I hope you have a solution?
Can you share it.
I use this repo and cannot turn the Mi Box on once it is switched off.

No
I didn’t find a solution.

OK. Lets see if there will be any solution for the issue I have made on github.
Ina meantime I found workaround which is opening Mi Box feature to accept HDMI commands and that way my amplituner is able to turn the Box on if needed. Works fine.
This also made me thinking to consider HDMI integration from Home Assistant to control devices like this one (I also have relatively old TV which cannot be turned on by it’s integration but works with HDMI)

Just wondering (and maybe tackling the problem of “not being able to switch on the device once it’s switch off / gone into deep sleep” from a different angle):

Does anyone know if it’s possible to prevent the Xiaomi from going into deep sleep in the first place? It’s running standard Android TV and the developer mode is available. This would also solve the problem of the comparably long boot times…

On a sidenote:

I keep getting the same error. Have you found a solution in the meantime?

@luyzfernando, quick question on your proposal (I’m not using Home Assistant so I try to leverage your findings and the ones from @quartstudio but ultimately go a different route): Shouldn’t the Xiaomi-device wake up if I apply the bluetoothctl pair XX:XX:XX:XX:XX:XX command as a test? From what I read, the projector wakes up in case of a pairing attempt (not: a connecting-attempt), which is what bluetoothctl pair XX:XX:XX:XX:XX:XX does? However, the projector does’t react to that, and the error message Device XX:XX:XX:XX:XX:XX not available comes up (even if I switch on the projector.

I tried that too, and guess what, now I can´t turn the tv off, by any means, as soon I sgut it down it comes up again and again.

I am very dissapointed with my TV set, a Xiaomi P1e 65", another bug I found is that when you change from one chennel to another one it shows the infoi “of the previous channel”, but this is another´s place thread.

Yes it is. I have xiaomi and works like a charm here.
For all of you guys try zank remote from play store and use static ip for tv

Thank you! I had two super annoying issues:

  1. My office TV required a remote to turn on, but adding an IR blaster solved that.
  2. I always needed a remote to wake up my MiBox, but your script fixed it.

Now, I just press a button on my StreamDeck, and boom — TV turns on, MiBox wakes up, SmartTube launches, and it starts playing. So smooth now! Appreciate the help!

I solved the problem.
You should check out this repo: