grzegorz914 / homebridge-xbox-tv

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

Plugin not starting after modifying config elsewhere #154

Closed jozhlogg closed 1 year ago

jozhlogg commented 1 year ago

I removed a device from a different plugin (Tuya local) and now the xbox plugin won't start(All the plugins are working fine). The xbox plugin runs on a child bridge. I have included the log. Any help will be greatly appreciated.

[31/01/2023, 17:13:41] [homebridge-xbox-tv] Loaded homebridge-xbox-tv v2.5.1 child bridge successfully
[31/01/2023, 17:13:42] Loaded 0 cached accessories from cachedAccessories.0E89D28CCC15.
[31/01/2023, 17:13:42] Homebridge v1.6.0 (HAP v0.11.0) (homebridge-xbox-tv) is running on port 59319.

/usr/lib/node_modules/homebridge-xbox-tv/node_modules/xbox-webapi/src/authentication.js:378
            this._tokens = JSON.parse(token_store)
                                ^
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.loadTokens (/usr/lib/node_modules/homebridge-xbox-tv/node_modules/xbox-webapi/src/authentication.js:378:33)
    at Object.<anonymous> (/usr/lib/node_modules/homebridge-xbox-tv/node_modules/xbox-webapi/src/authentication.js:355:26)
    at new Promise (<anonymous>)
    at Object.isAuthenticated (/usr/lib/node_modules/homebridge-xbox-tv/node_modules/xbox-webapi/src/authentication.js:353:20)
    at Object.isAuthenticated (/usr/lib/node_modules/homebridge-xbox-tv/node_modules/xbox-webapi/src/client.js:54:41)
    at XBOXDEVICE.getAuthorizationState (/usr/lib/node_modules/homebridge-xbox-tv/index.js:328:41)
    at new XBOXDEVICE (/usr/lib/node_modules/homebridge-xbox-tv/index.js:312:9)
    at HomebridgeAPI.<anonymous> (/usr/lib/node_modules/homebridge-xbox-tv/index.js:43:5)
    at HomebridgeAPI.emit (node:events:513:28)
[31/01/2023, 17:13:42] [homebridge-xbox-tv] Child bridge process ended
[31/01/2023, 17:13:42] [homebridge-xbox-tv] Process Ended. Code: 1, Signal: null
jozhlogg commented 1 year ago

This is the full JSON:

