grzegorz914 / homebridge-xbox-tv

Homebridge plugin for Microsoft Game Console, publish as independent external platform accessory.
MIT License
164 stars 15 forks source link

Active Identifier Unhandled Error thrown in read handler #189

Closed chris4prez closed 8 months ago

chris4prez commented 8 months ago

I'm receiving the below error fairly frequently within the logs, and after awhile it the xbox plugin stops working until a restart. The below error seems to correlate to whenever I open home app, or run a random home shortcut and polling of the xbox occurs even when I'm not interacting with it.

Below is my config. Which is simple in nature.

"devices": [
    {
        "name": "Living Room Xbox Series X",
        "host": "10.0.1.132",
        "xboxLiveId": "REMOVEDID",
        "webApiControl": true,
        "getInputsFromDevice": true,
        "filterGames": true,
        "filterApps": true,
        "filterSystemApps": true,
        "filterDlc": true,
        "inputsDisplayOrder": 1,
        "sensorPower": false,
        "sensorInput": false,
        "sensorScreenSaver": false,
        "webApiPowerOnOff": true,
        "webApiRcControl": false,
        "webApiVolumeControl": false,
        "webApiToken": "REMOVEDTOKEN",
        "webApiClientId": "REMOVEDCLIENTID",
        "enableDebugMode": false,
        "disableLogInfo": false,
        "disableLogDeviceInfo": false,
        "infoButtonCommand": "nexus",
        "volumeControl": -1,
        "enableRestFul": false,
        "restFulDebug": false,
        "enableMqtt": false,
        "mqttDebug": false,
        "mqttAuth": false
    }
],
"_bridge": {
    "username": "0E:D7:D1:31:C2:57",
    "port": 42538
},
"platform": "XboxTv"

}

Log snippet: 01/01/2024, 14:42:43] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, set Power: ON [01/01/2024, 14:42:53] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Connected. [01/01/2024, 14:42:53] [homebridge-xbox-tv] -------- Living Room Xbox Series X --------' [01/01/2024, 14:42:53] [homebridge-xbox-tv] Manufacturer: Microsoft [01/01/2024, 14:42:53] [homebridge-xbox-tv] Model: Xbox Series X [01/01/2024, 14:42:53] [homebridge-xbox-tv] Serialnr: REMOVED [01/01/2024, 14:42:53] [homebridge-xbox-tv] Firmware: 10.0.25398 [01/01/2024, 14:42:53] [homebridge-xbox-tv] Locale: en-US [01/01/2024, 14:42:53] [homebridge-xbox-tv] ---------------------------------- [01/01/2024, 14:42:59] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, set Power: OFF [01/01/2024, 14:43:16] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Disconnected. [01/01/2024, 14:44:16] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Power: OFF [01/01/2024, 14:44:17] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 14:44:49] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Power: OFF [01/01/2024, 14:44:49] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Current Media: STOP [01/01/2024, 14:44:49] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Target Media: STOP [01/01/2024, 14:44:49] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Mute: ON [01/01/2024, 14:44:49] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Volume: 0 [01/01/2024, 14:44:49] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 14:44:49] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 14:45:22] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 14:45:27] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 14:45:43] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 14:52:24] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Power: OFF [01/01/2024, 14:52:24] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 14:52:30] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 14:52:32] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Power: OFF [01/01/2024, 14:52:32] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 14:52:34] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Power: OFF [01/01/2024, 14:52:35] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 14:53:31] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Power: OFF [01/01/2024, 14:53:31] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 16:01:52] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Power: OFF [01/01/2024, 16:01:52] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 16:12:38] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Power: OFF [01/01/2024, 16:12:39] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 16:13:04] [homebridge-xbox-tv] Device: 10.0.1.132 Living Room Xbox Series X, Power: OFF [01/01/2024, 16:13:04] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 16:13:11] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [01/01/2024, 16:13:12] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info.

insimbi-stuart commented 8 months ago

I am also getting this error, though I haven't managed to capture it when debug is enabled yet:

[01/01/2024, 12:11:13] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId')

insimbi-stuart commented 8 months ago

Have now been able to capture the error with debug logging, hopefully the attached will help you @grzegorz914 [removed]

grzegorz914 commented 8 months ago

this should be fixed with latest update 2.12.3

chris4prez commented 8 months ago

Thanks for your fantastic effort!

insimbi-stuart commented 8 months ago

Thanks @grzegorz914 I have updated to 2.12.4 and will let you know if I see the error again.

insimbi-stuart commented 8 months ago

Still seeing it in my logs on 2.12.4 unfortunately:

[02/01/2024, 17:21:30] [XboxTv] Device: 192.168.1.52 Xbox Series X, Power: OFF [02/01/2024, 17:21:30] [XboxTv] Device: 192.168.1.52 Xbox Series X, Current Media: STOP [02/01/2024, 17:21:30] [XboxTv] Device: 192.168.1.52 Xbox Series X, Target Media: STOP [02/01/2024, 17:21:30] [XboxTv] Device: 192.168.1.52 Xbox Series X, Mute: ON [02/01/2024, 17:21:30] [XboxTv] Device: 192.168.1.52 Xbox Series X, Volume: 0 [02/01/2024, 17:21:30] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [02/01/2024, 17:21:30] [XboxTv] Device: 192.168.1.52 Xbox Series X, Power: OFF [02/01/2024, 17:21:30] [XboxTv] Device: 192.168.1.52 Xbox Series X, Current Media: STOP [02/01/2024, 17:21:30] [XboxTv] Device: 192.168.1.52 Xbox Series X, Target Media: STOP [02/01/2024, 17:21:30] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [02/01/2024, 17:21:30] [XboxTv] Device: 192.168.1.52 Xbox Series X, Mute: ON [02/01/2024, 17:21:30] [XboxTv] Device: 192.168.1.52 Xbox Series X, Volume: 0 [02/01/2024, 17:21:34] [XboxTv] Device: 192.168.1.52 Xbox Series X, Power: OFF [02/01/2024, 17:21:34] [XboxTv] Device: 192.168.1.52 Xbox Series X, Current Media: STOP [02/01/2024, 17:21:34] [XboxTv] Device: 192.168.1.52 Xbox Series X, Target Media: STOP [02/01/2024, 17:21:34] [homebridge-xbox-tv] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'oneStoreProductId'). See https://homebridge.io/w/JtMGR for more info. [02/01/2024, 17:21:34] [XboxTv] Device: 192.168.1.52 Xbox Series X, Mute: ON [02/01/2024, 17:21:34] [XboxTv] Device: 192.168.1.52 Xbox Series X, Volume: 0

chris4prez commented 8 months ago

Still seeing the error here too after updating log.txt

insimbi-stuart commented 8 months ago

So the steps to reproduce this are:

  1. Restart Homebridge/child bridge while console is powered off (plugin successfully polls console and logs info)
  2. Power on console (plugin still successfully polls console and logs info)
  3. Power off the console (plugin polls console successfully for power/media states but errors getting input information).

Polling will continue to fail until either the console is powered back on or Homebridge/child bridge is restarted.

grzegorz914 commented 8 months ago

Please go to Homebridge/xboxTv/ folder and remove inputs, inputsNames and inputsTatgetVisibility files then restart plugin and let me know.

insimbi-stuart commented 8 months ago

Updated to 2.12.5 and removed those files and that seems to have worked, thanks for your efforts @grzegorz914!

chris4prez commented 8 months ago

Updated and tested, everything is working great so far. Thanks @grzegorz914 ! Logs are staying clean, responsiveness of home actions and device state representation has improved back to similar duration prior to implementation of this plugin. Kudos, keep up the fantastic work. Plan on adding second xbox to this configuration and thoroughly testing so that I can roll out for the family. This is going to be game changer for them and my use case for automation of the AV systems.