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

Error after adding configuration with plugin #56

Closed Seexelas closed 3 years ago

Seexelas commented 3 years ago

Describe your issue An error in the logs is showing for this plugin

Issue Context Freshly install plugin and configuration

  1. the homebridge logs, up from starting until the bug popped up there :

found a 'Panasonic VIErA' TV (TX-65GZ2000E) at '192.168.1.10' (requires crypto for comunication).

    at Accessory._this.addService (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:278:17)
    at PlatformAccessory.addService (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:92:41)
    at VieramaticPlatformAccessory.configureInputSource (/usr/local/lib/node_modules/homebridge-vieramatic/src/accessory.ts:376:35)
    at /usr/local/lib/node_modules/homebridge-vieramatic/src/accessory.ts:301:12
    at Proxy.forEach (<anonymous>)
    at new VieramaticPlatformAccessory (/usr/local/lib/node_modules/homebridge-vieramatic/src/accessory.ts:299:35)
    at VieramaticPlatform.deviceSetup (/usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:194:5)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at /usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:64:7
(Use `node --trace-warnings ...` to show where the warning was created)
(node:28122) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:28122) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code
  1. your homebridge's config.json contents.

    {
        "tvs": [
            {
                "friendlyName": "Galaxy-PanaTV",
                "ipAddress": "192.168.1.10",
                "encKey": "[edited]",
                "appId": "[edited]",
                "hdmiInputs": [
                    {
                        "id": "1",
                        "name": "HDMI 1"
                    },
                    {
                        "id": "2",
                        "name": "HDMI 2"
                    },
                    {
                        "id": "3",
                        "name": "HDMI 3"
                    },
                    {
                        "name": "HDMI 4"
                    }
                ],
                "customVolumeSlider": false
            }
        ],
        "platform": "PanasonicVieraTV"
    }

    ],

  2. the contents of accessories/vieramatic.json (path is relative to homebridge's datadir)

  3. Details about your specific homebridge setup

    • hardware and arch : Raspberry 3
    • Operating System and its version : 6.14.10
    • NodeJS version : 14.5.4
    • Homebridge version : 1.1.7
    • specific vieramatic version being used : the last version available
    • Viera TV(s) model(s) being used (and connectivity type being used wired/wireless) : 65GZ2000 - wireless
  4. anything else you may find relevant pre setup is working, but failed when Homebridge is reboot to apply config.

Thanks a lot for the help.

Best regards

Alex

AntonioMeireles commented 3 years ago

@Seexelas

could you check please if the following the steps here solve your issue ?

Seexelas commented 3 years ago

Hi Antonio,

I cleaned plugin + config, re added everything.

I checked as written in the post the : Unpair Bridges / Cameras / TVs / External Accessories, the TV is not showing here. I think with the error I have, the tv is not added in my Homebridge.

Error :

found a 'Panasonic VIErA' TV (TX-65GZ2000E) at '192.168.1.10' (requires crypto for comunication).

[13/01/2021, 18:44:11] [PanasonicVieraTV] adding HDMI input '1' - 'HDMI-1' as it was appended to config.json
[13/01/2021, 18:44:11] [PanasonicVieraTV] unsetting HDMI input '2' ['HDMI 2'] since it was dropped from the config.json
[13/01/2021, 18:44:11] [PanasonicVieraTV] unsetting HDMI input '2' ['Apple TV'] since it was dropped from the config.json
(node:7472) UnhandledPromiseRejectionWarning: Error: Cannot add a Service with the same UUID '000000D9-0000-1000-8000-0026BB765291' and subtype '1' as another Service in this Accessory.
    at Accessory._this.addService (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:281:17)
    at PlatformAccessory.addService (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:92:41)
    at VieramaticPlatformAccessory.configureInputSource (/usr/local/lib/node_modules/homebridge-vieramatic/src/accessory.ts:376:35)
    at /usr/local/lib/node_modules/homebridge-vieramatic/src/accessory.ts:301:12
    at Proxy.forEach (<anonymous>)
    at new VieramaticPlatformAccessory (/usr/local/lib/node_modules/homebridge-vieramatic/src/accessory.ts:299:35)
    at VieramaticPlatform.deviceSetup (/usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:194:5)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at /usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:64:7
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7472) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7472) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Thanks for the help.

AntonioMeireles commented 3 years ago

refollow the same steps but before restarting homebridge please also delete before the accessories/vieramatic.json file (path is relative to same dir where homebridge config.json is located). if it helps .

thanks for your patience!

Seexelas commented 3 years ago

Hi Antonio,

So I deleted the plugin, the configuration, went into ssh to delete the vieramatic.json.

Rebooted the HB instance + Raspberry, added the pluging, did the configuration and now it's working.

But if I do one modification into the plugin configuration, after the HB instance reboot, I get the same error again and I have to do the whole process again + the Unpair Bridges / Cameras / TVs / External Accessories and after that it is working again.

Thanks for the help you provided.

Best regards,

Alexis

AntonioMeireles commented 3 years ago

ok, progress. can you please provide a diff of the initial config.json versus the modded one that induces this error ?

thanks again for your patience!

Seexelas commented 3 years ago

Fow now, as said it is working, i won't modify the plugin again.

Here is the first time I configured the plugin :

{
     "tvs": [
         {
             "friendlyName": "Galaxy-PanaTV",
             "ipAddress": "192.168.1.10",
             "encKey": "[edited]",
             "appId": "[edited]",
             "hdmiInputs": [
                 {
                     "id": "1",
                     "name": "HDMI 1"
                 },
                 {
                     "id": "2",
                     "name": "HDMI 2"
                 },
                 {
                     "id": "3",
                     "name": "HDMI 3"
                 },
                 {
                     "name": "HDMI 4"
                 }
             ],
             "customVolumeSlider": false
         }
     ],
     "platform": "PanasonicVieraTV"
 }

Here is now :

       {
            "tvs": [
                {
                    "friendlyName": "Galaxy-PanasonicTV",
                    "ipAddress": "192.168.1.10",
                    "encKey": "[edited]",
                    "appId": "[edited]",
                    "hdmiInputs": [
                        {
                            "id": "1",
                            "name": "HDMI - 1"
                        },
                        {
                            "id": "2",
                            "name": "HDMI - 2"
                        },
                        {
                            "id": "3",
                            "name": "HDMI - 3"
                        },
                        {
                            "id": "4",
                            "name": "HDMI - 4"
                        }
                    ],
                    "customVolumeSlider": false
                }
            ],
            "platform": "PanasonicVieraTV"
        }
AntonioMeireles commented 3 years ago

Oh, it's all clear now - i missed the core issue from the start. It was the snippet bellow from your original config [from here] that was breaking things, as it missed the obviously required "id"field. [as it specs the HDMI port being used]

{
   "name": "HDMI 4"
}

Now, there's a real bug in my side too as that config shouldn't simply have loaded at all. Digging.

Seexelas commented 3 years ago

Glad we found something ^^

Thanks for your help :)

AntonioMeireles commented 3 years ago

@Seexelas

2.0.16 is out in non beta fashion and contains the fix for the core issue that was hitting you. will close this issue.

Please reopen if for some reason there are leftovers not fully covered.

thanks again for your patience!