{
    "bridge": {
        "name": "Homebridge 7B06",
        "username": "0E:E6:D5:54:D3:9B",
        "port": 51924,
        "pin": "786-88-804"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8181,
            "auth": "none",
            "theme": "auto",
            "tempUnits": "c",
            "lang": "auto",
            "platform": "config"
        },
        {
            "name": "TplinkSmarthome",
            "addCustomCharacteristics": false,
            "deviceTypes": [
                "plug",
                "bulb"
            ],
            "platform": "TplinkSmarthome"
        },
        {
            "devices": [
                {
                    "name": "Xbox Series S",
                    "host": "192.168.4.133",
                    "xboxLiveId": "XXXXXX",
                    "xboxWebApiToken": "XXXXXXX",
                    "disableLogInfo": false,
                    "disableLogDeviceInfo": false,
                    "enableDebugMode": false,
                    "webApiControl": true,
                    "volumeControl": 0,
                    "infoButtonCommand": "nexus",
                    "getInputsFromDevice": true,
                    "filterGames": false,
                    "filterApps": false,
                    "filterSystemApps": false,
                    "filterDlc": true,
                    "enableMqtt": false,
                    "mqttAuth": false,
                    "mqttDebug": false
                },
                {
                    "name": "Xbox One S",
                    "host": "192.168.4.99",
                    "xboxLiveId": "XXXXXXX",
                    "xboxWebApiToken": "XXXXXXXXX",
                    "disableLogInfo": false,
                    "disableLogDeviceInfo": false,
                    "enableDebugMode": false,
                    "webApiControl": true,
                    "volumeControl": 0,
                    "infoButtonCommand": "nexus",
                    "getInputsFromDevice": true,
                    "filterGames": false,
                    "filterApps": false,
                    "filterSystemApps": false,
                    "filterDlc": true,
                    "enableMqtt": false,
                    "mqttAuth": false,
                    "mqttDebug": false
                }
            ],
            "_bridge": {
                "username": "0E:89:D2:8C:CC:15",
                "port": 59319
            },
            "platform": "XboxTv"
        },
        {
            "pruning": {
                "pruneMissingCachedAccessories": false,
                "restartsBeforeMissingAccessoriesPruned": 3,
                "pruneAllAccessoriesNextRestart": false
            },
            "whiteEffects": {
                "simultaniousDevicesColorWhite": true,
                "colorWhiteThreshold": 10,
                "colorWhiteThresholdSimultaniousDevices": 50,
                "colorOffThresholdSimultaniousDevices": 5
            },
            "deviceManagement": {
                "blacklistOrWhitelist": "blacklist",
                "blacklistedUniqueIDs": [
                    ""
                ]
            },
            "advancedOptions": {
                "periodicDiscovery": true,
                "namesWithMacAddress": false,
                "logLevel": 3
            },
            "platform": "homebridge-magichome-dynamic-platform"
        },
        {
            "devices": [
                {
                    "type": "RGBTWLight",
                    "name": "Light Ethan",
                    "id": "XXXX",
                    "key": "XXXXX",
                    "manufacturer": "Gosund",
                    "model": "B22",
                    "dpPower": 20,
                    "dpBrightness": 22,
                    "dpMode": 21,
                    "dpColor": 24,
                    "colorFunction": "HSB",
                    "scaleBrightness": 1000
                },
                {
                    "type": "RGBTWLight",
                    "name": "Colour and Tunable White Lamp",
                    "id": "XXXXX",
                    "key": "XXXXX",
                    "manufacturer": "Calex Holland",
                    "model": "E14 Candle",
                    "dpPower": 20,
                    "dpBrightness": 22,
                    "dpColorTemperature": 23,
                    "maxWhiteColor": 221,
                    "dpMode": 21,
                    "dpColor": 24,
                    "colorFunction": "HSB",
                    "scaleBrightness": 1000,
                    "scaleWhiteColor": 1000
                }
            ],
            "platform": "TuyaLan"
        },
        {
            "units": "uk",
            "interval": 5,
            "stations": [
                {
                    "nameNow": "Weather",
                    "service": "openweathermap",
                    "key": "XXXXX",
                    "locationGeo": [
                        XXXXX,
                        XXXXX
                    ],
                    "language": "en",
                    "compatibility": "home",
                    "conditionCategory": "simple",
                    "now": true,
                    "extraHumidity": false,
                    "hidden": [
                        "Air Pressure",
                        "Cloud Cover",
                        "Condition",
                        "Condition Category",
                        "Dew Point",
                        "Forecast Day",
                        "Observation Station",
                        "Observation Time",
                        "Ozone",
                        "Rain",
                        "Rain 1h",
                        "Rain Day",
                        "Rain Chance",
                        "Snow",
                        "Solar Radiation",
                        "Sunrise Time",
                        "Sunset Time",
                        "Temperature Min",
                        "Temperature Apparent",
                        "UV Index",
                        "Visibility",
                        "Wind Direction",
                        "Wind Speed",
                        "Wind Speed Max"
                    ]
                }
            ],
            "_bridge": {
                "username": "0E:EF:4F:0A:44:27",
                "port": 58882
            },
            "platform": "WeatherPlus"
        }
    ]
}
grzegorz914 commented 1 year ago

You need reauthorize it, your token file is invalid or missing. Use authorizations manager again.

jozhlogg commented 1 year ago

That fixed it, thanks!