ADB Android TV

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
OedzesG
Posts: 106
Joined: Monday 11 March 2019 0:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

ADB Android TV

Post by OedzesG »

Hallo everyone..


for HomeAssistant there is a plugin available to get the status of Android TV.

Code: Select all

https://www.home-assistant.io/integrations/androidtv/
Is there a possibility to get this done in Domoticz?

I use an Nvidia Shield with multiple apps and would like to know the playback status, for example to dim the lamps.

Thx in advance.
skybehind
Posts: 30
Joined: Monday 04 April 2016 22:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ADB Android TV

Post by skybehind »

+1
OedzesG
Posts: 106
Joined: Monday 11 March 2019 0:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ADB Android TV

Post by OedzesG »

+1

Until someone has arranged it (if anyone wants to build it) there is a way to send the data to Domoticz by HA using a json call.
I still had a PI somewhere and decided to test with HA this weekend. The disadvantage is that HA has to run next to Domoticz, but it works until, of course, someone makes it suitable for Domoticz.

Here is an example of how you can set this up in HA.

configuration.yaml:

Code: Select all


media_player:
  - platform: androidtv
    host: 192.168.1.36
    name: "NVidia Shield"
    adb_server_ip: 127.0.0.1
    adb_server_port: 5037
    state_detection_rules:
      'com.plexapp.android':
        - 'paused':
            'media_session_state': 3  # this indentation is important!
            'wake_lock_size': 1       # this indentation is important!
      
rest_command:
  shield_playing:
    url: 'http://192.168.1.11:8080/json.htm?type=command&param=switchlight&idx=63&switchcmd=On'
  shield_pause:
    url: 'http://192.168.1.11:8080/json.htm?type=command&param=switchlight&idx=63&switchcmd=Off'
    

automations.yaml: (testing for Netflix)

Code: Select all


- id: '1584909354303'
  alias: 'Netflix playback: "playing" '
  description: 'Update Domoticz UV if Netflix is playing on Shield Android TV '
  trigger:
  - entity_id: media_player.nvidia_shield
    platform: state
    to: playing
  condition:
  - condition: template
    value_template: '{{ states.media_player.nvidia_shield.attributes.app_name == "Netflix"
      }}'
  action:
  - data: {}
    service: rest_command.shield_playing
- id: '1584909833684'
  alias: 'Netflix playback: "paused" '
  description: 'Update Domoticz UV if Netflix is paused on Shield Android TV '
  trigger:
  - entity_id: media_player.nvidia_shield
    platform: state
    to: paused
  condition:
  - condition: template
    value_template: '{{ states.media_player.nvidia_shield.attributes.app_name == "Netflix"
      }}'
  action:
  - data: {}
    service: rest_command.shield_pause

jelleeelco
Posts: 61
Joined: Wednesday 04 January 2017 15:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ADB Android TV

Post by jelleeelco »

Hi,

I'm currently trying to switch the lights on/off using the Harmony-Span server, that can read the buttons pressed in an activity and update domoticz. But, within Netflix one can play/pauze using a variety of buttons (play, pauze, stop, select) so it's nearly impossible to have it work perfectly (unless ppl in the household REMEMBER that only play/pauze button will actuall trigger the ligths).

It would be great if one can read the status of the Shield directly, just as with the Kodi plugin where it reads Video / Pauze. I guess doing this via HA works for now, I just had one question if you don't mind.

Does this work for ALL the apps on the Shield, independend of what app? So i.e. Netflix, Disney, Amazon, Kodi?

Many thanks in advance,
Cheers
Jelle
lwolf
Posts: 216
Joined: Saturday 10 November 2018 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hungary
Contact:

Re: ADB Android TV

Post by lwolf »

OedzesG wrote: Monday 23 March 2020 20:15 Until someone has arranged it (if anyone wants to build it) there is a way to send the data to Domoticz by HA using a json call.
I still had a PI somewhere and decided to test with HA this weekend. The disadvantage is that HA has to run next to Domoticz, but it works until, of course, someone makes it suitable for Domoticz.
Basic AndroidTV python plugin:
https://github.com/enesbcs/domo-androidtv
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest