Xiaomi Mi Box 4s is no longer displayed

Hello, until recently my “Xiaomi Mi Box 4S” was pulled into my HA as a media player, but now it is no longer displayed. I do not know why. I have not changed any settings. HA runs on my RPi in version 0.105.1 The “Mi Box” keeps getting new updates, but I suspect that this is not the cause of my problem. I have integrated the “Mi Box” via the ADB addon, there is also no error message in the logs
a

… this is entered in my .yaml file …

media_player:
  - platform: androidtv 
    name: Xiaomi Mi Box
    host: 192.168.178.116
    adbkey: "/config/android/adbkey"
    adb_server_ip: 192.168.178.63
    adb_server_port: 5037

The integrated Chromacast of the “Mi Box” is displayed in HA. Android 9 is installed on the “Mi Box”. Can someone give me a tip or help? I would be grateful for that.
greetings

1 Like

Did you get a solution for this? even I am facing the same issue :neutral_face: I am on mi box s

The main reason they disappear is because the Box is off or was off when HA booted. The box needs to be on all the time in order to work and getting a mibox to do that is a real challenge. I have CEC switch off so nothing else can close it down, the wavelock app installed to try and force the box to stay awake, but it still goes offline occasionally. There is no WOL capability on the Mi Box 4s.

Ok, I get you and my problem is different and can u you help with this if you know?
I cannot connect my MI box s to home assistant through ADB addon. I tried everything and can’t figure out whats the problem is and pinged you here
I am running my HA in raspberry pie 4(hassos) and my mi box is the latest version running android 9.
My addon says it connected but in HA logs its says

 [Android TV(192.168.1.26):8009] Heartbeat timeout, resetting connection
Logger: pychromecast.socket_client
Source: /usr/local/lib/python3.8/site-packages/pychromecast/socket_client.py:645

Hello @venkattetali I have set the “adb_server_port: 5555” in the ADB add-on and in the “configuration.yaml”. In your case, is it maybe 8009?

@VolkerKa thank you for replay as you said i tried with port:5555 and 8009 also but no luck. In add-on, it says connected but in home assistant logs it says cannot connect.

Addon logs

[10:49:45] INFO: Starting the Android Debug Bridge server...
[10:49:46] INFO: Connecting to device: 192.168.1.26...
unable to connect to 192.168.1.26:5555: Connection timed out
[10:51:26] INFO: Connecting to device: 192.168.1.26...
connected to 192.168.1.26:5555
[10:52:57] INFO: Connecting to device: 192.168.1.26...
already connected to 192.168.1.26:5555
[10:54:28] INFO: Connecting to device: 192.168.1.26...
already connected to 192.168.1.26:5555
[10:55:58] INFO: Connecting to device: 192.168.1.26...
already connected to 192.168.1.26:5555

Home assistant logs

Logger: homeassistant.components.androidtv.media_player
Source: components/androidtv/media_player.py:227
Integration: androidtv (documentation, issues)
First occurred: 10:50:32 AM (2 occurrences)
Last logged: 10:51:02 AM

Could not connect to Mi box at 192.168.1.26:5555 using ADB server at 127.0.0.1:5555

Ahh OK my misunderstanding. I have no ide why but when I first setup adb just couldn’t get it to work. was confident I’d followed all the steps and all looked good but just wasn’t seeing anything. I uninstalled the addon, rebooted the host, re-installed and it worked.

the adb config is just:

devices:

  • 192.168.1.89
    reconnect_timeout: 90

using port 5037

and this is the relevant section of configuration.yaml

media_player:

  • platform: androidtv
    host: 192.168.1.89
    name: TV
    adb_server_ip: 127.0.0.1
    adb_server_port: 5037

This works as long as the Mibox behaves and stays on.

@tachikoma1373 I even tried addon uninstalling, reinstalling, router restart, Hass reboot, reset my MI box but no luck :pensive:
So I thought why not try with other android box! One of my friends have firestick so tried with that and it worked for the first time. After that, I tried with my MI box but same repeats it doesn’t show in Home assistant and now if I tried to connect back firestick even that is not connecting.

I don’t know how my problem will be solved :roll_eyes:

Maybe I should make a snapshot backup and reinstall a fresh Hass completely and try.

@venkattetali have you tried disabling developer mode on the mibox? Make sure you clear the cache if thats an option, then hard reset the device. then re-enable developer mode and do the set up again. maybe something is messed up at the mi end?

1 Like

@tachikoma1373 Ok got you. I will try that and get back to you :slight_smile:

@venkattetali When you go to developer mode, the USB settings, change it from “charging” to any other options, then everything works like magic.

1 Like

BRILLIANT! It worked!

What about Xiaomi TV - Home Assistant ?

Hi,

Changing the USB setting to something different from charging was not persisted when I entered the settings again and did not work for me with the MI Box S4.

Instead I just figured out that you need to enable “usb debugging” under the developer settings, and then accept when you short time after get a pop up to verify your setting.
Next time I restated Home assistant, it succeeded connecting to the MI Box by a media player defined using the androidtv platform.

Finally, i have been struggling with this for several weeks now :slight_smile:

1 Like

this was it, thanks man