Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LG webostv if TV is OFF when HA start, loss possibility to turn ON #34877

Closed
Scialla opened this issue Apr 29, 2020 · 41 comments · Fixed by #34979
Closed

LG webostv if TV is OFF when HA start, loss possibility to turn ON #34877

Scialla opened this issue Apr 29, 2020 · 41 comments · Fixed by #34979

Comments

@Scialla
Copy link

Scialla commented Apr 29, 2020

The problem

**With 0.108.9 all work fine; after upgrade to 0.109, if TV is OFF when HA start, can't turn ON TV**

Environment

**HA 0.109**
  • Home Assistant Core release with the issue: 0.109
  • Last working Home Assistant Core release (if known): 0.108.9
  • Operating environment (Home Assistant/Supervised/Docker/venv): Home Assistant venv
  • Integration causing this issue: webostv
  • Link to integration documentation on our website:

Problem-relevant configuration.yaml

wake_on_lan:

webostv:
    host: 192.168.1.153
    name: LG TV
    turn_on_action:
      service: wake_on_lan.send_magic_packet
      data:
        mac: "a0:6f:aa:9c:57:e2"
    customize:
      sources:
        - 'Amazon Prime Video'
        - hdmi2
        - photovideo
        - livetv

Traceback/Error logs

**no error in log, normal log:**
Apr 29 19:55:14 raspberrypi hass[6324]: 2020-04-29 19:55:14 INFO (SyncWorker_8) [homeassistant.loader] Loaded webostv from homeassistant.components.webostv
Apr 29 19:55:27 raspberrypi hass[6324]: 2020-04-29 19:55:27 INFO (MainThread) [homeassistant.setup] Setting up webostv
Apr 29 19:55:32 raspberrypi hass[6324]: 2020-04-29 19:55:32 WARNING (MainThread) [homeassistant.components.webostv] No connection could be made with host 192.168.1.153, retrying in 60 seconds
Apr 29 19:55:32 raspberrypi hass[6324]: 2020-04-29 19:55:32 INFO (MainThread) [homeassistant.setup] Setup of domain webostv took 4.7 seconds.
Apr 29 19:56:35 raspberrypi hass[6324]: 2020-04-29 19:56:35 WARNING (MainThread) [homeassistant.components.webostv] No connection could be made with host 192.168.1.153, retrying in 60 seconds
Apr 29 19:57:38 raspberrypi hass[6324]: 2020-04-29 19:57:38 WARNING (MainThread) [homeassistant.components.webostv] No connection could be made with host 192.168.1.153, retrying in 60 seconds
Apr 29 19:58:41 raspberrypi hass[6324]: 2020-04-29 19:58:41 WARNING (MainThread) [homeassistant.components.webostv] No connection could be made with host 192.168.1.153, retrying in 60 seconds

Additional information

**if i turn on television with TV remote, after few seconds, all work fine and i can turn off and turn on again from component; the problem is only when HA start
Schermata 2020-04-29 alle 19 28 23
**
Schermata 2020-04-29 alle 19 28 46

@probot-home-assistant
Copy link

Hey there @bendavid, mind taking a look at this issue as its been labeled with a integration (webostv) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@sagitt
Copy link

sagitt commented Apr 29, 2020

i can't load my tv after a restart. already tried to delete webos.conf and re-pair tv. after the first start all ok, other restart and some tv not loaded. see #34881 for more details.

only works fine if i start hass with all tv turned on.

@Scialla
Copy link
Author

Scialla commented Apr 29, 2020

only one time i had same problem... lost my entity

@sagitt
Copy link

sagitt commented Apr 29, 2020

only load tv if turned on during hass start. or won't load entity.

@GeorgeSG
Copy link
Contributor

I'm having the same issue - TV entity is unavailable if TV is off during home assistant start up

@DavidFW1960
Copy link

Same here as reported since b1 as well..

2020-04-30 08:36:50 WARNING (MainThread) [homeassistant.components.webostv] No connection could be made with host 10.90.11.44, retrying in 60 seconds

Every 60 seconds a new warning

@Zamunda4Eva
Copy link

I am experiencing the same issue as well with same error as above.

@lockyt
Copy link

lockyt commented Apr 30, 2020

Yep same problem here

@bhaal85
Copy link

bhaal85 commented Apr 30, 2020

Same problem

@holdestmade
Copy link

holdestmade commented Apr 30, 2020

Same here

