home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.34k stars 29.88k forks source link

No ‘AirPlay’ Input For LG C1 #107041

Open iSteve-O opened 8 months ago

iSteve-O commented 8 months ago

The problem

There is no AirPlay source/input for the LG C1 webOS TV in HA, but the native/HomeKit integration does have it.

I would like to trigger an automation when source changes to AirPlay but I am unable to because the integration does not detect it as a source.

What version of Home Assistant Core has the issue?

core-2023.12.4

What was the last working version of Home Assistant Core?

?

What type of installation are you running?

Home Assistant Container

Integration causing the issue

LG webOS Smart TV

Link to integration documentation on our website

https://www.home-assistant.io/integrations/webostv

Diagnostics information

config_entry-webostv-88fb192de2bfff13078878817cea0b7f.json.txt.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

In the diagnostic data you can see the integration recognizes the current app as ‘AirPlay’ but it is not available as a source.

home-assistant[bot] commented 8 months ago

Hey there @thecode, mind taking a look at this issue as it has been labeled with an integration (webostv) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `webostv` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign webostv` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


webostv documentation webostv source (message by IssueLinks)

iSteve-O commented 8 months ago

I thought I may be able to work around this by using the native HomeKit implementation of the TV through HA. This worked to get the AirPlay source into HA, but for some reason HA is not able to turn the TV "on" using the HomeKit Controller integration.

I should also note that for some reason this LG webOS TV integration is not able to turn the TV "on" or "off"; maybe I should file another bug report about this?

All of my problems would be solved if this integration would recognize the AirPlay source properly. It seems like this should be a somewhat easy fix because you can see in the diagnostic data that HA does see "airplay" as the "current_app_id".

"Client" portion of diagnostic data:

    "client": {
      "is_registered": true,
      "is_connected": true,
      "current_app_id": "airplay",   // <<AirPlay source recognized
      "current_channel": null,
      "apps": {
        "com.comcast.app": {
          "systemApp": false,
          "removable": true,
          "relaunch": false,
          "mediumLargeIcon": "/media/cryptofs/apps/usr/palm/applications/com.comcast.app/88023827823900261_37471299_115x115_webos.png",
          "bgImages": [],
          "largeIcon": "**REDACTED**",
          "userData": "",
          "id": "com.comcast.app",
          "bgColor": "#1b1f2a",
          "title": "Xfinity Stream",
          "iconColor": "#6138f5",
          "appDescription": "",
          "lptype": "default",
          "params": {},
          "bgImage": "/media/cryptofs/apps/usr/palm/applications/com.comcast.app/88023827850601849_default_background.png",
          "unmovable": false,
          "extraLargeIcon": "/media/cryptofs/apps/usr/palm/applications/com.comcast.app/88023827848064755_37471299_192x192_webos.png",
          "icon": "**REDACTED**",
          "launchPointId": "com.comcast.app_default",
          "miniicon": "",
          "favicon": "",
          "installTime": 1661417554,
          "imageForRecents": "",
          "tileSize": "normal"
        },

I would be very happy to help in any way that I can... I do know a little tiny bit about this stuff.

thecode commented 7 months ago

Looking at your full diagnostics, it looks like while the TV shows the current app id as airplay the app doesn't appear in the full apps list. The list may be updated dynamically, You can try to configure Sources (select the sources to show) under the integration when the active app is airplay maybe it will show under the sources just to understand if the TV add this source later.

iSteve-O commented 7 months ago

Looking at your full diagnostics, it looks like while the TV shows the current app id as airplay the app doesn't appear in the full apps list. The list may be updated dynamically, You can try to configure Sources (select the sources to show) under the integration when the active app is airplay maybe it will show under the sources just to understand if the TV add this source later.

I tried that, and I also tried removing the integration and adding it again while airplay is the active source and no joy. There is a bug in the integration that doesn’t handle the airplay source appropriately. You are correct that the airplay source/app doesn’t appear in the full app list., and that’s the bug.

The integration needs an update to handle the airplay app/source appropriately.

thecode commented 7 months ago

There is a bug in the integration that doesn’t handle the airplay source appropriately. You are correct that the airplay source/app doesn’t appear in the full app list., and that’s the bug.

If the source doesn't appear in the app list I can't do anything, the list you see in the diagnostics is the response from the TV.

iSteve-O commented 7 months ago

There is a bug in the integration that doesn’t handle the airplay source appropriately. You are correct that the airplay source/app doesn’t appear in the full app list., and that’s the bug.

If the source doesn't appear in the app list I can't do anything, the list you see in the diagnostics is the response from the TV.

That’s a bummer, but I appreciate you looking into it.

I have a workaround established currently, via an app button through the Homebridge WebOS-tv plugin, although I was hoping to move away from HB. I thought since this HB plugin can see it, home assistant could be made to also.

I wonder if I could make a template sensor and grab it that way, since the app ID is reported properly to HA in the states tab (just not in the app list)… I’ll have to try this out.

I just thought that since home assistant can see the airplay app ID at some level, it could be made to report it as an input somehow.

Thanks again for your reply!

thecode commented 7 months ago

I have a workaround established currently, via an app button through the Homebridge WebOS-tv plugin, although I was hoping to move away from HB. I thought since this HB plugin can see it, home assistant could be made to also.

If you have a link to the plugin I can try to take a look if there is some specific handling for this input there

iSteve-O commented 7 months ago

I have a workaround established currently, via an app button through the Homebridge WebOS-tv plugin, although I was hoping to move away from HB. I thought since this HB plugin can see it, home assistant could be made to also.

If you have a link to the plugin I can try to take a look if there is some specific handling for this input there

A template sensor won't work because even though reported in the log it is not in the states attributes.

I honestly don't know how this homebridge plugin works so well. It is rock solid and works better than anything else I have tried (including native homekit, which is 2nd best). I use it to turn the TV on because nothing else in HA can do both on & off and I would rather not automate it in the home app...

anyway, it's this one... https://github.com/merdok/homebridge-webos-tv

Thanks again!

MasterDevwi commented 4 months ago

I'm looking for a way to do this as well.

Would it be possible to expose the current_app_id as an attribute of the media_player? I don't need to be able to switch to a specific app ID (although that would be nice too), but if I can at least tell which app is running I'd be set. As @iSteve-O said the device diagnostics can see the current_app_id but it doesn't show up as an attribute.

issue-triage-workflows[bot] commented 1 month ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

MasterDevwi commented 1 month ago

This is still needed on 2024.7.