core: LG webOS TV stops working and need reload

This issue is relevant only if LG webOS TV integration was fully setup before 2025.2.0 and it was working most of the time, but from time to time it will stop working, any other problems, such as pairing, broken functionality, something that stopped working should be reported by creating a new issue.

The problem

I am opening this issue to collect new logs. At core 2025.2.0 LG webOS TV underlying library aiowebostv had major changes and cleanups, mainly switching to better websocket library.

It does not mean that the issues will be fixed for everyone, as I have never succeeded to create a communication problem with the TV, although during the refactoring I clean up places that looks suspicious to create a problem. There are still places that needs better error handling and they will be fixed when logs that shows a problem will be added to this issue.

With this I am merging https://github.com/home-assistant/core/issues/102821 and https://github.com/home-assistant/core/issues/74888 to one issue.

What to do if you have a problem:

  1. If possible make sure your TV is connected by wired connection and not connected to Wi-Fi (Wi-Fi can still be enabled as it needed for connecting via a mobile phone to the TV)
  2. While not mandatory, static IP can help reducing issues if the device IP changes.
  3. Download the diagnostics from the device card in Home Assistant and attach it in a comment, Make sure the TV is ON at least 20 seconds before gathering the diagnostics.
  4. Please enable Debug for LG webOS TV integration, try to reproduce the problem, if you need to reload the integration to fix the issue, reload it, afterwards disable debug and attach the log.
  5. Write down the time the connection issue occurred and when the TV was on, it is hard to know if from the logs as OFF is the same in the log as a TV that is disconnected due to a problem.

Note: it is better to drag the log into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub.

Thanks!

What version of Home Assistant Core has the issue?

core-2025.2.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

webostv

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet


Anything in the logs that might be useful for us?


Additional information

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 3
  • Comments: 37 (11 by maintainers)

Most upvoted comments

Hello, I have had this problem for a while now and did not find a solution. Last night I gave it another try, and I would like to share the (preliminary results)

The only thing I did different from previous tries over the past month, was disable/reset Apple Homekit configuration on the TV.

Home Dashboard > Airplay > Airplay and HomeKit settings

I removed (perhaps prior to resetting Apple HomKit) the WebOS TV integration from Home Assistant. It was for sure added to HA again after Apple HomeKit was reset on the TV. The integration generated the default device name with to include OLED55C9PLA, I did not see that before, it was always media_player.lg_webos_tv. Full entity id: media_player.lg_webos_tv_oled55c9pla

HA now also discovers a HomeKit Device (LG webOS TV B027 (Television)), which I ignored. I did not set up Apple HomeKit on the TV at all, neither in HA or in the Apple Home app

For one day it seems to work without issues.

Further info TV conneted to both WIFI and ETHERNET HA connects to the ETHERNET IP address HA 2025.3.0 HAOS 14.1

So I had to do it as my TV was already in stale situation with HA šŸ˜‰. Removing it and turning TV on make it discoverable through the HA UI. Automations seems to work…for now. We’ll see in the future. :]

I had the Stale state situation happen as well with one of my LG TVs which I’ve been wresting the connection issues with. Two others have been working pretty much fine.

Re-adding the TV took a try or two. Both times triggered the pairing notification. The TV was having network connectivity issues just prior which required a TV power cycle, so I am hoping that is just a fluke.

With that said, I’m keeping an eye on whether the new code changes are helping or not. If not, I’ll gather the logs being requested.

EDIT: My problem TV set had the issue happen again. What appears to be happening is the WebSocket connection to the TV is dropping after it has successfully fetched data from the Television, and attempts to re-connect to the TV are being met with a ā€œConnection Refusedā€ response from the TV. I am going to try factory resetting it (for the second time) to see if I get different behavior. Will share the logs soon. The TV responds on Port 3001 for WebSocket connections.

EDIT2: Might’ve actually found my problem! Found a strange MAC appearing on my switch for the same IP address for the TV. Looks like my problem is actually an IP Address Conflict, not an integration problem. Either way, the other two TVs are working great, so I will assume the code changes are good.

EDIT3: Just wanted to confirm, things seem to be 100% stable for me now. I have noticed the other two sets which weren’t subjected to the IP conflict are working reliably as well.

HA now also discovers a HomeKit Device (LG webOS TV B027 (Television)), which I ignored. I did not set up Apple HomeKit on the TV at all, neither in HA or in the Apple Home app

For one day it seems to work without issues.

It is possible that the TV blacklist HA IP if HomeKit that arrives from the same IP of HA is using a wrong token. I can cause my TV to block a specific IP (it is released after a while or when the TV is off) if I try too many requests with a wrong token. I assume it is a security function of the TV to prevent exploits

Further info TV conneted to both WIFI and ETHERNET HA connects to the ETHERNET IP address HA 2025.3.0 HAOS 14.1

See my first post, I don’t recommend connecting the TV to two interfaces and in general recommend of ethernet over Wi-Fi, but specifically having two connections is known to cause errors since the TV sometime switch the active connection between ethernet and Wi-Fi.

Please test the following: https://github.com/thecode/home-assistant-custom-components/tree/webostv-core2025.3

No problem so far, works flawlessly.

Please test the following: https://github.com/thecode/home-assistant-custom-components/tree/webostv-core2025.3