No connection could be made with host 192.168.1.26, retrying in 60 seconds
8:23:36 AM – LG webOS Smart TV (WARNING) - message first occurred at April 29, 2020, 10:33:30 PM and shows up 563 times
Unable to find referenced entities media_player.monitor
8:13:26 AM – helpers/service.py (WARNING) - message first occurred at April 29, 2020, 11:08:15 PM and shows up 3 times

@Rutrov
Copy link

Rutrov commented Apr 30, 2020

Same problem here

@a-sp
Copy link

a-sp commented Apr 30, 2020

Same problem here.
The most undesired effect of this issue is that it is not possible anymore to turn on the TV using the media player button, since the entity is reported as unavailable.
image

This is the log when I push the turn on button:
2020-04-30 12:49:59 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities media_player.lg_webos_smart_tv

@sagitt
Copy link

sagitt commented Apr 30, 2020

109.1 not fixes this problem.

@ludeeus
Copy link
Member

ludeeus commented Apr 30, 2020

if it did, the issue would be closed.

@adandl
Copy link

adandl commented Apr 30, 2020

+1 - same issue with TV changing to unavailable

@matstrange
Copy link

This PR seems to have a lot of changes in this code: https://github.com/home-assistant/core/pull/34147/files/ba5b420782356d5e59dc21dcb1f372916b045d19#

Perhaps @timmo001 wouldn't mind taking a look to see if it is related?

@trx900
Copy link

trx900 commented Apr 30, 2020

0.109.1 the problem remains

@marima84
Copy link

marima84 commented Apr 30, 2020

After upgrading to 0.109.1 I lost WebOS integration. This is how it appears my LG tv now in HA
image
The entity name has been rewritten.

Mark

@muniter
Copy link

muniter commented Apr 30, 2020

In my case, my TV entities disappeared completely. So It's like the integration is gone, I have it in yaml.

@carlos-leopoly
Copy link

After restarting HA without the TV on, my entity on the Developer Tools / States page has state ‘unavailable’. And attempt to turn on TV results in an error related by not able to reference entity. Then I turn on TV and the entity becomes available and everything works. Even after turning off TV.
On 0.108.9 the entity was available at HA startup which is the expected behaviour

@jjlawren
Copy link
Contributor

