iharosi / homebridge-plex-webhooks

Plex Webhooks Server plugin for Homebridge
GNU Affero General Public License v3.0
48 stars 5 forks source link

This plugin threw an error from the characteristic 'Manufacturer': Error: characteristic value expected string and received object #12

Closed scottrobertson closed 2 years ago

scottrobertson commented 3 years ago

Before you raise an issue ticket, please turn on verbose logging in the plugin's config or run homebridge with -D (or --debug) option.

Node.js version v14.15.5

Homebridge version v1.3.0 (happened on 1.2.x too I think).

Plex Webhooks Server plugin version v2.1.2

Configuration

{
    "name": "Plex Webhooks Platform",
    "sensors": [
        {
            "name": "Plex",
            "filters": [
                [
                    {
                        "path": "owner",
                        "value": "true"
                    }
                ]
            ]
        }
    ],
    "verbose": false,
    "platform": "PlexWebhooks",
    "_bridge": {
        "username": "*******",
        "port": 33661
    }
}

Error message

[20/02/2021, 11:48:07] [homebridge-plex-webhooks] This plugin threw an error from the characteristic 'Manufacturer': Error: characteristic value expected string and received object
    at Manufacturer.Characteristic.validateUserInput (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1987:17)
    at Manufacturer.Characteristic.setValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1257:20)
    at AccessoryInformation.Service.setCharacteristic (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:459:35)
    at new PlexWebhooksPlatformAccessory (/usr/lib/node_modules/homebridge-plex-webhooks/lib/accessory.js:23:8)
    at /usr/lib/node_modules/homebridge-plex-webhooks/lib/platform.js:106:29
    at Array.map (<anonymous>)
    at PlexWebhooksPlatform._updateAccessories (/usr/lib/node_modules/homebridge-plex-webhooks/lib/platform.js:104:8)
    at PlexWebhooksPlatform._discoverAccessories (/usr/lib/node_modules/homebridge-plex-webhooks/lib/platform.js:52:10)
    at HomebridgeAPI.<anonymous> (/usr/lib/node_modules/homebridge-plex-webhooks/lib/platform.js:31:12)
    at HomebridgeAPI.emit (events.js:327:22)
    at HomebridgeAPI.signalFinished (/usr/lib/node_modules/homebridge/src/api.ts:275:10)
    at Server.start (/usr/lib/node_modules/homebridge/src/server.ts:125:14) See https://git.io/JtMGR for more info.
iharosi commented 3 years ago

Thanks for reporting! Unfortunately I haven't tested my plugin with Homebridge v1.3.0 yet. I'll take a look soon. I'll keep you posted.

xcsdm commented 3 years ago

Homebridge 1.3.1 allows use of the plugin again. I think it's more of a "hiding the error" vs. "fixing the error".

From the 1.3.1 release notes.

2820 - Automatically correct bad characteristic values provided by plugins in more cases, this should fix the vast majority of problems users were facing after upgrading to v1.3.0.

scottrobertson commented 3 years ago

Homebridge 1.3.1 allows use of the plugin again. I think it's more of a "hiding the error" vs. "fixing the error".

From the 1.3.1 release notes.

2820 - Automatically correct bad characteristic values provided by plugins in more cases, this should fix the vast majority of problems users were facing after upgrading to v1.3.0.

Thanks for pointing that out.

buhbob commented 3 years ago

I just installed this plugin and it's showing this error. I am on Homebridge 1.3.4 and plugin version 2.1.2. Was anything else ever found ab out this?

jptaranto commented 3 years ago

I just started getting this on 1.3.4 too and it seems to have taken the whole bridge with it.

iharosi commented 3 years ago

The error should gone by now. Please provide more information (your config, node/npm version etc.) before posting otherwise I'll close this issue.

jptaranto commented 3 years ago

Yes, after removing my config restarting the bridge and then adding the config back in and restarting, it seems to have come good. I did however have to remove the homebridge from homekit to restore all my accessories to fix the "not responding" issue.

buhbob commented 3 years ago

I still see this error in my console.

Node version: 14.17.0 NPM version: 6.14.13

{
    "name": "Plex Webhooks Platform",
    "sensors": [
        {
            "name": "Plex Movie",
            "filters": [
                [
                    {
                        "path": "Metadata.type",
                        "value": "movie"
                    },
                    {
                        "path": "Player.title",
                        "value": "Family Room"
                    }
                ]
            ]
        },
        {
            "name": "Plex TV",
            "filters": [
                [
                    {
                        "path": "Player.title",
                        "value": "Family Room"
                    },
                    {
                        "path": "Metadata.type",
                        "value": "tv"
                    }
                ]
            ]
        }
    ],
    "server": {
        "port": 32401,
        "address": "10.0.1.78"
    },
    "verbose": true,
    "platform": "PlexWebhooks"
}
Brunog1973 commented 3 years ago

I still see this error in my console.

Homebridge : v1.3.4 Node version: 14.17.1 NPM version: 6.14.13 HomeBridge Plex WebHooks : v2.1.2 Plex : Version 1.23.2.4656

Error ;

 [homebridge-plex-webhooks] Error: 
    at Manufacturer.Characteristic.characteristicWarning (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2038:105)
    at Manufacturer.Characteristic.validateUserInput (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1986:16)
    at Manufacturer.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1298:20)
    at AccessoryInformation.Service.setCharacteristic (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:459:35)
    at new PlexWebhooksPlatformAccessory (/homebridge/node_modules/homebridge-plex-webhooks/lib/accessory.js:23:8)
    at /homebridge/node_modules/homebridge-plex-webhooks/lib/platform.js:106:29
    at Array.map (<anonymous>)
    at PlexWebhooksPlatform._updateAccessories (/homebridge/node_modules/homebridge-plex-webhooks/lib/platform.js:104:8)
    at PlexWebhooksPlatform._discoverAccessories (/homebridge/node_modules/homebridge-plex-webhooks/lib/platform.js:52:10)
    at HomebridgeAPI.<anonymous> (/homebridge/node_modules/homebridge-plex-webhooks/lib/platform.js:31:12)
Brunog1973 commented 3 years ago

@buhbob Hi, despite the error you described, is it working ? I have similar error and it doesn't work at all. Thx

buhbob commented 3 years ago

Unfortunately, it doesn’t work.

xcsdm commented 3 years ago

Homebridge 1.3.4 Plex 1.23.3.4706 Npm 7.18.1 Node.js 14.17.1

Working as expected. Below is the portion of relevant config for my 2 sensors.

{
    "name": "Plex Web Hooks",
    "sensors": [
        {
            "name": "Plex - Theater Room",
            "filters": [
                [
                    {
                        "path": "Player.title",
                        "value": "Theater Room SHIELD"
                    }
                ]
            ]
        },
        {
            "name": "Plex - Living Room",
            "filters": [
                [
                    {
                        "path": "Player.title",
                        "value": "Living Room"
                    }
                ]
            ]
        }
    ],
    "server": {
        "port": 21000,
        "address": "10.0.42.249"
    },
}
buhbob commented 3 years ago

Thanks! I’ll check my config when I get back home and post to let everyone know if there was a difference and how it works out.

buhbob commented 3 years ago

@xcsdm I compared my config and it matches yours. I suspected it would since I created it via the GUI in Homebridge.

Brunog1973 commented 3 years ago

@buhbob I don't know if it could help but it turns out that i solved the problem with a restart of plex server after webhook creation.

buhbob commented 3 years ago

I've definitely restarted Plex a few times since I installed the plugin because of updates. Maybe I'm missing something?

Error

[21/06/2021, 15:36:56] [Plex Webhooks Platform] Found 2 accessories in config:
[21/06/2021, 15:36:56] [Plex Webhooks Platform] • Plex Movie
[21/06/2021, 15:36:56] [Plex Webhooks Platform] • Plex TV
[Plex Movie@@Manufacturer] characteristic value expected string and received object
[21/06/2021, 15:36:56] [Plex Webhooks Platform] Registering accessory [Plex Movie] (21e34811-b33e-43b5-8bf9-aab1113cc029)
[Plex TV@@Manufacturer] characteristic value expected string and received object
[21/06/2021, 15:36:56] [Plex Webhooks Platform] Registering accessory [Plex TV] (2030047a-1973-4e85-be2c-20b955034105)

Config

{
    "name": "Plex Webhooks Platform",
    "sensors": [
        {
            "name": "Plex Movie",
            "filters": [
                [
                    {
                        "path": "Metadata.type",
                        "value": "movie"
                    },
                    {
                        "path": "Player.title",
                        "value": "Family Room"
                    }
                ]
            ]
        },
        {
            "name": "Plex TV",
            "filters": [
                [
                    {
                        "path": "Player.title",
                        "value": "Family Room"
                    },
                    {
                        "path": "Metadata.type",
                        "value": "tv"
                    }
                ]
            ]
        }
    ],
    "server": {
        "port": 32401,
        "address": "10.0.1.78"
    },
    "verbose": true,
    "platform": "PlexWebhooks"
}
iharosi commented 3 years ago

Could you please clear the cache in the homebridge folder and retry?

buhbob commented 3 years ago

Could you please clear the cache in the homebridge folder and retry?

I can do this. Is there a command to run to clear the cache?