AntonioMeireles / homebridge-vieramatic

Homebridge plugin for Panasonic™ Viera™ TVs (includes support for 2018 and later models)
Apache License 2.0
43 stars 9 forks source link

Plug In does not initialize #55

Closed GandhiII closed 3 years ago

GandhiII commented 3 years ago

Describe your issue A clear and concise description of what your issue is versus what you expected to happen.

Issue Context Please add the following items, when applicable:

  1. the homebridge logs, up from starting until the bug popped up there.
  2. your homebridge's config.json contents.
  3. the contents of accessories/vieramatic.json (path is relative to homebridge's datadir)
  4. Details about your specific homebridge setup
    • hardware and arch
    • Operating System and its version
    • NodeJS version
    • Homebridge version
    • specific vieramatic version being used
    • Viera TV(s) model(s) being used (and connectivity type being used wired/wireless)
  5. anything else you may find relevant
GandhiII commented 3 years ago

Always get this error message: TV is Viera DT50

[1/8/2021, 11:53:02 AM] [PanasonicVieraTV] Initializing PanasonicVieraTV platform...
[1/8/2021, 11:53:02 AM] [PanasonicVieraTV] handling 192.168.0.51 from config.json
found a 'Panasonic VIErA' TV (undefined) at '192.168.0.51' .

[1/8/2021, 11:53:03 AM] [PanasonicVieraTV] Initializing 'Viera Wohnzimmer' first time ever.
[1/8/2021, 11:53:03 AM] [PanasonicVieraTV] unable to fetch Apps list from the TV {
  error: Error: Request failed with status code 500
      at createError (/homebridge/node_modules/homebridge-vieramatic/node_modules/axios/lib/core/createError.js:16:15)
      at settle (/homebridge/node_modules/homebridge-vieramatic/node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (/homebridge/node_modules/homebridge-vieramatic/node_modules/axios/lib/adapters/http.js:260:11)
      at IncomingMessage.emit (events.js:327:22)
      at endReadableNT (internal/streams/readable.js:1327:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21) {
    config: {
      url: 'http://192.168.0.51:55000/nrc/control_0',
      method: 'post',
      data: '<?xml version="1.0" encoding="utf-8"?>  <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body> <u:X_GetAppList xmlns:u="urn:panasonic-com:service:p00NetworkControl:1"> None </u:X_GetAppList> </s:Body> </s:Envelope>',
      headers: [Object],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 3500,
      adapter: [Function: httpAdapter],
      responseType: 'text',
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      validateStatus: [Function: validateStatus]
    },
    request: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: null,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      socket: [Socket],
      _header: 'POST /nrc/control_0 HTTP/1.1\r\n' +
        'Accept: text/xml\r\n' +
        'Content-Type: text/xml; charset="utf-8"\r\n' +
        'Host: 192.168.0.51:55000\r\n' +
        'SOAPACTION: "urn:panasonic-com:service:p00NetworkControl:1#X_GetAppList"\r\n' +
        'Cache-Control: no-cache\r\n' +
        'Pragma: no-cache\r\n' +
        'User-Agent: axios/0.21.1\r\n' +
        'Content-Length: 293\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: noopPendingOutput],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/nrc/control_0',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: '192.168.0.51',
      protocol: 'http:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype]
    },
    response: {
      status: 500,
      statusText: 'Internal Server Error',
      headers: [Object],
      config: [Object],
      request: [ClientRequest],
      data: '<?xml version="1.0" encoding="utf-8"?>\n' +
        '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' +
        ' <s:Body>\n' +
        '  <s:Fault>\n' +
        '   <faultcode>s:Client</faultcode>\n' +
        '   <faultstring>UPnPError</faultstring>\n' +
        '   <detail>\n' +
        '    <UPnPError xmlns="urn:schemas-upnp-org:control-1-0">\n' +
        '     <errorCode>401</errorCode>\n' +
        '     <errorDescription>Invalid action</errorDescription>\n' +
        '    </UPnPError>\n' +
        '   </detail>\n' +
        '  </s:Fault>\n' +
        ' </s:Body>\n' +
        '</s:Envelope>\n'
    },
    isAxiosError: true,
    toJSON: [Function: toJSON]
  }
}
AntonioMeireles commented 3 years ago

hi @GandhiII

at sight this is on a 2012 model which may be just a bit too old.

two quick questions:

thanks in advance

GandhiII commented 3 years ago

HI Antonio,

yes the TV is on. yes I have some smart apps like Youtube and Netflix on the TV, but only a few which are very old and will not be updated by Panasonic

FPin65 commented 3 years ago

Hello guys i have exactly the same problem: TV is Viera VT50 (year 2012). the problem occurs both with the TV on and in stand-by; with any plugin configuration. i also have apps that haven't updated in a long time because the TV is dated the tv is correctly controlled by app "Panasonic TV Remote TV 3"

found a 'Panasonic VIErA' TV (undefined) at '192.168.1.3' .

[12/1/2021, 22:04:05] [PanasonicVieraTV] Initializing 'FyNet65-TV' first time ever.
[12/1/2021, 22:04:05] [PanasonicVieraTV] unable to fetch Apps list from the TV {
  error: Error: Request failed with status code 500
      at createError (/usr/local/lib/node_modules/homebridge-vieramatic/node_modules/axios/lib/core/createError.js:16:15)
      at settle (/usr/local/lib/node_modules/homebridge-vieramatic/node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-vieramatic/node_modules/axios/lib/adapters/http.js:260:11)
      at IncomingMessage.emit (events.js:327:22)
      at endReadableNT (internal/streams/readable.js:1327:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21) {
    config: {
      url: 'http://192.168.1.3:55000/nrc/control_0',
      method: 'post',
      data: '<?xml version="1.0" encoding="utf-8"?>  <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body> <u:X_GetAppList xmlns:u="urn:panasonic-com:service:p00NetworkControl:1"> None </u:X_GetAppList> </s:Body> </s:Envelope>',
      headers: [Object],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 3500,
      adapter: [Function: httpAdapter],
      responseType: 'text',
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      validateStatus: [Function: validateStatus]
    },
    request: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      _contentLength: null,
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      socket: [Socket],
      _header: 'POST /nrc/control_0 HTTP/1.1\r\n' +
        'Accept: text/xml\r\n' +
        'Content-Type: text/xml; charset="utf-8"\r\n' +
        'Host: 192.168.1.3:55000\r\n' +
        'SOAPACTION: "urn:panasonic-com:service:p00NetworkControl:1#X_GetAppList"\r\n' +
        'Cache-Control: no-cache\r\n' +
        'Pragma: no-cache\r\n' +
        'User-Agent: axios/0.21.1\r\n' +
        'Content-Length: 293\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: noopPendingOutput],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/nrc/control_0',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: '192.168.1.3',
      protocol: 'http:',
      _redirectable: [Writable],
      [Symbol(kCapture)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype]
    },
    response: {
      status: 500,
      statusText: 'Internal Server Error',
      headers: [Object],
      config: [Object],
      request: [ClientRequest],
      data: '<?xml version="1.0" encoding="utf-8"?>\n' +
        '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' +
        ' <s:Body>\n' +
        '  <s:Fault>\n' +
        '   <faultcode>s:Client</faultcode>\n' +
        '   <faultstring>UPnPError</faultstring>\n' +
        '   <detail>\n' +
        '    <UPnPError xmlns="urn:schemas-upnp-org:control-1-0">\n' +
        '     <errorCode>401</errorCode>\n' +
        '     <errorDescription>Invalid action</errorDescription>\n' +
        '    </UPnPError>\n' +
        '   </detail>\n' +
        '  </s:Fault>\n' +
        ' </s:Body>\n' +
        '</s:Envelope>\n'
    },
    isAxiosError: true,
    toJSON: [Function: toJSON]
  }
}