I would appreciate a log file for this one regardless if you have problems or not, after installing, just enable debug, wait for the TV to be show as ON, reload the integration, disable debug and attach the log. This version should not stay stuck (ā€œUpdating webostv media_player took longer than the scheduled update interval 0:00:10ā€) but it may still happen once if messages get lost, however it does have Live TV support so would be interesting to know how it works for you.

Thanks again for your support!

Here is the Log, I switched the TV 65 on and off 2 times with the new webos integration of 2025.3

home-assistant_webostv_2025-02-27T19-19-16.462Z.log

Today the TV was not recognised after turning on (roughly 14:25, but nothing in the logs)

025-02-25 221208.912 DEBUG.txt

@marce14-git thanks for the log, I think I fixed this problem in core 2025.3.0b0 (which was released today).

Please test the following: https://github.com/thecode/home-assistant-custom-components/tree/webostv-core2025.3

I would appreciate a log file for this one regardless if you have problems or not, after installing, just enable debug, wait for the TV to be show as ON, reload the integration, disable debug and attach the log. This version should not stay stuck (ā€œUpdating webostv media_player took longer than the scheduled update interval 0:00:10ā€) but it may still happen once if messages get lost, however it does have Live TV support so would be interesting to know how it works for you.

Bellow is the same version you are using now (no live tv) with the latest updated that are in the first one (core 2025.3), if the first one still makes problems switch to this one and report back. https://github.com/thecode/home-assistant-custom-components/tree/webostv-no-livetv

No, I don’t use live TV, I just need to get the state of the TV in order to trigger the power for my soundbar, and sometimes turn the tv off via Homeassistant or change the volume Iā€˜d love to try your solution PS: I have live tv channels (don’t know how many) but don’t use them, I just connected the coax cable and did a search for channels and left it at that Does this mean if I remove the live tv channels/unplug the coax, it should work 100% of the time ?

@marce14-git No, you don’t have to remove Live TV, you can even use Home Assistant to switch to Live TV, the only thing that will not work is switching channels or showing the channel state in Home Assistant. Home Assistant will just not be aware that the TV has channels.

Please install from the link bellow as a custom integration: https://github.com/thecode/home-assistant-custom-components/tree/webostv-no-livetv

This is the same integration as shipped in Home Assistant core 2025.2.5.

Downloaded the linked branch, add it under custom_components and restart HA, you don’t need to remove the existing devices or do anything, it will pick this up as a custom integration and you should see this in the integration page:

Image

To get back to core one, you simply remove the folder and restart HA.

Thanks

thank you very much, works like a charm! I“ll come back if I notice anything.

No, I don’t use live TV, I just need to get the state of the TV in order to trigger the power for my soundbar, and sometimes turn the tv off via Homeassistant or change the volume

Iā€˜d love to try your solution

PS: I have live tv channels (don’t know how many) but don’t use them, I just connected the coax cable and did a search for channels and left it at that Does this mean if I remove the live tv channels/unplug the coax, it should work 100% of the time ?

@marce14-git No, you don’t have to remove Live TV, you can even use Home Assistant to switch to Live TV, the only thing that will not work is switching channels or showing the channel state in Home Assistant. Home Assistant will just not be aware that the TV has channels.

Please install from the link bellow as a custom integration: https://github.com/thecode/home-assistant-custom-components/tree/webostv-no-livetv

This is the same integration as shipped in Home Assistant core 2025.2.5.

Downloaded the linked branch, add it under custom_components and restart HA, you don’t need to remove the existing devices or do anything, it will pick this up as a custom integration and you should see this in the integration page:

Image

To get back to core one, you simply remove the folder and restart HA.

Thanks

i finally caught a time when the TV was on while it was shown off in the WebOS integration:: PS: i think i did it a little wrong, i disabled debug and after that reloaded the integration, sorry, ill try to get it right the next time

Your log is ok, I noticed there a similar issue related to #137854

The last request to the TV at 18:08:52 did not receive a response so it stay stuck at the connect stage, I am already working on something that will make sure the connect stage will time out but it will not fix the underlying issue.

Do you use Live TV? Do you have live TV channels configured? If so how many channels?

I can prepare a release for you that will not request the TV anything related to Live TV, so it will not fail but will not show status of Live TV channels or allow selecting a channel from HA, if you want to give it a try let me know.

First of all thank you very much for this integration and your time!

No, I don’t use live TV, I just need to get the state of the TV in order to trigger the power for my soundbar, and sometimes turn the tv off via Homeassistant or change the volume

Iā€˜d love to try your solution

PS: I have live tv channels (don’t know how many) but don’t use them, I just connected the coax cable and did a search for channels and left it at that Does this mean if I remove the live tv channels/unplug the coax, it should work 100% of the time ?

So I had to do it as my TV was already in stale situation with HA šŸ˜‰. Removing it and turning TV on make it discoverable through the HA UI. Automations seems to work…for now. We’ll see in the future. :] The one thing that confuses me is the WoL for turning TV on. Docs says that the trigger should like this:

triggers:
      - trigger: webostv.turn_on
        entity_id: media_player.lg_webos_tv

But I have it set differently for some reason. Probably that was some old approach? Regardless, when trying the ā€œnew wayā€ VS Studio says that it’s a syntax error.

triggers:
  - trigger: device
    device_id: [TVID]
    domain: webostv
    type: webostv.turn_on

Yeah, I know that. šŸ˜„ Maybe I wasn’t clear enough, I wanted to know if I should re-add integration after the update. Like making a fresh start to be safe.