tavicu / homebridge-samsung-tizen

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

"Cannot read properties of undefined" when trying to list applications #445

Closed tallytarik closed 2 years ago

tallytarik commented 2 years ago

First off, thanks for a great plugin! Setup was very simple, and just worked out of the box.

I wanted to add switches to launch apps, so I enabled 'List applications list' in the plugin config. This throws an error when Homebridge starts:

[18/12/2021, 12:02:45 pm] [Living Room TV] Cannot read properties of undefined (reading 'send')
[18/12/2021, 12:02:45 pm] [Living Room TV] [DEBUG] TypeError: Cannot read properties of undefined (reading 'send')
    at C:\Users\tallytarik\AppData\Roaming\npm\node_modules\homebridge-samsung-tizen\lib\methods\ws.js:81:60
    at new Promise (<anonymous>)
    at WebSocketSecure._send (C:\Users\tallytarik\AppData\Roaming\npm\node_modules\homebridge-samsung-tizen\lib\methods\ws.js:81:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at WebSocketSecure.getApplications (C:\Users\tallytarik\AppData\Roaming\npm\node_modules\homebridge-samsung-tizen\lib\methods\ws.js:58:9)

The plugin still works fine after this error - just fails to get the application list.

The TV is a 2019 QLED (QA65Q60RAWXXY). Let me know what else I can provide to help debugging.

tavicu commented 2 years ago

Hi. Possible your TV responds slower or something.

Did you check the wiki? We have a big list of app ids. https://github.com/tavicu/homebridge-samsung-tizen/wiki/Applications Something in particular that you don't find it in the list?

tallytarik commented 2 years ago

Yeah, could definitely be a problem with my TV.

The wiki had the app ID I needed :) just wanted to raise this issue in case someone else had seen this before, and maybe there was an easy fix.

MattRoe84 commented 2 years ago

i get the same issue and in the app it just shows as constantly updating or no response.

I have 2020 frame (bedroom) and 2019 frame (living room)both have same issue as you can see below in bold

[17/01/2022, 10:40:30] [Bedroom TV] [DEBUG] { data: {}, event: 'ms.channel.ready' } [17/01/2022, 10:40:30] [Bedroom TV] [DEBUG] { request: 'get_artmode_status' } [17/01/2022, 10:40:30] [Bedroom TV] [DEBUG] { data: '{\n' + ' "id": "d3f8171-60dd-4d8-b173-be615fe136cb",\n' + ' "event": "artmode_status",\n' + ' "value": "off",\n' + ' "target_client_id": "d3f8171-60dd-4d8-b173-be615fe136cb"\n' + '}', event: 'd2d_service_message', from: '934c1cbf-87ff-4cfb-86c1-63548eb568b' } [17/01/2022, 10:40:31] [Bedroom TV] [DEBUG] { data: '{\n' + ' "id": "d3f8171-60dd-4d8-b173-be615fe136cb",\n' + ' "event": "artmode_status",\n' + ' "value": "off",\n' + ' "target_client_id": "d3f8171-60dd-4d8-b173-be615fe136cb"\n' + '}', event: 'd2d_service_message', from: '934c1cbf-87ff-4cfb-86c1-63548eb568b' } [17/01/2022, 10:40:34] [Livingroom TV] [DEBUG] { request: 'get_artmode_status' } [17/01/2022, 10:40:34] [Livingroom TV] [DEBUG] { data: '{"id":"c55015a4-4ea2-4d4-9cce-240d8c2168","event":"artmode_status","value":"on","target_client_id":"c55015a4-4ea2-4d4-9cce-240d8c2168"}', event: 'd2d_service_message', from: 'd98b51b-d9dd-42ca-b381-586731d37db0' } [17/01/2022, 10:40:35] [Bedroom TV] [DEBUG] { request: 'get_artmode_status' } [17/01/2022, 10:40:35] [Bedroom TV] [DEBUG] { data: '{\n' + ' "id": "d3f8171-60dd-4d8-b173-be615fe136cb",\n' + ' "event": "artmode_status",\n' + ' "value": "off",\n' + ' "target_client_id": "d3f8171-60dd-4d8-b173-be615fe136cb"\n' + '}', event: 'd2d_service_message', from: '934c1cbf-87ff-4cfb-86c1-63548eb568b' } [17/01/2022, 10:40:37] [Bedroom TV] [DEBUG] { method: 'ms.channel.emit', params: { data: '', to: 'host', event: 'ed.installedApp.get' } } [17/01/2022, 10:40:37] [Bedroom TV] Cannot read properties of undefined (reading 'send') [17/01/2022, 10:40:37] [Bedroom TV] [DEBUG] TypeError: Cannot read properties of undefined (reading 'send') at /usr/local/lib/node_modules/homebridge-samsung-tizen/lib/methods/ws.js:81:60 at new Promise () at Frame._send (/usr/local/lib/node_modules/homebridge-samsung-tizen/lib/methods/ws.js:81:15) at processTicksAndRejections (node:internal/process/task_queues:96:5) at Frame.getApplications (/usr/local/lib/node_modules/homebridge-samsung-tizen/lib/methods/ws.js:58:9) [17/01/2022, 10:40:37] [Livingroom TV] [DEBUG] { method: 'ms.channel.emit', params: { data: '', to: 'host', event: 'ed.installedApp.get' } } [17/01/2022, 10:40:37] [Livingroom TV] Cannot read properties of undefined (reading 'send') [17/01/2022, 10:40:37] [Livingroom TV] [DEBUG] TypeError: Cannot read properties of undefined (reading 'send') at /usr/local/lib/node_modules/homebridge-samsung-tizen/lib/methods/ws.js:81:60 at new Promise () at Frame._send (/usr/local/lib/node_modules/homebridge-samsung-tizen/lib/methods/ws.js:81:15) at processTicksAndRejections (node:internal/process/task_queues:96:5) at Frame.getApplications (/usr/local/lib/node_modules/homebridge-samsung-tizen/lib/methods/ws.js:58:9) [17/01/2022, 10:40:39] [Livingroom TV] [DEBUG] { request: 'get_artmode_status' } [17/01/2022, 10:40:39] [Livingroom TV] [DEBUG] { data: '{"id":"c55015a4-4ea2-4d4-9cce-240d8c2168","event":"artmode_status","value":"on","target_client_id":"c55015a4-4ea2-4d4-9cce-240d8c2168"}', event: 'd2d_service_message', from: 'd98b51b-d9dd-42ca-b381-586731d37db0' } [17/01/2022, 10:40:40] [Bedroom TV] [DEBUG] { request: 'get_artmode_status' } [17/01/2022, 10:40:40] [Bedroom TV] [DEBUG] { data: '{\n' + ' "id": "d3f8171-60dd-4d8-b173-be615fe136cb",\n' + ' "event": "artmode_status",\n' + ' "value": "off",\n' + ' "target_client_id": "d3f8171-60dd-4d8-b173-be615fe136cb"\n' + '}', event: 'd2d_service_message', from: '934c1cbf-87ff-4cfb-86c1-63548eb568b' }

tavicu commented 2 years ago

Everything from that log it's ok with the exception of getting installed apps. This is possible because your TV it's newer and that endpoint was removed from the newer TVs.

In the next version of the plugin this feature will be removed also and we will have an improved Wiki that i hope to help better.

I will also check to see if there is a method to get installed apps with SmartThings API