tavicu / homebridge-samsung-tizen

Homebridge plugin for Samsung TV's with Tizen OS
MIT License
646 stars 89 forks source link

TV Power status not reflecting correctly after powering on (The Frame) #444

Closed bearreth closed 2 years ago

bearreth commented 2 years ago

Hey guys, just wondering if anyone else is having an issue where when they power on their tv, the status switches to "Not responding" though the TV powers on? It then switches to an on state after a minute or so.

This sometimes makes Siri think that the TV is not responding, when in fact, it did.

dpamping commented 2 years ago

Mine says that it powered on and then off and then on, … and the tv it’s on art mode. And also if I press to turn it on it says that is disconnected and then I have to turn it off and when I do that the tv turns on. It’s very frustrating.

Homekitdude commented 2 years ago

Finally had to just remove this. I have 3 The Frame TVs and this plugin just flat out doesn’t work. All I want is to simply turn the tv on and off, and it ALWAYS puts it into Art Mode. Even when I disabled it via the plugin (or what I thought was doing that). Additionally, would be cool to set it to Art Mode via Siri as well. Just nothing works. I’ve looked through the issues database and can’t find an answer. Wish someone could help!

tavicu commented 2 years ago

It is possible that your TV to not be detected automatically as frame. You could see here how to force it: https://github.com/tavicu/homebridge-samsung-tizen/issues/318#issuecomment-817726064

All I want is to simply turn the tv on and off, and it ALWAYS puts it into Art Mode.

https://github.com/tavicu/homebridge-samsung-tizen/issues/318#issuecomment-817323066 -> Frame.RealPowerMode

Additionally, would be cool to set it to Art Mode via Siri as well

By default there is a switch that controls the Art Mode. Only option is to ask siri to turn Art Mode on/off. -> https://github.com/tavicu/homebridge-samsung-tizen/issues/427#issuecomment-950232177

bearreth commented 2 years ago

Hi @tavicu, just to be clear, that's not actually the issue I'm experiencing. homekitdude's issue is separate from mine. I have no issue with The Frame functionality with your plug in -- just that the power status does not reflect correctly when I first turn the frame on.

tavicu commented 2 years ago

Hi @bearreth , there was a problem with Siri when the first time asking for a command will make the connection very slow and responded with error. But the last version released i implemented a feature to respond in maximum 1.5 seconds.

You could start the homebridge in debug mode and watch the console for errors when it fails to do the action.

bearreth commented 2 years ago

Hey @tavicu, I did restart homebridge in debug mode and what happens is as follows:

It repeats { request: 'get_artmode_status' } continuously, and then when I use the Power switch in Home, it throws this error: [29/12/2021, 11:07:42] [The Frame] Failed to power on the TV [29/12/2021, 11:07:42] [The Frame] [DEBUG] WoLFailedError: Failed to power on the TV at /usr/local/lib/node_modules/homebridge-samsung-tizen/lib/methods/base.js:87:33 at processTicksAndRejections (internal/process/task_queues.js:95:5)

After that, I get a few other unique errors like:

[29/12/2021, 11:08:11] [The Frame] [DEBUG] { data: { clients: [ [Object], [Object] ], id: 'b880b4a1-f38f-4f50-b724-8e35c2a1d153' }, event: 'ms.channel.connect' } [29/12/2021, 11:08:11] [The Frame] [DEBUG] { data: {}, event: 'ms.channel.ready' }

and then this repeats:

[29/12/2021, 11:08:11] [The Frame] [DEBUG] { data: '{\n' + ' "id": "b880b4a1-f38f-4f50-b724-8e35c2a1d153",\n' + ' "event": "artmode_status",\n' + ' "value": "on",\n' + ' "target_client_id": "b880b4a1-f38f-4f50-b724-8e35c2a1d153"\n' + '}', event: 'd2d_service_message', from: '179515ce-5f2c-4db4-9866-a15a7eb72763' }

Though the switches still work as they are intended to, and are able to turn the tv on and off and also trigger the art mode state.

