Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standby for exactly 10 sec (couple of times per hour) [Nvidia Shield] #5

Open
Xitro01 opened this issue Sep 20, 2022 · 6 comments
Open

Comments

@Xitro01
Copy link

Xitro01 commented Sep 20, 2022

First of all: great integration! Finally solved the issue that it was not always showing the name of the app correctly.

I have another unresolved issue though, also occurs with the default integrations.
My Nvidia Shield shows as 'standby' while playing something. This happens a couple of times per hour and it shows 'standby' for exactly 10 seconds.

Knipsel

Do you have any idea what could cause this?

Thanks in advanced.

@Xitro01 Xitro01 changed the title Standby for 10 sec - Nvidia Shield Standby for exactly 10 sec (couple of times per hour) [Nvidia Shield] Sep 20, 2022
@cyberden
Copy link

I have the exact same issue but I haven't fixed it yet...

@Xitro01
Copy link
Author

Xitro01 commented Nov 14, 2022

I have a lot of idle's in between quite often as well, when I have this issue, the playback on my device also seems very slow.
Maybe it polls the device too much, more than it might be able to handle?

@cyberden
Copy link

cyberden commented Nov 14, 2022

I managed to improve these idle times using the guide of the Home Assistant Wiki using the ADB command "Properties" and changing the settings of the Android TV Integration for each app using the wake lock data and audio_state values.

It seems ok but it's a pain.

@Xitro01
Copy link
Author

Xitro01 commented Nov 14, 2022

Not sure if this fixes my problems, as I see my Shield struggle, until I restart the Shield. After the reset the video playback is working normal again and the states are detected normally again (besides the sudden standby's in between, but I just ignore these).

@spcano01
Copy link

@cyberden would you be so kind as to provide an example? What you changed, how, and why? I'm reading same page I think, but it's very generally written.

And I don't understand a lot of this in order to have the aha moment.

I did change line 99 in constants.py which solved the what's playing, but still rather limited. Luckily, we use Kodi/Jellyfin which I hope that integration will be easier.

@cyberden
Copy link

In the integration page of HASS you click "configure" on the Android TV Custom Integration.

image

You click on the "new rule" radio button and "submit" and then you enter the application Id for which you want to customize the states detection and you enter the "mapping" allowing to detect the overall state using the "audio_state", "wake_lock_size" and "media_session_state"

Here is en exemple that works for Disney+ on my shield (appId : com.disney.disneyplus) :
[{"standby": {"audio_state": "idle", "wake_lock_size": 1}}, {"standby": {"audio_state": "idle", "wake_lock_size": 2}}, {"playing": {"audio_state": "playing", "wake_lock_size": 3}}, {"paused": {"audio_state": "paused"}}]

To edit this, you can go to the services tab in developers tools section and call the adb command "GET_PROPERTIES" :

service: androidtv_custom.adb_command data: command: GET_PROPERTIES target: device_id: 887fbc1aa14e9ffe52caa1b592fa9169

Once called, you can get the response in the states tab in the json containing the properties for your device. You can find the values for each state.

The idea is to launch each app, call the GET_PROPERTIES command, see the states of the properties, adding these values in the mapping for the "standby" state for this app. Play a video, calling the GET_PROPERTIES etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants