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

App ID & encKey not saved to config when adding TV #119

Open schwa23 opened 1 year ago

schwa23 commented 1 year ago

Describe your issue

I tried to add a TV via the Homebridge web ui, and after entering the ip address & the pairing code, there was an empty view displayed. I deleted

Issue Context

System info:

Raspbian GNU/Linux Buster (10)
nodejs v18.16.0
homebridge v1.6.0
homebridge-vieramatic v4.0.50

I was able to work around the issue by enabling debug logs.

I saw the following:

[15/04/2023, 09:20:28] [Homebridge UI] [homebridge-vieramatic] Incoming Request: /ping
[15/04/2023, 09:20:28] [Homebridge UI] [homebridge-vieramatic] ---> (ping) 192.168.0.34 true
[15/04/2023, 09:20:28] [Homebridge UI] [homebridge-vieramatic] Incoming Request: /specs
[15/04/2023, 09:20:28] [Homebridge UI] [homebridge-vieramatic] ---> (specs) 192.168.0.34
[15/04/2023, 09:20:28] [Homebridge UI] [homebridge-vieramatic] found a 'TH-55JZ2000' TV (TH-55JZ2000) at '192.168.0.34' (requires crypto for communication).
[15/04/2023, 09:20:28] [Homebridge UI] [homebridge-vieramatic] Incoming Request: /pin
[15/04/2023, 09:20:28] [Homebridge UI] [homebridge-vieramatic] ---> (pin request) 192.168.0.34
[15/04/2023, 09:20:29] [Homebridge UI] [homebridge-vieramatic] found a 'TH-55JZ2000' TV (TH-55JZ2000) at '192.168.0.34' (requires crypto for communication).
[15/04/2023, 09:20:35] [Homebridge UI] [homebridge-vieramatic] Incoming Request: /pair
[15/04/2023, 09:20:35] [Homebridge UI] [homebridge-vieramatic] ---> (pairing request) 192.168.0.34 2606 F08x5/XiwxuXnYNwyhXQnA==
[15/04/2023, 09:20:35] [Homebridge UI] [homebridge-vieramatic] found a 'TH-55JZ2000' TV (TH-55JZ2000) at '192.168.0.34' (requires crypto for communication).
[15/04/2023, 09:20:35] [Homebridge UI] [homebridge-vieramatic] ---> (pair) {
  value: [Object: null prototype] {
    appId: 'AVtmqHTaOA4hGw==',
    key: 'REDACTED'
  }
}
[15/04/2023, 09:20:35] [Homebridge UI] [homebridge-vieramatic] Incoming Request: /specs
[15/04/2023, 09:20:35] [Homebridge UI] [homebridge-vieramatic] ---> (specs) 192.168.0.34
[15/04/2023, 09:20:35] [Homebridge UI] [homebridge-vieramatic] found a 'TH-55JZ2000' TV (TH-55JZ2000) at '192.168.0.34' (requires crypto for communication).
[15/04/2023, 09:20:36] [Homebridge UI] [homebridge-vieramatic] found a 'TH-55JZ2000' TV (TH-55JZ2000) at '192.168.0.34' (requires crypto for communication).
[15/04/2023, 09:20:38] [Homebridge UI] Changes to config.json saved.
[15/04/2023, 09:20:38] [Homebridge UI] [homebridge-vieramatic] Terminating child process...
[15/04/2023, 09:20:38] [Homebridge UI] [homebridge-vieramatic] Child process ended
[15/04/2023, 09:20:42] [Homebridge UI] Starting terminal session
[15/04/2023, 09:20:44] [Homebridge UI] Terminal session ended.

While it says "config.json" was saved, when I looked at config.json, the vieramatic platform was nowhere to be found.

I was able to manually add the following to config.json and finally got it working: it seems the appId and encKey values were the most important part.

  {
            "platform": "PanasonicVieraTV",
            "tvs": [
                {
                    "friendlyName": "Panasonic TV",
                    "ipAddress": "192.168.0.34",
                    "hdmiInputs": [
                        {
                            "id": "1",
                            "name": "Apple TV"
                        },
                        {
                            "id": "2",
                            "name": "PS5"
                        }
                    ],
                    "appId": "AVtmqHTaOA4hGw==",
                    "encKey": "REDACTED",
                    "customVolumeSlider": true,
                    "disabledAppSupport": false
                }
            ]
        }

So it seems as though the Settings UI is not properly saving vieramatic's input to the config.json

DaveD-W commented 1 year ago

Same issue for me, enabling the debug mode allowed me to create the entry and get it working, but it didn't auto populate the config file.

Also doesn't show any details when trying to click through to the TV now it is setup within plugins > Panasonic™ Viera™ TVs support > settings

jat80 commented 4 months ago

118 some more info here to get it working