Nerwyn / android-tv-card

A completely customizable universal remote card for Home Assistant. Supports multiple platforms out of the box.
Apache License 2.0
254 stars 13 forks source link

"TV source" command not working with Philips Android TV #47

Closed LaUr3nTiU closed 11 months ago

LaUr3nTiU commented 11 months ago

I am a able to run Example 1 from Examples and Alternate Media Platforms, and all buttons except for the TV button work just fine.

Separately, I am trying to run:

service: remote.send_command
data:
  command: TV
target:
  entity_id: remote.tv_living

And this doesn't do anything. If I try HOME, POWER or any other commands, they all work. What could go wrong and how can I debug this further?

By not working I mean that if I am in Netflix or in Home or in any other app/source, it doesn't switch to cable TV. On the other hand, if I am in TV mode, I can switch channels (prev/next or a straight number).

Nerwyn commented 11 months ago

The TV command is taken from this list, which is the from the underlying Python library that the Android TV remote integration uses. If it doesn't work, it's probably a problem with how your Android TV processes that key.

LaUr3nTiU commented 11 months ago

Alright, I understand. Do you have any pointers on what might help me resolve this issue? Or do you know if there's a way to list the acceptable commands in the TV itself? I'm curios if that command (TV) is handled by a different keyword?

LaUr3nTiU commented 11 months ago

I was able to find an edge case where TV works. If I run a basic command (like VOLUME_MUTE) followed by TV, it's able to switch to TV. I'm adding this comment here as others might face a similar issue.

Nerwyn commented 11 months ago

I don't think there's a way to list commands that actually work. If you call the command using the service dev tool like so it'll throw an error if it isn't a valid command. Valid Android TV commands sometimes do nothing though.

service: remote.send_command
target:
  entity_id: remote.lounge_google_tv
data:
  command: TV

It's really weird that it works only if another command is sent first. Sounds like a bug in the integration or underlying package (or Android TV itself). Try sending TV with the service dev tool and see if it makes a difference. If not ask about it on the Home Assistant community forums.