HA LG WebOS integration stops working

Hi all,

I’m fairly new to HA and I’m trying to use the WebOS integration in HA. Initialy all works fine, but after a couple of minutes the connection with the Tv is lost and the integration only works after a HA reboot. Thanks in advance!

My LG WebOS integration:

webostv:
host: 192.168.X.XXX
name: LG TV
customize:
sources:
- youtube
- netflix
- Amazon Prime Video
- videoland

Edit:
It’s connected via ethernet

How is your TV connected to your network, via LAN or WiFi?

Hi Robert, thanks for the reply. It’s connected via ethernet/LAN

Okay, so not a wireless issue.

Try this to see if it’s dropping off the network or its the Integration:

When the integration goes offline, open up terminal on your compute and ping the IP address of the TV to see if it’s still “visible” on the network.

I use this integration too (Over a WiFi connection) without issue.

I’ve set up a LAN and WIFI ping sensor in HA for the TV. Both lose connection when TV is turned off.

I figured as much.

So the integration page has this bit of info which might help:

Common for webOS 3.0 and higher would be to use WakeOnLan feature. To use this feature your TV should be connected to your network via Ethernet rather than Wireless and you should enable LG Connect Apps feature in Network settings of the TV instructions (or Mobile App in General settings for older models) (*may vary by version).

On newer models (2017+), WakeOnLan may need to be enabled in the TV settings by going to Settings > General > Mobile TV On > Turn On Via WiFi instructions.

Perhaps give that a go and see if it fixes the issue?

I think there us a power management setting also.
Deep sleep kills network.

I checked all settings on the TV but al seems to be working. I’ve tried it with de LG WebOS Mobile App. This works like the HA integration, but when the TV is off overnight the connection won’t turn back on. The LAN Ping however is fine when te TV comes back on. The WIFI Ping stops working until i reconnect it via the TV menu.

I’ve also tried toggle the quick start + mode on the TV, but with no luck so far

I’ve the same problem, it seems to have started occurring after a WEBOS update a few months back. I’ve not bothered to try to fix it till today.

If you’ve been able to resolve your problem since, can you kindly share. Thanks!

Update from me, turns out one of the ethernet ports on my network switch was faulty. Plugged my lg TV into another port and my issue has gone away.

Hi

I have my LG TV connected to the ethernet and I believe i have a similar problem. In a nutshell

  • Start home assistant
  • The LG TV is detected
  • I can operate the TV from Home assistant
  • Turn it off and back on, everything is still working
  • Turn off the TV, wait long enough and the connection is dropped somehow in the background.
  • The wake_on_lan action will turn off the TV but it is dead to home assistant. Cannot read its status not operate it

I believe I have isolated the problem and produced a patch

I need people to test it. Just deploy the webostv integration as a custom component and report if the behaviour has improved

Any solution for this problem? I’m having the same issue with a new LG tv.

Hi @jfparis

Im experiencing much the same as you describe. Did your fix help? I Can help test it one of the days If you need it.

BR,
Bjørn

@pmgsrosa @Bkje

Yes the branch I posted above can be deployed as a custom integration. I believe it works better than the current home assistant code as it will reconnect to the TV after a wake up on lan (but it is a bit slow to do so)

If you want to test it you just need

  1. deploy the webos tv integration above as a custom component (copy the webostv folder in your custom_components folder
  2. Follow the instruction from the home assistant website. https://www.home-assistant.io/integrations/webostv/. Make sure the wake up on lan is working
  3. enable logging
logger:
  default: warning
  logs:
    custom_components.webostv: debug
  1. Send feedback

I have the same issue, set up as above and get the error
Logger: homeassistant.setup
Source: setup.py:178
First occurred: 18:53:03 (1 occurrences)
Last logged: 18:53:03

Setup failed for webostv: No setup or config entry setup function defined.

I copied the setup.py into the config folder and get the same error.
What am I doing wrong?

@jfparis

I’m running with your branch now, so far so good.

2021-12-09 20:59:41 DEBUG (MainThread) [custom_components.webostv] connecting
2021-12-09 20:59:41 DEBUG (MainThread) [custom_components.webostv] connected

Will keep and eye on it to see if it drops off.

Found the /config/webostv.conf is reporting the error below. I have tried deleting this and re-pairing the Tv, each time I get:
‘utf-8’ codec can’t decode byte 0x91 in position 99: invalid start byte’

Hi @yoda-1

Difficult to help/advise if you don’t share any config file

regards

It only has this one line in the /config/webostv.conf file stating the error. I assumed it was generated during pairing.

In the configuration.yaml I have

webostv:
  host: 192.168.xx.xx
  name: LG Tv
  turn_on_action:
   service: wake_on_lan.send_magic_packet
   data:
      mac: xx-xx-xx-xx-xx-xx
  customize:
    sources:
        - Live TV
        - Netflix
        - Virgin
        - YouTube

notify:

I only got Home Assistant last week and still getting to grips with it

the “webostv.conf” file is generated when you pair the TV with home assistant
You might want to delete it and retry the pairing process