Summary of problem:

  1. A unique_id property was added to the media_player entity which allows it to use the entity registry. (Improve LG webosTV #34147)
  2. Setting the unique_id would fail on startup if the TV was off, since the information wasn't available.
  3. A change was made to delay setup of the media_player entity when the TV was unreachable. (Add retry at startup #34656). This means the media_player entity isn't available until the TV turns on and we can connect.
  4. The media_player.turn_on service can't be called if an entity doesn't exist so this functionality is currently unavailable.

It's not (currently) possible to obtain a unique_id if the TV is off, so the two options I see are:

  1. Find a way to know the unique_id the TV will use once it is available. (Good option)
  2. Remove the unique_id property. (Bad option)

@bendavid
Copy link
Contributor

As I suggested in another thread, probably the best solution would be to modify aiopylgtv to store the relevant additional information in the file along with the pairing information, then this would always be accessible as long as the TV has been paired, and the entity can be added at startup. I'm happy to take care of this, but not immediately.

So my suggestion would be 2. for now, and 1 once the above is implemented in the client library.

@sagitt
Copy link

sagitt commented May 5, 2020

you think will be a solution soon with minor 0.109.X update? all my automations (led, amplifier etc. ) are now broken. thanks!

@holdestmade
Copy link

After upgrading to 0.109.1 I lost WebOS integration. This is how it appears my LG tv now in HA
image
The entity name has been rewritten.

Mark

Thats not the WebOS integration, thats a browser_mod entity

@Scope666
Copy link

Scope666 commented May 5, 2020

I've had this problem through all the 109.x versions. TV now has to be on if I want to reboot HA

image

@darootler
Copy link

Same here, i think the entity has to be stored permanently and not only during discovery on HA startup.

Regards
Richard

@jjlawren
Copy link
Contributor

jjlawren commented May 5, 2020

#34979 should fix this, but it's a breaking change and will need to wait for 0.110.0.

@sagitt
Copy link

sagitt commented May 5, 2020

#34979 should fix this, but it's a breaking change and will need to wait for 0.110.0.

well, i'll try 110 beta when is out

@elle2
Copy link

elle2 commented May 9, 2020

I've this issue since release 0.108 but today I've noted this behavior.
Last evening after an upgrade to HA Core 0.109.5 as usually LG WebOS was unavailable.
No one had turned on the tv during the evening but at 2:40 AM (in the middle of the night) the state of the LG media player changed from unavailable to off !!
Maybe this information could be useful to developers, I don’t know if during the night HA does some activities (purge, cleaning, alignment …).

@pippo73
Copy link

pippo73 commented May 21, 2020

Hello all,
I cannot understand. Even with the new release (0.110.0) this function still does not work.
And the bug #34979 is unaccesible... Is there a way to fix it or the problem has no solution?
thank you all

@trx900
Copy link

trx900 commented May 21, 2020

0.110.0 no problem lg webos.

@GeorgeSG
Copy link
Contributor

@pippo73 the bug was resolved for me with 0.110.0.

Check your entities list. You probably have a duplicate entry for your tv. For example, if the previous entity was media_player.lg_tv, you should have a media_player.lg_tv_2 now. You can delete the old one, then change the entity_id of the new one, and you should be good to go :)

@pippo73
Copy link

pippo73 commented May 21, 2020

No @GeorgeSG, only one entity

2020-05-21 16_18_26-Configuration - Home Assistant - Profilo 1 - Microsoft​ Edge

This is the config I have in the configuration file

# devices # webostv: host: 192.168.1.11 name: televisore_soggiorno

But if I try go to "Developer Tools" > "services" > and I set:

service : media_player.turn_on
and
entity: media_player.televisore_soggiorno

and I push the "call service" button it does not turn on the tv :-(
It works if I try to turn it off ... any ideas?

@sagitt
Copy link

sagitt commented May 21, 2020

No @GeorgeSG, only one entity

2020-05-21 16_18_26-Configuration - Home Assistant - Profilo 1 - Microsoft​ Edge

This is the config I have in the configuration file

# devices # webostv: host: 192.168.1.11 name: televisore_soggiorno

But if I try go to "Developer Tools" > "services" > and I set:

service : media_player.turn_on
and
entity: media_player.televisore_soggiorno

and I push the "call service" button it does not turn on the tv :-(
It works if I try to turn it off ... any ideas?

for me was resolved. i removed all LG TVs from integration, deleted webos conf file, restarted and re-paired all tvs. this only for the duplicate entity problem.

@pippo73
Copy link

pippo73 commented May 21, 2020

No @GeorgeSG, only one entity
2020-05-21 16_18_26-Configuration - Home Assistant - Profilo 1 - Microsoft​ Edge
This is the config I have in the configuration file
# devices # webostv: host: 192.168.1.11 name: televisore_soggiorno
But if I try go to "Developer Tools" > "services" > and I set:
service : media_player.turn_on
and
entity: media_player.televisore_soggiorno
and I push the "call service" button it does not turn on the tv :-(
It works if I try to turn it off ... any ideas?

for me was resolved. i removed all LG TVs from integration, deleted webos conf file, restarted and re-paired all tvs. this only for the duplicate entity problem.

So, I've commented out the webos part in the config file, and rebooted
I've removed the old entity, and rebooted
Uncommented the config file and I gave a new unique name (just to be sure) rebooted.

Once again, the off comand works. The on doesn't :'-(

Any other idea?

@Scope666
Copy link

I still have the config file in there as I don't think the integration has the config for magic packets. Seems to be working for me:

webostv:
  host: 192.168.1.144
  name: LG OLED TV
  #standby_connection: true
  turn_on_action:
    service: wake_on_lan.send_magic_packet
    data:
      mac: "A0:6F:AA:30:00:00"

@jjlawren
Copy link
Contributor

@pippo73 Sorry, but did turn_on ever work for you? I don't see a turn_on_action specified in your configuration.

@pippo73
Copy link

pippo73 commented May 21, 2020

EUREKA!!! thank you guys, now it works! thank you really much :-)

@luke2700k
Copy link

Both my webOS entities had _2

Deleted the duplicates and now is all working as expected, thanks for your help @GeorgeSG

@rodrigogbs
Copy link

Hello guys.

Do you know how to set to turn ON the TV if i have 2 TVs configured?

My configuration.yaml is like that:

webostv:

  • name: TV SALA
    host: 192.168.68.135
  • name: TV SACADA
    host: 192.168.68.131

I've tryed like this, but facing logs and doesn't work:

webostv:

  • name: TV SALA
    host: 192.168.68.135
    #standby_connection: true
    turn_on_action:
    service: wake_on_lan.send_magic_packet
    data:
    mac: "A0:6F:AA:30:00:00"
  • name: TV SACADA
    host: 192.168.68.131

Thanks !!

@jjlawren
Copy link
Contributor

jjlawren commented Oct 1, 2020

@rodrigogbs this is a closed issue for another topic. Please open a new issue if you need assistance. You can hit the "..." on your comment and select "Reference in new issue" as a shortcut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.