tavicu commented 2 years ago

Ok, only the first one it's an error WoLFailedError. The rest of them are ok and it connects to the socket without problem.

So your problem is that the plugin can't wake the TV with Wake on Lan to the mac. This means that the MAC address in config file it's wrong or somehow your network (router) blocks wol packages. But i suspect that the mac in wrong.

Could you post here the config (only the SamsungTizen part) to see if i could catch something wrong? Also make sure you use the correct mac addres. If your TV is connected with wire, get the mac address from wired network. If it's connected with wifi get the wifi address.

bearreth commented 2 years ago

I had the issue with WoL before as I had the MAC address wrong, but I had fixed it since then (I will double check). The plugin actually turns on my tv with no issue, so I don't have an issue with powering it on or anything.

Here is my config: "name": "SamsungTizen", "app_list": false, "devices": [ { "method": "frame", "name": "The Frame", "ip": "192.168.1.102", "mac": "4C:C9:5E:0D:78:CC", "options": [ "Frame.RealPowerMode", "Frame.PowerSwitch.Disable" ], "inputs": [ { "type": "app" } ], "keys": { "INFORMATION": "KEY_HOME" } } ], "platform": "SamsungTizen"

tavicu commented 2 years ago

Are you comfortable editing a file so we can have more data why WoL is failing? If yes, you need to edit this file lib/methods/base.js line 87 -> https://github.com/tavicu/homebridge-samsung-tizen/blob/master/lib/methods/base.js#L87

You need to change it from: .catch(() => reject(new WoLFailedError())) to: .catch((e) => { console.log(e); return reject(new WoLFailedError()); })

Then restart homebridge and check the console for logs when it's failing.

I didn't add logs over there by default because never had problems with WoL failing. You are the first one :D

bearreth commented 2 years ago

Thanks! I just need to locate it within in my Pi now...would you happen to know the path if it was installed via Homebridge?

tavicu commented 2 years ago

Thanks! I just need to locate it within in my Pi now...would you happen to know the path if it was installed via Homebridge?

Try with npm list -g --depth 0

bearreth commented 2 years ago

Got it, here is the output:

[29/12/2021, 12:53:41] [The Frame] [DEBUG] { request: 'get_artmode_status' } Error: send Unknown system error -126 10.6.0.255:9 at doSend (dgram.js:714:16) at defaultTriggerAsyncIdScope (internal/async_hooks.js:452:18) at afterDns (dgram.js:660:5) at processTicksAndRejections (internal/process/task_queues.js:83:21) { errno: -126, code: 'Unknown system error -126', syscall: 'send', address: '10.6.0.255', port: 9 }

[29/12/2021, 12:53:46] [The Frame] Failed to power on the TV [29/12/2021, 12:53:46] [The Frame] [DEBUG] WoLFailedError: Failed to power on the TV at /usr/local/lib/node_modules/homebridge-samsung-tizen/lib/methods/base.js:87:59 at processTicksAndRejections (internal/process/task_queues.js:95:5)

tavicu commented 2 years ago

I really don't know what to say regarding the error. Looks like it's something with your system but i'm not sure.

From what i understand you are running it on a PI. Which OS and what version are you using?

Homekitdude commented 2 years ago

Now my switches disappeared for Real Power and Art mode…I didnt do anything either, just disappeared after a few days.

bearreth commented 2 years ago

@tavicu I’m running Homebridge Raspbian v1.0.23 on Raspberry Pi 2 Model B Rev 1.1 :)

tavicu commented 2 years ago

Now my switches disappeared for Real Power and Art mode…I didnt do anything either, just disappeared after a few days.

The plugin probably didn't see the TV as a Frame when it booted. You could force the plugin to always see the TV as frame: https://github.com/tavicu/homebridge-samsung-tizen/issues/318#issuecomment-817726064

@tavicu I’m running Homebridge Raspbian v1.0.23 on Raspberry Pi 2 Model B Rev 1.1 :)

I am really sorry but don't know what to recommend. Something it's failing on the system when the Wake on Lan command is sent.