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

Homebridge crashes - "Accessories must be created with a valid UUID" #90

Open bsoener opened 2 years ago

bsoener commented 2 years ago

I have a problem this plugin. My homebridge crashes unfortunately. Anyone have an idea what this can be?

[17/01/2022, 15:47:49] [PanasonicVieraTV] Unable to fetch specs from TV at '192.168.178.115'.
[17/01/2022, 15:47:49] [PanasonicVieraTV] Using the previously cached ones:

 {"friendlyName":"Viera ","manufacturer":"Panasonic","modelName":"Panasonic VIErA","modelNumber":"WT60","requiresEncryption":false,"serialNumber":"4D454930-0200-1000-8001-20C6EBC536E5"}
[17/01/2022, 15:47:52] AssertionError [ERR_ASSERTION]: Accessories must be created with a valid UUID.
    at new Accessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:418:11)
    at new PlatformAccessory (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:70:9)
    at Ae.<anonymous> (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:131:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Ae.discoverDevices (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:67:23)
    at HomebridgeAPI.<anonymous> (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:39:7)
[17/01/2022, 15:47:52] Got SIGTERM, shutting down Homebridge...
 {
            "tvs": [
                {
                    "friendlyName": "Viera ",
                    "ipAddress": "192.168.178.115",
                    "mac": "xx:xx:xx:xx:xx:xx",
                    "hdmiInputs": [
                        {
                            "id": "1",
                            "name": "Denon"
                        },
                        {
                            "id": "2",
                            "name": "PS5"
                        }
                    ],
                    "disabledAppSupport": false,
                    "customVolumeSlider": true
                }
            ],
            "platform": "PanasonicVieraTV"
        },
AntonioMeireles commented 2 years ago

@bsoener need to think on this... :| - will get back to you tommorrow!

@tjm7844 - quick question - you also set a mac address right in homebridge config.json, right ?

THANKS ALL for your patience!

tjm7844 commented 2 years ago

Yes - I manually set the MAC in the config. Apologies for the delay, I haven't had access to the TV, and then had some issues installing the beta version. I definitely confirmed the UUID message was only coming up when restarting with the TV off.

I've actually done a fair bit of work with this generation of sets in pre-homebridge apps (iRule, Roomie remote, etc), and WOL is the only mechanism I'm aware of to power on the set (and therefore needs the MAC, and also only works hardwired).

bsoener commented 2 years ago

Tomorrow we continue

AntonioMeireles commented 2 years ago

@bsoener , @tjm7844

just pushed (again as beta) homebridge-vieramatic@4.0.13 (consumable by npm i homebridge-vieramatic@4.0.13 followed by an homebridge restart). It 's a bit more noisier and should help us to isolate core remaining issue.

So, could you please install it and after restarting homebridge attach here the homebridge console logs (both from homebridge startup and around attempts to turn TV ON/OFF via homekit (with both the TV powered ON and off)

thanks!

bsoener commented 2 years ago
[20/01/2022, 16:24:54] [PanasonicVieraTV] Unable to fetch specs from TV at '192.168.178.115'.
[20/01/2022, 16:24:54] [PanasonicVieraTV] Using the previously cached ones:

 {
  "friendlyName": "Viera",
  "manufacturer": "Panasonic",
  "modelName": "Panasonic VIErA",
  "modelNumber": "WT60",
  "requiresEncryption": false,
  "serialNumber": "4D454930-0200-1000-8001-20C6EBC3C18D"
}
[20/01/2022, 16:24:57] [PanasonicVieraTV] userConfig {
  "friendlyName": "Viera ",
  "ipAddress": "192.168.178.115",
  "mac": "xx:xx:xx:xx:xx:xx",
  "hdmiInputs": [
    {
      "id": "1",
      "name": "Denon"
    },
    {
      "id": "2",
      "name": "PS5"
    }
  ],
  "disabledAppSupport": false,
  "customVolumeSlider": true
}
[20/01/2022, 16:24:57] [PanasonicVieraTV] accessory.context.device {
  "address": "192.168.178.115",
  "mac": "C0:D9:62:D3:BE:C1",
  "apps": {
    "error": {
      "code": "EHOSTUNREACH",
      "timings": {
        "start": 1642692294423,
        "socket": 1642692294424,
        "error": 1642692297521,
        "phases": {
          "wait": 1,
          "total": 3098
        }
      },
      "name": "RequestError",
      "options": {
        "agent": {},
        "decompress": true,
        "timeout": {
          "request": 3500
        },
        "prefixUrl": "",
        "body": "<?xml version=\"1.0\" encoding=\"utf-8\"?><s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><u:X_GetAppList xmlns:u=\"urn:panasonic-com:service:p00NetworkControl:1\">None</u:X_GetAppList></s:Body></s:Envelope>",
        "ignoreInvalidCookies": false,
        "context": {},
        "hooks": {
          "init": [],
          "beforeRequest": [],
          "beforeError": [],
          "beforeRedirect": [],
          "beforeRetry": [],
          "afterResponse": []
        },
        "followRedirect": true,
        "maxRedirects": 10,
        "throwHttpErrors": true,
        "username": "",
        "password": "",
        "http2": false,
        "allowGetBody": false,
        "headers": {
          "user-agent": "got (https://github.com/sindresorhus/got)",
          "accept": "application/xml",
          "cache-control": "no-cache",
          "content-type": "application/xml; charset=\"utf-8\"",
          "host": "192.168.178.115:55000",
          "pragma": "no-cache",
          "soapaction": "\"urn:panasonic-com:service:p00NetworkControl:1#X_GetAppList\"",
          "content-length": "285",
          "accept-encoding": "gzip, deflate, br"
        },
        "methodRewriting": false,
        "retry": {
          "limit": 0,
          "methods": [
            "GET",
            "PUT",
            "HEAD",
            "DELETE",
            "OPTIONS",
            "TRACE"
          ],
          "statusCodes": [
            408,
            413,
            429,
            500,
            502,
            503,
            504,
            521,
            522,
            524
          ],
          "errorCodes": [
            "ETIMEDOUT",
            "ECONNRESET",
            "EADDRINUSE",
            "ECONNREFUSED",
            "EPIPE",
            "ENOTFOUND",
            "ENETUNREACH",
            "EAI_AGAIN"
          ],
          "backoffLimit": null,
          "noise": 100
        },
        "method": "POST",
        "cacheOptions": {},
        "https": {},
        "resolveBodyOnly": false,
        "isStream": false,
        "responseType": "text",
        "url": "http://192.168.178.115:55000/nrc/control_0",
        "pagination": {
          "countLimit": null,
          "backoff": 0,
          "requestLimit": 10000,
          "stackAllItems": false
        },
        "setHost": true
      }
    }
  },
  "auth": {},
  "specs": {
    "friendlyName": "Viera",
    "manufacturer": "Panasonic",
    "modelName": "Panasonic VIErA",
    "modelNumber": "WT60",
    "requiresEncryption": false,
    "serialNumber": "4D454930-0200-1000-8001-20C6EBC3C18D"
  }
}
[20/01/2022, 16:24:57] [PanasonicVieraTV] Using previously cached App listing.
[20/01/2022, 16:24:57] [PanasonicVieraTV] successfully loaded Viera
[20/01/2022, 16:24:57] Viera ED82 is running on port 35697.
AntonioMeireles commented 2 years ago

@bsoener

Thanks! afterwards, when you try to turn TV ON/OFF you should also get some output... attach it please. hopefully answer will be somewhere there ...

bsoener commented 2 years ago

I'll turn on the TV and report back in a moment.

bsoener commented 2 years ago

off status:

[20/01/2022, 16:40:24] [Homebridge UI] [homebridge-vieramatic] found a 'Panasonic VIErA' TV (WT60) at '192.168.178.115' .
[20/01/2022, 16:40:30] [Homebridge UI] [homebridge-vieramatic] Terminating child process...
[20/01/2022, 16:40:30] [Homebridge UI] [homebridge-vieramatic] Child process ended
[20/01/2022, 16:41:17] [PanasonicVieraTV] (setPowerStatus) this.device: {
  "address": "192.168.178.115",
  "mac": "xx:xx:xx:xx:xx:xx",
  "apps": {
    "error": {
      "code": "EHOSTUNREACH",
      "timings": {
        "start": 1642692294423,
        "socket": 1642692294424,
        "error": 1642692297521,
        "phases": {
          "wait": 1,
          "total": 3098
        }
      },
      "name": "RequestError",
      "options": {
        "agent": {},
        "decompress": true,
        "timeout": {
          "request": 3500
        },
        "prefixUrl": "",
        "body": "<?xml version=\"1.0\" encoding=\"utf-8\"?><s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><u:X_GetAppList xmlns:u=\"urn:panasonic-com:service:p00NetworkControl:1\">None</u:X_GetAppList></s:Body></s:Envelope>",
        "ignoreInvalidCookies": false,
        "context": {},
        "hooks": {
          "init": [],
          "beforeRequest": [],
          "beforeError": [],
          "beforeRedirect": [],
          "beforeRetry": [],
          "afterResponse": []
        },
        "followRedirect": true,
        "maxRedirects": 10,
        "throwHttpErrors": true,
        "username": "",
        "password": "",
        "http2": false,
        "allowGetBody": false,
        "headers": {
          "user-agent": "got (https://github.com/sindresorhus/got)",
          "accept": "application/xml",
          "cache-control": "no-cache",
          "content-type": "application/xml; charset=\"utf-8\"",
          "host": "192.168.178.115:55000",
          "pragma": "no-cache",
          "soapaction": "\"urn:panasonic-com:service:p00NetworkControl:1#X_GetAppList\"",
          "content-length": "285",
          "accept-encoding": "gzip, deflate, br"
        },
        "methodRewriting": false,
        "retry": {
          "limit": 0,
          "methods": [
            "GET",
            "PUT",
            "HEAD",
            "DELETE",
            "OPTIONS",
            "TRACE"
          ],
          "statusCodes": [
            408,
            413,
            429,
            500,
            502,
            503,
            504,
            521,
            522,
            524
          ],
          "errorCodes": [
            "ETIMEDOUT",
            "ECONNRESET",
            "EADDRINUSE",
            "ECONNREFUSED",
            "EPIPE",
            "ENOTFOUND",
            "ENETUNREACH",
            "EAI_AGAIN"
          ],
          "backoffLimit": null,
          "noise": 100
        },
        "method": "POST",
        "cacheOptions": {},
        "https": {},
        "resolveBodyOnly": false,
        "isStream": false,
        "responseType": "text",
        "url": "http://192.168.178.115:55000/nrc/control_0",
        "pagination": {
          "countLimit": null,
          "backoff": 0,
          "requestLimit": 10000,
          "stackAllItems": false
        },
        "setHost": true
      }
    }
  },
  "auth": {},
  "specs": {
    "friendlyName": "Viera",
    "manufacturer": "Panasonic",
    "modelName": "Panasonic VIErA",
    "modelNumber": "WT60",
    "requiresEncryption": false,
    "serialNumber": "4D454930-0200-1000-8001-20C6EBC3C18D"
  }
}
[20/01/2022, 16:41:17] [PanasonicVieraTV] (setPowerStatus) this.userConfig: {
  "friendlyName": "Viera ",
  "ipAddress": "192.168.178.115",
  "mac": "xx:xx:xx:xx:xx:xx",
  "hdmiInputs": [
    {
      "id": "1",
      "name": "Denon"
    },
    {
      "id": "2",
      "name": "PS5"
    }
  ],
  "disabledAppSupport": false,
  "customVolumeSlider": true
}
[20/01/2022, 16:41:17] [PanasonicVieraTV] (setPowerStatus) 0 true
[20/01/2022, 16:41:17] [PanasonicVieraTV] Turned TV into STANDBY
AntonioMeireles commented 2 years ago

and TV went in Standby (at sigth this looks good so far)? afterwards were you able to get it back ON ? (either yes or no logs please)

bsoener commented 2 years ago

on status:

[20/01/2022, 16:43:30] [PanasonicVieraTV] (setPowerStatus) this.device: {
  "address": "192.168.178.115",
  "mac": "xx:xx:xx:xx:xx:xx",
  "apps": {
    "error": {
      "code": "EHOSTUNREACH",
      "timings": {
        "start": 1642692294423,
        "socket": 1642692294424,
        "error": 1642692297521,
        "phases": {
          "wait": 1,
          "total": 3098
        }
      },
      "name": "RequestError",
      "options": {
        "agent": {},
        "decompress": true,
        "timeout": {
          "request": 3500
        },
        "prefixUrl": "",
        "body": "<?xml version=\"1.0\" encoding=\"utf-8\"?><s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><u:X_GetAppList xmlns:u=\"urn:panasonic-com:service:p00NetworkControl:1\">None</u:X_GetAppList></s:Body></s:Envelope>",
        "ignoreInvalidCookies": false,
        "context": {},
        "hooks": {
          "init": [],
          "beforeRequest": [],
          "beforeError": [],
          "beforeRedirect": [],
          "beforeRetry": [],
          "afterResponse": []
        },
        "followRedirect": true,
        "maxRedirects": 10,
        "throwHttpErrors": true,
        "username": "",
        "password": "",
        "http2": false,
        "allowGetBody": false,
        "headers": {
          "user-agent": "got (https://github.com/sindresorhus/got)",
          "accept": "application/xml",
          "cache-control": "no-cache",
          "content-type": "application/xml; charset=\"utf-8\"",
          "host": "192.168.178.115:55000",
          "pragma": "no-cache",
          "soapaction": "\"urn:panasonic-com:service:p00NetworkControl:1#X_GetAppList\"",
          "content-length": "285",
          "accept-encoding": "gzip, deflate, br"
        },
        "methodRewriting": false,
        "retry": {
          "limit": 0,
          "methods": [
            "GET",
            "PUT",
            "HEAD",
            "DELETE",
            "OPTIONS",
            "TRACE"
          ],
          "statusCodes": [
            408,
            413,
            429,
            500,
            502,
            503,
            504,
            521,
            522,
            524
          ],
          "errorCodes": [
            "ETIMEDOUT",
            "ECONNRESET",
            "EADDRINUSE",
            "ECONNREFUSED",
            "EPIPE",
            "ENOTFOUND",
            "ENETUNREACH",
            "EAI_AGAIN"
          ],
          "backoffLimit": null,
          "noise": 100
        },
        "method": "POST",
        "cacheOptions": {},
        "https": {},
        "resolveBodyOnly": false,
        "isStream": false,
        "responseType": "text",
        "url": "http://192.168.178.115:55000/nrc/control_0",
        "pagination": {
          "countLimit": null,
          "backoff": 0,
          "requestLimit": 10000,
          "stackAllItems": false
        },
        "setHost": true
      }
    }
  },
  "auth": {},
  "specs": {
    "friendlyName": "Viera",
    "manufacturer": "Panasonic",
    "modelName": "Panasonic VIErA",
    "modelNumber": "WT60",
    "requiresEncryption": false,
    "serialNumber": "4D454930-0200-1000-8001-20C6EBC3C18D"
  }
}
[20/01/2022, 16:43:30] [PanasonicVieraTV] (setPowerStatus) this.userConfig: {
  "friendlyName": "Viera ",
  "ipAddress": "192.168.178.115",
  "mac": "xx:xx:xx:xx:xx:xx",
  "hdmiInputs": [
    {
      "id": "1",
      "name": "Denon"
    },
    {
      "id": "2",
      "name": "PS5"
    }
  ],
  "disabledAppSupport": false,
  "customVolumeSlider": true
}
[20/01/2022, 16:43:30] [PanasonicVieraTV] (setPowerStatus) 1 false
[20/01/2022, 16:43:30] [PanasonicVieraTV] sending WOL packets to awake TV
[20/01/2022, 16:43:31] [PanasonicVieraTV] Turned TV ON
bsoener commented 2 years ago

When switching on, the on button goes back to off. So it does not turn on

AntonioMeireles commented 2 years ago

@bsoener, your homebridge server is same network / vlan as TV right ?

if so issue identified (afaict) - with the move to ESM the wol lib we consume seems to have stopped behaving. let me digg on this a bit more. apparently issue identified now.

Thanks yet again!

bsoener commented 2 years ago

So it tried with lan and wifi, unfortunately with both the problem that I can not turn off the TV. if you find ne solution for this would be great.

AntonioMeireles commented 2 years ago

So it tried with lan and wifi, unfortunately with both the problem that I can not turn off the TV. if you find ne solution for this would be great.

sorry, got lost, now. "TURN OFF" ? or "TURN ON". if i understood things correctly (when TV is off) you can't wake it up. but if it is ON it should go OFF normally, no ?

(if there is an issue with powering it OFF, can you attach corresponding logs too ?)

bsoener commented 2 years ago

So I can turn off the TV. I can't turn it on. I will try it again later.

AntonioMeireles commented 2 years ago

@bsoener, @tjm7844

test both please homebridge-vieramatic@4.0.14 (tagged again as beta and consumable by npm i homebridge-vieramatic@4.0.14 followed by an homebridge restart)

IF i'm right it has the fix for this issue... please confirm (crossing fingers)

All the best,

António

bsoener commented 2 years ago

I turned on the TV with the remote control. On the home app it shows off. On/off button no longer responds.

AntonioMeireles commented 2 years ago

OK, progress!. attach matching logs plz. i suspect now the issue is a timings one... your TV is oldish and just takes a bit to wake up and we may need to accomodate that.

bsoener commented 2 years ago

The TV is only 6 years old and is still in very good condition :D

tjm7844 commented 2 years ago

Currently having issues discovering the set within Homebridge, so I'm going to work through that (can't test actual functionality without that, clearly). Thanks to both of you for continuing to work through it!

AntonioMeireles commented 2 years ago

@bsoener, @tjm7844

please give a try to test just released homebridge-vieramatic@4.0.16 (tagged again as beta and consumable by npm i homebridge-vieramatic@4.0.16 followed by an homebridge restart) and report back on its overall behaviour (with logs attached)

Thanks in advance!

tjm7844 commented 2 years ago

Question: after running the manual version install command, should the new version be reflected in either HomebridgeUI or the logs? I'm seeing package changes on the install, but the version numbers aren't updating anywhere else. If there's a command to manually check the version of a specific plugin from the command line, I haven't found it yet...Want to make sure I'm on the correct version (I haven't seen any behavior changes yet, but I still haven't gotten my TV to be re-paired into Homebridge, so am just looking at the log entries. I'm planning on wiping my config for this set and trying everything from scratch, but in the meantime would like to be able to ensure the code I have is actually up to date :)

AntonioMeireles commented 2 years ago

you can see installed versions in HomebridgeUI per

image

npm ls gives you the installed versions on the cli.

btw, what issues are you experiencing when re-pairing your TV ?

bsoener commented 2 years ago

Hi. Thank you for your effort. I have now installed the latest version and unfortunately I can not turn on my TV.

AntonioMeireles commented 2 years ago

Hi. Thank you for your effort. I have now installed the latest version and unfortunately I can not turn on my TV.

attach logs please, we're getting close(r). also, can you email me (email is the one in git commit logs) directly to see if we can arrange an off-line faster low-latency way to finish debugging this ? :-)

All the best,

António

tjm7844 commented 2 years ago

you can see installed versions in HomebridgeUI per

image

npm ls gives you the installed versions on the cli.

btw, what issues are you experiencing when re-pairing your TV ?

The TV just isn't coming up as an accessory. I expect this has something to do with my moving it to a child bridge and then back again, but monkeying with the vieramatic.json files in there probably didn't help matters. As I mentioned, I'm going to try a full uninstall of the package, clearing out the config/vieramatic.json cache/etc, and see if that helps matters.

To the matter at hand, when I run the npm i homebridge-vieramatic@version command, my UI isn't updating the version number, so it would seem something isn't quite clicking there.

AntonioMeireles commented 2 years ago

To the matter at hand, when I run the npm i homebridge-vieramatic@version command, my UI isn't updating the version number, so it would seem something isn't quite clicking there.

you need to restart homebridge for the change to have effect.

tjm7844 commented 2 years ago

Yeah, I have been. It even shows a package having been changed when I run the update, but the UI doesn't show the new version (hence why I manually wanted to check from the command line)

AntonioMeireles commented 2 years ago

humm, depending on your setup you may need to run npm i homebridge-vieramatic@version -g to install globally.

tjm7844 commented 2 years ago

Could be that. I'm running on a debian VM running on an ESXI host, but have done everything standard per the docs. I'll give that a try after I flush out the old data and reinstall.

AntonioMeireles commented 2 years ago

Could be that. I'm running on a debian VM running on an ESXI host, but have done everything standard per the docs. I'll give that a try after I flush out the old data and reinstall.

@tjm7844, please do make sure that you do not have any firewall between your homebridge VM and your TVs blocking (UDP) port 9 (as otherwise the WOL magic packets won't ever hit the TV)

tjm7844 commented 2 years ago

I'll verify, but I don't expect that's an issue as WOL had never been my problem. Off was my issue :)

bsoener commented 2 years ago

On the homeapp I press the on button and on the log from the homebridge only this log appears. After a short time this on button on the homeapp jumps back to off.

[21/01/2022, 20:17:06] [PanasonicVieraTV] (setPowerStatus) 1 false
[21/01/2022, 20:17:06] [PanasonicVieraTV] sending WOL packets to awake TV
[21/01/2022, 20:17:08] [PanasonicVieraTV] Turned TV ON

Restart log I get this:

[21/01/2022, 20:20:25] [PanasonicVieraTV] Unable to fetch specs from TV at '192.168.178.115'.
[21/01/2022, 20:20:25] [PanasonicVieraTV] Using the previously cached ones:

 {
  "friendlyName": "Viera",
  "manufacturer": "Panasonic",
  "modelName": "Panasonic VIErA",
  "modelNumber": "WT60",
  "requiresEncryption": false,
  "serialNumber": "4D454930-0200-1000-8001-20C6EBC3C18D"
}
[21/01/2022, 20:20:25] [PanasonicVieraTV] userConfig {
  "friendlyName": "Viera ",
  "ipAddress": "192.168.178.115",
  "mac": "xx:xx:xx:xx:xx:xx",
  "hdmiInputs": [
    {
      "id": "1",
      "name": "Denon"
    },
    {
      "id": "2",
      "name": "PS5"
    }
  ],
  "disabledAppSupport": false,
  "customVolumeSlider": true
}
[21/01/2022, 20:20:25] [PanasonicVieraTV] accessory.context.device {
  "address": "192.168.178.115",
  "apps": {
    "error": {
      "code": "EHOSTUNREACH",
      "timings": {
        "start": 1642792825122,
        "socket": 1642792825124,
        "error": 1642792825201,
        "phases": {
          "wait": 2,
          "total": 79
        }
      },
      "name": "RequestError",
      "options": {
        "agent": {},
        "decompress": true,
        "timeout": {
          "request": 1500
        },
        "prefixUrl": "",
        "body": "<?xml version=\"1.0\" encoding=\"utf-8\"?><s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><u:X_GetAppList xmlns:u=\"urn:panasonic-com:service:p00NetworkControl:1\">None</u:X_GetAppList></s:Body></s:Envelope>",
        "ignoreInvalidCookies": false,
        "context": {},
        "hooks": {
          "init": [],
          "beforeRequest": [],
          "beforeError": [],
          "beforeRedirect": [],
          "beforeRetry": [],
          "afterResponse": []
        },
        "followRedirect": true,
        "maxRedirects": 10,
        "throwHttpErrors": true,
        "username": "",
        "password": "",
        "http2": false,
        "allowGetBody": false,
        "headers": {
          "user-agent": "got (https://github.com/sindresorhus/got)",
          "accept": "application/xml",
          "cache-control": "no-cache",
          "content-type": "application/xml; charset=\"utf-8\"",
          "host": "192.168.178.115:55000",
          "pragma": "no-cache",
          "soapaction": "\"urn:panasonic-com:service:p00NetworkControl:1#X_GetAppList\"",
          "content-length": "285",
          "accept-encoding": "gzip, deflate, br"
        },
        "methodRewriting": false,
        "retry": {
          "limit": 0,
          "methods": [
            "GET",
            "PUT",
            "HEAD",
            "DELETE",
            "OPTIONS",
            "TRACE"
          ],
          "statusCodes": [
            408,
            413,
            429,
            500,
            502,
            503,
            504,
            521,
            522,
            524
          ],
          "errorCodes": [
            "ETIMEDOUT",
            "ECONNRESET",
            "EADDRINUSE",
            "ECONNREFUSED",
            "EPIPE",
            "ENOTFOUND",
            "ENETUNREACH",
            "EAI_AGAIN"
          ],
          "backoffLimit": null,
          "noise": 100
        },
        "method": "POST",
        "cacheOptions": {},
        "https": {},
        "resolveBodyOnly": false,
        "isStream": false,
        "responseType": "text",
        "url": "http://192.168.178.115:55000/nrc/control_0",
        "pagination": {
          "countLimit": null,
          "backoff": 0,
          "requestLimit": 10000,
          "stackAllItems": false
        },
        "setHost": true
      }
    }
  },
  "auth": {},
  "specs": {
    "friendlyName": "Viera",
    "manufacturer": "Panasonic",
    "modelName": "Panasonic VIErA",
    "modelNumber": "WT60",
    "requiresEncryption": false,
    "serialNumber": "4D454930-0200-1000-8001-20C6EBC3C18D"
  }
}
[21/01/2022, 20:20:25] [PanasonicVieraTV] Using previously cached App listing.
[21/01/2022, 20:20:25] [PanasonicVieraTV] successfully loaded Viera
[21/01/2022, 20:20:25] Viera ED82 is running on port 38483.
[21/01/2022, 20:20:25] Please add [Viera ED82] manually in Home app. Setup Code: xxx-xx-xxx
AntonioMeireles commented 2 years ago

@bsoener

OK, issue at macro level is ...

so basically we're expecting that the between receiving the magic packets and becoming responsive (at API level) the TV won't take longer than 2seconds. which according to you isn't being the case.

At the same time, each 5secs we refresh TVs state (so even if it takes longer than 2 secs for TV to become responsive) at next refresh we'd expect it would be detected as up...

This is why we need a more spedite way of debugging this :-) (just email me ;-) )

tjm7844 commented 2 years ago

@AntonioMeireles, thank you. The global flag was what was necessary to get the beta version installed for me. It's now showing correctly in the UI. Also, purging the plugin entirely, making sure all the various caches were removed, etc, allowed me to find and re-pair the set to homebridge.

It appears that I'm seeing similar logs to @bsoener on restart/attempting to WOL. I'm happy to email them if you'd like to see them.

Also, if it's helpful, I just did a (very unscientific) test of my TV's startup time using my phone's stopwatch, and it appears to be roughly 6.5-7 seconds (6.63, 6.51 in my two tests).

AntonioMeireles commented 2 years ago

@tjm7844

7secs ! ouch. even so, after those 7secs TV should then appear as ON to homekit ... can you mail me ... i just need some spedited way to debug this ...

bsoener commented 2 years ago

What exactly do you need from me? Where is your email address?

AntonioMeireles commented 2 years ago

What exactly do you need from me? Where is your email address?

@bsoener

Hi, morning!

a priori i already have all info i need. I did a live debug session on @tjm7844 's TV set last night. but THANKS!...

I'll push soonish a new version with more polish and more fixed issues.

AntonioMeireles commented 2 years ago

@bsoener, @tjm7844

please update and give a try to just released homebridge-vieramatic@4.0.17 (tagged again as beta and consumable by npm i homebridge-vieramatic@4.0.17 -g followed by an homebridge restart) and report back on its overall behaviour.

