core: WebOS TV doesn't report media playback status
The problem
The webostv integration isn’t currently able to display media playing state.
From the previous discussion at https://github.com/home-assistant/core/issues/67681#issuecomment-1059727183_ it looks like the problem was that no one knew how to query it.
The required webos endpoint is “com.webos.media/getForegroundAppInfo”, which you can request or subscribe to for updates, and the response looks like this:
{'subscribed': False, 'returnValue': True, 'foregroundAppInfo': [{'appId': 'com.webos.app.mediadiscovery', 'playState': 'paused', 'type': 'media', 'mediaId': '_xxxxxxx', 'windowId': '_Window_Id_3'}]}
What version of Home Assistant Core has the issue?
2023.4.5
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Core
Integration causing the issue
webostv
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 26 (8 by maintainers)
I set up a custom component repo for anyone who wants to test or just wants to use media player status. You should be able to just add it as a custom repo in HACS and install it, then add the LG TV integration.
https://github.com/rale/lgtv
You need at least
python 3.9
.First check out the code from the PR:
git clone https://github.com/rale/aiowebostv.git
Then you need to open the folder containing the code
cd aiowebostv/
In this folder create a file with the following code (let’s call the file
mediastate.py
):python3.9 mediastate.py
The TV should ask you whether you want to let the mobile device connect (mine did, at least, idk how it is with lower version numbers).
Then start playing something, pause it, stop it, and so on.
You should see new lines flying down your computer screen.
Copy let’s say 10 lines of that output and paste them in the PR I linked so they know what happens on lower versions.
But it reports just on / off state isnt it? It does not report playing…
For older (and maybe newer?) tv’s this might work as well: https://github.com/SLG/tv-service It’s a bit more work to set up and use, but when running, it works!