Get status from Android TV?

Hi,

I have a Mi Box, Android TV unit. I start this box with a Broadlink RM3 Mini which I send the IR signal from Home Assistant.
Is it possible to get the state from the Android TV unit. So if I start it with the remote Home Assistant will recognize this and show it as running, and I can then send an off signal?

How do I get the status from the Android TV? I have it on a static internal IP, can I ping it or something?

What is the best way?

Thank you!

does it show up as a Cast device? If so you should be able to configure Hass to control it via that.

ie:

media_player:
  - platform: cast
    name: Mi Box Android TV
    host: 192.168.1.xx

For the ping you can use a template sensor and device_tracker.

sensor:
  - platform: template
    sensors:
      androidtv_template:
        friendly_name: 'Android TV'
        value_template: "{{ 'on' if is_state('device_tracker.androidtv', 'home') else 'off' }}"
        icon_template: "{{ 'mdi:android' if is_state('device_tracker.androidtv', 'home') else 'mdi:close-circle' }}"

if its anything like my Sony Bravia TV, it will ping even when turned off as its in ‘standby’ mode.

Hi, would you help by sharing the Broadlink IR codes for Mi TV Box?
Thank you!

2 Likes

https://www.hiscorebob.lu/2018/07/xiaomi-mi-box-ir-codes/
For you

The Broadlink IR codes should work with Mi Box S?

I’m sorry to reopen this old thread.
Yesterday I tried to record the codes of my miboxS with a broadlink RM4Pro without luck. Are you sure it is IR to set up in HA? I thought the remote could be RF or even bluetooth :face_with_raised_eyebrow:
Thanks