normen / homebridge-bravia

Homebridge plugin for Sony Bravia TVs (AndroidTV based ones and possibly others)
139 stars 26 forks source link

Getting less than 5 seconds to enter PIN and Homebridge reboots #138

Closed jckblack closed 3 years ago

jckblack commented 3 years ago

I see the PIN show up on the TV, but the Homebridge reboots before I can enter the PIN. It becomes an infinite loop until I remove the Bravia plugin.

[02/11/2020, 14:53:27] Got SIGTERM, shutting down Homebridge... [02/11/2020, 14:53:27] [BraviaPlatform] Need to authenticate with TV! [02/11/2020, 14:53:27] [BraviaPlatform] Please enter the PIN that appears on your TV at http://homebridge:8999 [02/11/2020, 14:53:27] [BraviaPlatform] PIN entry web server listening [02/11/2020, 14:53:32] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [02/11/2020, 14:53:37] [HB Supervisor] Restarting Homebridge... [02/11/2020, 14:53:37] [HB Supervisor] Starting Homebridge with extra flags: -I [02/11/2020, 14:53:37] [HB Supervisor] Started Homebridge v1.1.6 with PID: 769 [02/11/2020, 14:53:38] Loaded config.json with 0 accessories and 3 platforms. [02/11/2020, 14:53:38] --- [02/11/2020, 14:53:40] Loaded plugin: homebridge-bravia@2.4.6 [02/11/2020, 14:53:40] Registering platform 'homebridge-bravia.BraviaPlatform' [02/11/2020, 14:53:40] --- [02/11/2020, 14:53:40] Loaded plugin: homebridge-config-ui-x@4.31.0 [02/11/2020, 14:53:40] Registering platform 'homebridge-config-ui-x.config' [02/11/2020, 14:53:40] --- [02/11/2020, 14:53:40] Loaded plugin: homebridge-tplink-smarthome@6.1.0 [02/11/2020, 14:53:40] Registering platform 'homebridge-tplink-smarthome.TplinkSmarthome' [02/11/2020, 14:53:40] --- [02/11/2020, 14:53:40] Loading 3 platforms... [02/11/2020, 14:53:40] [Config] Initializing config platform... [02/11/2020, 14:53:40] [Config] Running in Service Mode [02/11/2020, 14:53:40] [TplinkSmarthome] Initializing TplinkSmarthome platform... [02/11/2020, 14:53:40] [TplinkSmarthome] homebridge-tplink-smarthome v6.1.0, node v14.15.0, homebridge v1.1.6 [02/11/2020, 14:53:40] [BraviaPlatform] Initializing BraviaPlatform platform... [02/11/2020, 14:53:40] [TplinkSmarthome] Configuring cached accessory: [Patio Lights] 8006EF7C21FDAA53CBFF56037A1FD7411D7B4EEF00 b47a6cc5-2133-41ad-8845-6e03ff53063e [02/11/2020, 14:53:40] [TplinkSmarthome] Configuring cached accessory: [Shed Lights] 8006EF7C21FDAA53CBFF56037A1FD7411D7B4EEF01 13304206-fea0-48fa-8368-329c53264948 [02/11/2020, 14:53:40] [BraviaPlatform] Creating new accessory for BasementTV [02/11/2020, 14:53:40] [BraviaPlatform] New TV BasementTV, will be queried for channels/apps and added to HomeKit [02/11/2020, 14:53:40] [BraviaPlatform] Creating new accessory for undefined [02/11/2020, 14:53:41] [BraviaPlatform] Error: Accessories must be created with a non-empty displayName. at new Accessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:232:29) at new PlatformAccessory (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:69:9) at new SonyTV (/usr/local/lib/node_modules/homebridge-bravia/index.js:130:24) at /usr/local/lib/node_modules/homebridge-bravia/index.js:25:27 at Array.forEach () at HomebridgeAPI. (/usr/local/lib/node_modules/homebridge-bravia/index.js:23:21) at HomebridgeAPI.emit (events.js:327:22) at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:251:10) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:160:14) at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10) [02/11/2020, 14:53:41] TypeError: Cannot read property 'context' of undefined at SonyTV.checkRegistration (/usr/local/lib/node_modules/homebridge-bravia/index.js:249:61) at SonyTV.start (/usr/local/lib/node_modules/homebridge-bravia/index.js:155:8) at /usr/local/lib/node_modules/homebridge-bravia/index.js:28:43 at Array.forEach () at HomebridgeAPI. (/usr/local/lib/node_modules/homebridge-bravia/index.js:28:18) at HomebridgeAPI.emit (events.js:327:22) at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:251:10) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:160:14) at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) [02/11/2020, 14:53:41] Got SIGTERM, shutting down Homebridge... [02/11/2020, 14:53:41] [BraviaPlatform] Need to authenticate with TV! [02/11/2020, 14:53:41] [BraviaPlatform] Please enter the PIN that appears on your TV at http://homebridge:8999 [02/11/2020, 14:53:41] [BraviaPlatform] PIN entry web server listening [02/11/2020, 14:53:46] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [02/11/2020, 14:53:51] [HB Supervisor] Restarting Homebridge...

jckblack commented 3 years ago

also just upgraded to Homebridge 1.2.3 and same issue.

jckblack commented 3 years ago

tried removing TPLink plugin and only have Bravia config. still same issue.

02/11/2020, 15:53:22] [BraviaPlatform] Initializing BraviaPlatform platform... [02/11/2020, 15:53:22] [BraviaPlatform] Creating new accessory for TV [02/11/2020, 15:53:22] [BraviaPlatform] New TV TV, will be queried for channels/apps and added to HomeKit [02/11/2020, 15:53:23] [BraviaPlatform] Creating new accessory for undefined [02/11/2020, 15:53:23] [BraviaPlatform] AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName. at new Accessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:235:11) at new PlatformAccessory (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:70:9) at new SonyTV (/usr/local/lib/node_modules/homebridge-bravia/index.js:130:24) at /usr/local/lib/node_modules/homebridge-bravia/index.js:25:27 at Array.forEach () at HomebridgeAPI. (/usr/local/lib/node_modules/homebridge-bravia/index.js:23:21) at HomebridgeAPI.emit (events.js:315:20) at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:251:10) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:158:14) at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10) { generatedMessage: false, code: 'ERR_ASSERTION', actual: undefined, expected: true, operator: '==' } [02/11/2020, 15:53:23] TypeError: Cannot read property 'context' of undefined at SonyTV.checkRegistration (/usr/local/lib/node_modules/homebridge-bravia/index.js:249:61) at SonyTV.start (/usr/local/lib/node_modules/homebridge-bravia/index.js:155:8) at /usr/local/lib/node_modules/homebridge-bravia/index.js:28:43 at Array.forEach () at HomebridgeAPI. (/usr/local/lib/node_modules/homebridge-bravia/index.js:28:18) at HomebridgeAPI.emit (events.js:315:20) at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:251:10) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:158:14) at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) [02/11/2020, 15:53:23] Got SIGTERM, shutting down Homebridge... [02/11/2020, 15:53:23] [BraviaPlatform] Need to authenticate with TV! [02/11/2020, 15:53:23] [BraviaPlatform] Please enter the PIN that appears on your TV at http://homebridge:8999 [02/11/2020, 15:53:23] [BraviaPlatform] PIN entry web server listening [02/11/2020, 15:53:28] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [02/11/2020, 15:53:33] [HB Supervisor] Restarting Homebridge... [02/11/2020, 15:53:33] [HB Supervisor] Starting Homebridge with extra flags: -I [02/11/2020, 15:53:33] [HB Supervisor] Started Homebridge v1.2.3 with PID: 3448 [02/11/2020, 15:53:34] Loaded config.json with 0 accessories and 2 platforms. [02/11/2020, 15:53:34] --- [02/11/2020, 15:53:36] Loaded plugin: homebridge-bravia@2.4.6 [02/11/2020, 15:53:36] Registering platform 'homebridge-bravia.BraviaPlatform' [02/11/2020, 15:53:36] --- [02/11/2020, 15:53:36] Loaded plugin: homebridge-config-ui-x@4.31.0 [02/11/2020, 15:53:36] Registering platform 'homebridge-config-ui-x.config' [02/11/2020, 15:53:36] --- [02/11/2020, 15:53:36] Loading 2 platforms... [02/11/2020, 15:53:36] [Config] Initializing config platform... [02/11/2020, 15:53:36] [Config] Running in Service Mode [02/11/2020, 15:53:36] [BraviaPlatform] Initializing BraviaPlatform platform... [02/11/2020, 15:53:36] [BraviaPlatform] Creating new accessory for TV [02/11/2020, 15:53:36] [BraviaPlatform] New TV TV, will be queried for channels/apps and added to HomeKit [02/11/2020, 15:53:36] [BraviaPlatform] Creating new accessory for undefined [02/11/2020, 15:53:36] [BraviaPlatform] AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName. at new Accessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:235:11) at new PlatformAccessory (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:70:9) at new SonyTV (/usr/local/lib/node_modules/homebridge-bravia/index.js:130:24) at /usr/local/lib/node_modules/homebridge-bravia/index.js:25:27 at Array.forEach () at HomebridgeAPI. (/usr/local/lib/node_modules/homebridge-bravia/index.js:23:21) at HomebridgeAPI.emit (events.js:315:20) at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:251:10) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:158:14) at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10) { generatedMessage: false, code: 'ERR_ASSERTION', actual: undefined, expected: true, operator: '==' } [02/11/2020, 15:53:36] TypeError: Cannot read property 'context' of undefined at SonyTV.checkRegistration (/usr/local/lib/node_modules/homebridge-bravia/index.js:249:61) at SonyTV.start (/usr/local/lib/node_modules/homebridge-bravia/index.js:155:8) at /usr/local/lib/node_modules/homebridge-bravia/index.js:28:43 at Array.forEach () at HomebridgeAPI. (/usr/local/lib/node_modules/homebridge-bravia/index.js:28:18) at HomebridgeAPI.emit (events.js:315:20) at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:251:10) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:158:14) at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) [02/11/2020, 15:53:36] Got SIGTERM, shutting down Homebridge... [02/11/2020, 15:53:37] [BraviaPlatform] Need to authenticate with TV! [02/11/2020, 15:53:37] [BraviaPlatform] Please enter the PIN that appears on your TV at http://homebridge:8999 [02/11/2020, 15:53:37] [BraviaPlatform] PIN entry web server listening [02/11/2020, 15:53:41] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [02/11/2020, 15:53:46] [HB Supervisor] Restarting Homebridge... [02/11/2020, 15:53:46] [HB Supervisor] Starting Homebridge with extra flags: -I [02/11/2020, 15:53:47] [HB Supervisor] Started Homebridge v1.2.3 with PID: 3489 [02/11/2020, 15:53:48] Loaded config.json with 0 accessories and 2 platforms. [02/11/2020, 15:53:48] --- [02/11/2020, 15:53:49] Loaded plugin: homebridge-bravia@2.4.6 [02/11/2020, 15:53:49] Registering platform 'homebridge-bravia.BraviaPlatform' [02/11/2020, 15:53:49] --- [02/11/2020, 15:53:49] Loaded plugin: homebridge-config-ui-x@4.31.0 [02/11/2020, 15:53:49] Registering platform 'homebridge-config-ui-x.config' [02/11/2020, 15:53:49] --- [02/11/2020, 15:53:49] Loading 2 platforms... [02/11/2020, 15:53:49] [Config] Initializing config platform... [02/11/2020, 15:53:49] [Config] Running in Service Mode [02/11/2020, 15:53:49] [BraviaPlatform] Initializing BraviaPlatform platform... [02/11/2020, 15:53:49] [BraviaPlatform] Creating new accessory for TV [02/11/2020, 15:53:49] [BraviaPlatform] New TV TV, will be queried for channels/apps and added to HomeKit [02/11/2020, 15:53:50] [BraviaPlatform] Creating new accessory for undefined [02/11/2020, 15:53:50] [BraviaPlatform] AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName. at new Accessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:235:11) at new PlatformAccessory (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:70:9) at new SonyTV (/usr/local/lib/node_modules/homebridge-bravia/index.js:130:24) at /usr/local/lib/node_modules/homebridge-bravia/index.js:25:27 at Array.forEach () at HomebridgeAPI. (/usr/local/lib/node_modules/homebridge-bravia/index.js:23:21) at HomebridgeAPI.emit (events.js:315:20) at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:251:10) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:158:14) at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10) { generatedMessage: false, code: 'ERR_ASSERTION', actual: undefined, expected: true, operator: '==' } [02/11/2020, 15:53:50] TypeError: Cannot read property 'context' of undefined at SonyTV.checkRegistration (/usr/local/lib/node_modules/homebridge-bravia/index.js:249:61) at SonyTV.start (/usr/local/lib/node_modules/homebridge-bravia/index.js:155:8) at /usr/local/lib/node_modules/homebridge-bravia/index.js:28:43 at Array.forEach () at HomebridgeAPI. (/usr/local/lib/node_modules/homebridge-bravia/index.js:28:18) at HomebridgeAPI.emit (events.js:315:20) at HomebridgeAPI.signalFinished (/usr/local/lib/node_modules/homebridge/src/api.ts:251:10) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:158:14) at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) [02/11/2020, 15:53:50] Got SIGTERM, shutting down Homebridge... [02/11/2020, 15:53:50] [BraviaPlatform] Need to authenticate with TV! [02/11/2020, 15:53:50] [BraviaPlatform] Please enter the PIN that appears on your TV at http://homebridge:8999 [02/11/2020, 15:53:50] [BraviaPlatform] PIN entry web server listening [02/11/2020, 15:53:55] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null

jckblack commented 3 years ago
"bridge": {
    "name": "Homebridge",
    "username": "",
    "port": 51614,
    "pin": ""
},
"accessories": [],
"platforms": [
    {
        "name": "Config",
        "port": 8581,
        "platform": "config"
    },
    {
        "tvs": [
            {
                "name": "TV",
                "ip": "10.0.10.84",
                "soundoutput": "speaker"
            },
            {
                "soundoutput": "speaker"
            }
        ],
        "platform": "BraviaPlatform"
    }
]

}

removed username and pin info

normen commented 3 years ago

Looks like homebridge wants a displayName in addition to the normal name now - question is why can't it just use the normal name when theres no displayName as it did before..?

normen commented 3 years ago

Funny thing is I am using 1.2.3 as well and I don't have these issues. Is there maybe another device called "TV" in your setup?

normen commented 3 years ago

Oh, looking at your config again, theres two TVs configured and one doesn't have a name, remove this bit here:

             ,
            {
                "soundoutput": "speaker"
            }
jckblack commented 3 years ago

found the issue. I thought pressing "add registered TV" means to add the entry, but that box actually means to add an additional TV. Instead you should just hit save instead of clicking on "add Registered TV" perhaps the button label should be changed to Add another TV.