my config:

OS: Raspbian GNU/Linux Buster (10) node.js v14.15.4 num v6.14.10 homebridge v1.1.7 Raspberry Pi 4B v1.2 (BCM2711, 4GB)

thanks in advance

AntonioMeireles commented 3 years ago

OK,

at sight the issue is that the TV's API either does not expose the apps to the outside as the supported models or simply does not expose them.

what i can do here, and may or not be enough, is to add a new option to TV's config (which would be disabled by default) to simply disable at all polling of TV apps). with a bit of luck that may be just enough to support those oldish TV sets. expect that later this week.

thanks again for your patience!

FPin65 commented 3 years ago

@AntonioMeireles perfect!!!! thank you so much!!!!

AntonioMeireles commented 3 years ago

@FPin65

could you give a try to 2.0.16-beta.1 (needs to be installed manually as it's a pre-release via npm i homebridge-vieramatic@2.0.16-beta.1) and report back?

before restarting homebridge add "disabledAppSupport": true, to your TV's configuration in homebridge's config. (hopefully docs are clear)

thanks again for your patience!

GandhiII commented 3 years ago

Many thanks to you. Installed the beta version and had some problems with the configuration, but finally everything is working fine, except power on. Power off works. so many, many thanks for your fast support

AntonioMeireles commented 3 years ago

@GandhiII

great to hear! what's the problem with Power on btw?

GandhiII commented 3 years ago

I do know. It does also not work with the Panasonic app v2 or v3. May be it needs wake on lan. Will look at this later.

AntonioMeireles commented 3 years ago

humm... if it supports Wake On Lan plugin may be able to handle it (check the docs)

FPin65 commented 3 years ago

fantastic! it works!!! me too the tv does not turn on with the plugin but the same thing happens with the tv remote V3 app. really many many thanks! excellent work!

GandhiII commented 3 years ago

I added the MAC address as described, but nothing happens to switch it on. I am not sure if the TV has wake on lan, as it is not possible to switch it on with Panasonic apps

AntonioMeireles commented 3 years ago

@GandhiII

from quick googling it seems that your VT50 doesn't not support WakeOnLan :-( so nothing one could do afaik.

closing. please reopen if you feel that there are more room for improvement!

thanks again!