grzegorz914 / homebridge-lgwebos-tv

Homebridge plugin for LG WebOS TV, publish as independent external platform accessory.
MIT License
135 stars 15 forks source link

Screen Off issue #177

Closed turbo159 closed 11 months ago

turbo159 commented 1 year ago

Hi, great plugin. However, screen off/on doesn't seem to work for me. Screen On works if I manually turn off the screen. Screen off does not. The plug-in is able to see the current state when I control the on/off manually. Other controls do work such as TV on/off, or input switching.

-------- LGTV -------- Manufacturer: LG Electronics Model: OLED65C8AUA System: webOSTV 4.0 Firmware: 05.50.15

Fookes74 commented 1 year ago

Funnily enough, I came on here to report that I have the exact opposite issue. Mine will reliably turn off but will not turn on at all. The tile lights up to signify it's on but it doesn't actually do it. I've always just wanted the plugin for on/off controls but I also note that despite removing all options for showing inputs / channels, it still shows them in the tile. I'm fairly sure a version of this plugin I used previously didn't have this.

It's frustrating and I have no idea of what to do to fix this issue turning the TV on. I had this plugin (or a version of) working perfectly previously. Sadly I inadvertently trashed a backup I had and following a requirement to rebuild Homebridge I'm now unable to get it working properly again.

LGTV

Manufacturer: LG Electronics Model: 55UB850V-ZD System: webOS 2.4.1 Firmware: 5.6.10

grzegorz914 commented 1 year ago

@Fookes74 can you post debut during try to power on.

Fookes74 commented 1 year ago

@Fookes74 can you post debut during try to power on.

Sure can. This is what I'm seeing when I enabled debug:

Screenshot 2023-11-01 at 11 55 52

Screenshot 2023-11-01 at 11 56 21

Yet again, inputs show even though I've not selected them in the config. TV powers off without issue. Just won't turn on even though tile (eventually) shows it as being on. I usually get a spinning circle in the tile like its processing. It should be noted that I'm running homebridge in a Docker Container with it's own IP address.

grzegorz914 commented 1 year ago

The tv is powered od over Wake On Lan are you sure You have set correct Mac Address in the plugin config?

Fookes74 commented 1 year ago

The tv is powered od over Wake On Lan are you sure You have set correct Mac Address in the plugin config?

Yep. TV settings show wifi and wired MAC addresses. Checked and double-checked. My TV is connected via ethernet so I'm using the wired MAC address. Unless there's a specific way I'm meant to input it in to the config? I'm doing it like this:

xx:12:xx:34:xx:56

grzegorz914 commented 1 year ago

yes, it is correct address, check please tv settings to have enabled possibility power on over lan, https://www.lg.com/au/support/product-help/CT20088015-1437132986635

regarding load inputs even are not configured, I have prepared 2.14.0-beta.0 with possibility to disable load default inputs, its configured in plugin settings >>> inputs>>> disable load default inputs, check this please and let me know

Fookes74 commented 1 year ago

yes, it is correct address, check please tv settings to have enabled possibility power on over lan, https://www.lg.com/au/support/product-help/CT20088015-1437132986635

LG Connect is configured and request accepted when plugin installed. It's not that - at least on the face of it.

regarding load inputs even are not configured, I have prepared 2.14.0-beta.0 with possibility to disable load default inputs, its configured in plugin settings >>> inputs>>> disable load default inputs, check this please and let me know

I'll check out the beta version (if that's what you mean) and see if I can disable the inputs. Fundamentally though, they are secondary compared to the on/off issues for me.

Note: I've redone LG Connect and now the home app tile shows on and off but TV will not turn on or off at all!

grzegorz914 commented 1 year ago

Can you enable TV using LG connect app or other external app? beta.1 with fixed inputs published, try and let me know

grzegorz914 commented 1 year ago

@turbo159

can you try 2.14.0-beta and let me know

Fookes74 commented 1 year ago

@turbo159

can you try 2.14.0-beta.2 and let me know

Sorry - had to pop out. I've updated to latest beta version. It now disables the option of inputs successfully. I completely wiped the 'pair accessories' part of LG connect and then accepted the invite to connect once I'd restarted homebridge. Sadly, it turns on and off for the tile but doesn't do anything on the TV. This is the output from the logs in Homebridge:

Screenshot 2023-11-01 at 17 03 46

Fookes74 commented 1 year ago

@turbo159 can you post whole debug log direct after restart the plugin?

Apologies - I've just spotted that you're tagging the person who posted the original issue. I take it you're actually responding to me? If so, can you tell me what I need to do to get the whole debug log direct?

grzegorz914 commented 1 year ago

@Fookes74 the whole log file You can download from Homebridge Config UI

Fookes74 commented 1 year ago

@Fookes74 the whole log file You can download from Homebridge Config UI

Sure:

homebridge.log-2.txt

grzegorz914 commented 1 year ago

install beta.7 and get the log again

Fookes74 commented 1 year ago

install beta.7 and get the log again

Here:

homebridge.log.txt

Fookes74 commented 1 year ago

install beta.7 and get the log again