it should fix the issue of TV being ON but not being recognized as that (after being awaken) by the plugin (just found last night that older TVs advertise their availability in a slightly different way than recent ones). It should also workaround a strange issue we've found regarding WOL behaviour (which doesn't seem exactly the same in all platforms (!)).

A great weekend for you all, and many thanks for your patience!

Thanks in advance!

António

bsoener commented 2 years ago

Latest version installed. Unfortunately, my TV does not wake up. on the Hombridge log comes unfortunately no message.


[22/01/2022, 14:46:01] [PanasonicVieraTV] Unable to fetch specs from TV at '192.168.178.115'.
[22/01/2022, 14:46:01] [PanasonicVieraTV] Using the previously cached ones:

 {
  "friendlyName": "Viera",
  "manufacturer": "Panasonic",
  "modelName": "Panasonic VIErA",
  "modelNumber": "WT60",
  "requiresEncryption": false,
  "serialNumber": "4D454930-0200-1000-8001-20C6EBC3C18D"
}
[22/01/2022, 14:46:01] [PanasonicVieraTV] Using previously cached App listing.
[22/01/2022, 14:46:01] [PanasonicVieraTV] successfully loaded Viera
[22/01/2022, 14:46:01] Viera ED82 is running on port 36021.
AntonioMeireles commented 2 years ago