Here:

homebridge.log.txt

UPDATE Tried using beta 7. It turned tv off (then flipped between showing 'off' in tile to 'on' and then wouldn't control turning TV on - only working for 'off'). Continuing to get whirring 'processing' circle when flitting between on and off on tile.

grzegorz914 commented 1 year ago

install beta 8 try on off few times and get the log again

Fookes74 commented 1 year ago

install beta 8 try on off few times and get the log again

updated to beta 8. Tried off and on several times. Visually, exactly the same. 'off' works immediately. 'on' doesn't work at all. Here's the log taken after a few goes of 'off' and 'on':

homebridge.log.txt

grzegorz914 commented 1 year ago

please install beta.9 and describe what not working, also please post the log again

Fookes74 commented 1 year ago

please install beta.9 and describe what not working, also please post the log again

Same. On beta 9. Turns off TV instantly. When trying to turn on it goes to 'on' for a moment in the tile (with the whirring icon) and then turns itself off. TV itself doesn't respond and won't turn on. If I repeatedly press on and off nothing happens. Occasionally get the whirring cog and sometimes I don't. Interestingly, tile seems to recognise state. It was showing as off on tile until I turned the TV on via TV remote. Whilst it wasn't instant it changed the tile to 'on' after a few seconds. Here's the log:

homebridge.log.txt

grzegorz914 commented 1 year ago

You can not power on because your tv doesn’t respond to wake on lan packet, Can you power on TV using LG connect app or other external app?

Fookes74 commented 1 year ago

You can not power on because your tv doesn’t respond to wake on lan packet, Can you power on TV using LG connect app or other external app?

I had this plugin (or a variant of it) working perfectly until recently when I had to start from scratch. It powered the tv on and off without issue, immediately both ways for months and months. I know the TV can work with a variant of the webOS plugin because it has. I'll try with the LG app but won't be able to do this until tomorrow morning now. I'll report back in the morn. Appreciate your help.

grzegorz914 commented 1 year ago

OK, check this please and let me know, looks like the packet is not received by tv, may be you have something changed in the tv settings or in your local network.

Fookes74 commented 1 year ago

You can not power on because your tv doesn’t respond to wake on lan packet, Can you power on TV using LG connect app or other external app?

I had this plugin (or a variant of it) working perfectly until recently when I had to start from scratch. It powered the tv on and off without issue, immediately both ways for months and months. I know the TV can work with a variant of the webOS plugin because it has. I'll try with the LG app but won't be able to do this until tomorrow morning now. I'll report back in the morn. Appreciate your help.

UPDATE - I managed to quickly download the LG thinQ app (couldn't find the LG Connect app - am in UK). This behaves similarly. I can turn off the TV instantly but the power button then disappears from app so can't turn on from there.

It seems to be a TV issue therefore but its ridiculous as I know this can and HAS worked flawlessly. I have reset and reconnected the LG Connect setting with the plugin multiple times so it sees the plugin without issue.

Fookes74 commented 1 year ago

OK, check this please and let me know, looks like the packet is not received by tv, may be you have something changed in the tv settings or in your local network.

See my updated response. I haven't changed any of the TV settings at all. Nothing. In terms of network changes, all that has changed is that the homebridge which was working with this plugin was run on a raspberry pi and my present instance is running in a Docker Container with its own IP address on a HP EliteDesk SFF PC.

grzegorz914 commented 1 year ago

Are you sure you can send WoL broadcast packet from this IP to TV, may be firewall

Fookes74 commented 1 year ago

Are you sure you can send WoL broadcast packet from this IP to TV, may be firewall

I have no idea tbh. My knowledge on docker, containers etc, is very limited. I sought help in configuring all of this. I presumed that if its able to turn it off then it should be able to communicate similarly to turn it on, or is that not how it works?

grzegorz914 commented 1 year ago

The communication between tv and plugin is over WebSocket and this working correct but power on TV is realized over Wake On LAN broadcast packet and port 9, and looks like here is problem.

Look here, looks like you can not send Wake On LAN packet from inside the docker container https://www.reddit.com/r/selfhosted/comments/121pxol/wake_on_lan_gui_on_docker_container/?rdt=62783

Fookes74 commented 1 year ago

https://www.reddit.com/r/selfhosted/comments/121pxol/wake_on_lan_gui_on_docker_container/?rdt=62783

I was hoping you were not going to say that! I greatly appreciate your help on this. I found this article which seems to suggest it's possible. Whilst I certainly don't understand fully what it's telling me here, it suggests the plugin for the users Tizen TV utilises a wol: IPADDRESS as part of the plugin config in homebridge. Can you make sense of what it is saying?

https://www.devwithimagination.com/2020/06/15/homebridge-docker-and-wake-on-lan/

grzegorz914 commented 1 year ago

Yes, it is possible but all on both side need to be adapted

Fookes74 commented 1 year ago

Yes, it is possible but all on both side need to be adapted

Should I be posing this question on another forum for assistance?

grzegorz914 commented 1 year ago

Yes You can, I don’t have docker in my environment.

Fookes74 commented 1 year ago

Yes You can, I don’t have docker in my environment.

Ok. Thanks for your assistance again.

turbo159 commented 1 year ago

@turbo159

can you try 2.14.0-beta and let me know

Hi. Sorry I have been away. I just tried the beta, but same issue. I can turn the screen off, but it won't turn on. I turned on debug mode. I'm not sure I did it right since the logs look the same:

image
grzegorz914 commented 1 year ago

@turbo159 debug mode can be enabled is in plugin settings Advanced Section >>>System>>>Debug Mode set it to true, save and restart the plugin.

turbo159 commented 1 year ago

Cool thanks. Ok, looks like debug does show an error:

image
grzegorz914 commented 1 year ago

The error normal behavior, can you post whole debug log file during try to change screen state? it can be downloaded from Config UI X ?

turbo159 commented 1 year ago

This is the debug file... homebridge.log-4.txt

badgertastic commented 1 year ago

12.14 broke screen off for me. Back on 12.13.4.

grzegorz914 commented 1 year ago

On is working? What webOS have your TV.

badgertastic commented 1 year ago

Neither on or off work. WebOS 5.0. Firmware 4.50.51 IMG_0272

EDIT: notice also the multiple entries for just one switch press

badgertastic commented 1 year ago

With it working on 12.13.4 IMG_0273

grzegorz914 commented 1 year ago

@badgertastic please try 2.14.1-beta.0 and let me know

turbo159 commented 1 year ago

I tried the latest beta, v2.14.1-beta0, and the screen off still didn't work for me:

[11/5/2023, 6:18:00 PM] [LgWebOsTv] Device: 192.168.20.128 LGTV, Input, Name: Live TV, Reference: com.webos.app.livetv [11/5/2023, 6:18:03 PM] [LgWebOsTv] Device: 192.168.20.128 LGTV, Turn Screen OFF. [11/5/2023, 6:18:03 PM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Received message type: error, id: 2d5d5b30000f, data: { "returnValue": false, "state": "Active", "errorCode": "-102", "errorText": "The current state must be 'Screen Off'"

turbo159 commented 1 year ago

Screen on used to work, but it doesn't work for me any more:

2023, 8:12:06 PM] [LgWebOsTv] Device: 192.168.20.128 LGTV, Turn Screen ON. [11/5/2023, 8:12:06 PM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Received message type: error, id: da621dde0011, data: {}

badgertastic commented 1 year ago

@badgertastic please try 2.14.1-beta.0 and let me know

No change, on or off does nothing. Debug shows just the same data: {} in the response.

turbo159 commented 1 year ago

With the beta, trying to turn the screen on doesn't work on a single press, but when I turn it off again on the HomeKit button, it turn on even though the button shows off. The state of the button is correct if you refresh the HomeKit screen.

[11/6/2023, 9:05:58 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, Turn Screen ON. [11/6/2023, 9:05:58 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Received message type: error, id: 974aa0570015, data: {} [11/6/2023, 9:06:00 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, Turn Screen OFF. [11/6/2023, 9:06:00 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Power: { "returnValue": true, "state": "Screen Off", "processing": "Screen On" } [11/6/2023, 9:06:00 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Received message type: response, id: 5008c5360016, data: { "returnValue": true, "state": "Active" } [11/6/2023, 9:06:00 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Power: { "returnValue": true, "state": "Active" } [11/6/2023, 9:06:00 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, Turn Screen OFF. [11/6/2023, 9:06:00 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Received message type: error, id: 2130d5cc0017, data: { "returnValue": false, "state": "Active", "errorCode": "-102", "errorText": "The current state must be 'Screen Off'" } [11/6/2023, 9:06:01 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Socked send heartbeat. [11/6/2023, 9:06:01 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Socked received heartbeat. [1

grzegorz914 commented 1 year ago

try beta 2 and get the log again

turbo159 commented 1 year ago

Ok beta2 restored screen on. Screen off doesn't work. When do screen off through the LG remote, there is a 5s countdown on the TV screen. Does that make any difference?

[11/6/2023, 10:13:15 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, Turn Screen ON. [11/6/2023, 10:13:15 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Power: { "returnValue": true, "state": "Screen Off", "processing": "Screen On" } [11/6/2023, 10:13:15 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Power: { "returnValue": true, "state": "Active" } [11/6/2023, 10:13:15 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Power: { "returnValue": true, "state": "Active" } [11/6/2023, 10:13:16 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Socked send heartbeat. [11/6/2023, 10:13:16 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Socked received heartbeat. [11/6/2023, 10:13:21 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Socked send heartbeat. [11/6/2023, 10:13:21 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Socked received heartbeat. [11/6/2023, 10:13:23 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, Turn Screen OFF. [11/6/2023, 10:13:23 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Power error: {} [11/6/2023, 10:13:26 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Socked send heartbeat. [11/6/2023, 10:13:26 AM] [LgWebOsTv] Device: 192.168.20.128 LGTV, debug: Socked received heartbeat.

grzegorz914 commented 1 year ago

try beta 5 and please also change volume, mute and input using HomeKit app and get the log again