@bsoener

sorry to hear that. let's wait a bit for @tjm7844 feedback. if i hadn't make any aditional mistake (and his TV behaves) that means your TV is from yet another generation with slight different behaviout we'd need to accomodate ...

tjm7844 commented 2 years ago

Sorry for the delay! TV has been in use this morning and just had a chance to test :) Everything still appears to be working fine for me after the update to 4.0.17. @AntonioMeireles, I never did unlink from your live code changes, but the update did appear to process and shows the new version.

Just want to confirm that I am set up correctly so my feedback is representative.

Also, there is some new behavior that we found while testing this version, wherein the TV will turn on, then the HomeKit tile flips to off, and then corrects itself back to on. Just so anyone who is reading this is aware.

AntonioMeireles commented 2 years ago

@tjm7844

quick question - is you TV connect to the network via wired or wirelessly ?

tjm7844 commented 2 years ago

Wired - this generation of sets doesn't support WOL from a wireless connection.

AntonioMeireles commented 2 years ago

@bsoener

and yours ? wired or wirelessly ?

bsoener commented 2 years ago

currently via wifi

bsoener commented 2 years ago

I will try later via lan. then give feedback

AntonioMeireles commented 2 years ago

@bsoener

do plz... will publish soon an hack that may make it behave both ways (crossing fingers)

bsoener commented 2 years ago

connected via lan and sorry does not go on and off

AntonioMeireles commented 2 years ago

@tjm7844

please report on just pushed homebridge-vieramatic@4.0.18. i now use an handmade WOL function. if i did it right it things should continue working for wired TV sets (i.e. they should still be wakable as in 4.0.17). OTOH sets connected wirelessly should also wake up now (if all will do, or only recent ones dunno yet).