ilcato / homebridge-blynk

Homebridge plugin for the Blynk platform
MIT License
20 stars 31 forks source link

Error when adding an accessory #30

Open sebastien247 opened 4 years ago

sebastien247 commented 4 years ago

Hi,

I obtain an error when I add an accessory to the config.json.

[7/5/2020, 15:03:53] Loading 4 platforms...
[7/5/2020, 15:03:53] [Config] Initializing config platform...
[7/5/2020, 15:03:53] [Config] Running in Service Mode
[7/5/2020, 15:03:53] [Domoticz] Initializing eDomoticz platform...
[7/5/2020, 15:03:53] [Google Smart Home] Initializing google-smarthome platform...
[7/5/2020, 15:03:53] [Blynk] Initializing Blynk platform...
[7/5/2020, 15:03:53] [Domoticz] synchronizeAccessories in progress...
[7/5/2020, 15:03:53] [Blynk] didFinishLaunching. 
[7/5/2020, 15:03:53] [Blynk] Loading accessories 
[7/5/2020, 15:03:55] TypeError: Cannot read property 'getCharacteristic' of undefined
    at /usr/lib/node_modules/homebridge/src/server.ts:512:32
    at Array.map (<anonymous>)
    at Server.handleRegisterPlatformAccessories (/usr/lib/node_modules/homebridge/src/server.ts:506:40)
    at HomebridgeAPI.emit (events.js:315:20)
    at HomebridgeAPI.registerPlatformAccessories (/usr/lib/node_modules/homebridge/src/api.ts:316:10)
    at BlynkAccessory.registerUpdateAccessory (/usr/lib/node_modules/homebridge-blynk/src/blynkaccessory.ts:100:8)
    at Blynk.addAccessory (/usr/lib/node_modules/homebridge-blynk/src/index.ts:178:18)
    at /usr/lib/node_modules/homebridge-blynk/src/index.ts:142:9
    at Array.map (<anonymous>)
    at Blynk.LoadAccessories (/usr/lib/node_modules/homebridge-blynk/src/index.ts:141:15)

My config file:

{
    "bridge": {
        "name": "Homebridge 3911",
        "username": "XXXXXX",
        "port": XXXXX,
        "pin": "XXXXXXX"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": XXXX,
            "auth": "form",
            "theme": "dark-mode",
            "tempUnits": "c",
            "lang": "auto",
            "platform": "config"
        },
        {
            "name": "Domoticz",
            "server": "XXXXXXXX",
            "port": "XXXXX",
            "roomid": 2,
            "mqtt": true,
            "ssl": false,
            "dimFix": 0,
            "platform": "eDomoticz"
        },
        {
            "name": "Google Smart Home",
            "token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXxx",
            "notice": "Keep your token a secret!",
            "platform": "google-smarthome"
        },
        {
            "platform": "Blynk",
            "name": "Blynk",
            "serverurl": "XXXXXXXXXXXX",
            "token": "XXXXXXXXXXXXXXXXXX",
            "pollerperiod": "1",
            "accessories": [
                {
                    "name": "Distributeur",
                    "widget": "Switch",
                    "mode": "PUSH",
                    "caption": "Distribuer",
                    "pin": "V1"
                }
            ]
        }
    ]
}

Without this part:

            "accessories": [
                {
                    "name": "Distributeur",
                    "widget": "Switch",
                    "mode": "PUSH",
                    "caption": "Distribuer",
                    "pin": "V1"
                }
            ]

homebridge can start without any problem.

Thanks

csiber commented 3 years ago

Solved?

fbaudens commented 3 years ago

Hello, I have exactly the same problem after updating all my Homebridge system. Any solution ?

Works perfectly without any accessory, but when I add an accessory, Homebridge crases with same error log.

mpw-eng commented 3 years ago

I have the same problem - I think the new Homebridge version is expecting additional characteristics such as "Identify" and "FirmwareVersion"

Perhaps @doom369 may have someone that can fix this for us poor coding newbies who are more likely to do more harm than good ;-). I can't wait to say "Hey Siri, turn on my ESP32-Blynk light."

[Logs:]()

Secondary Homebridge Logs here
TypeError: Cannot read property 'getCharacteristic' of undefined
    at Accessory._this._sideloadServices (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Accessory.js:1060:17)
    at Function.Accessory.deserialize (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1718:15)
    at Function.deserialize (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:150:33)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:263:34
    at Array.map (<anonymous>)
    at Server.loadCachedPlatformAccessoriesFromDisk (/usr/local/lib/node_modules/homebridge/src/server.ts:262:58)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:149:10)
    at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
[11/18/2020, 6:32:11 PM] [HB Supervisor] Homebridge Process Ended. Code: 0, Signal: null

Homebridge Config:

{
    "bridge": {
        "name": "Homebridge XXXX",
        "username": "XX:XX:XX:XX:XX",
        "port": 51238,
        "pin": "000-00-000"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "auth": "form",
            "theme": "auto",
            "tempUnits": "c",
            "lang": "auto",
            "platform": "config"
        },
        {
            "platform": "Blynk",
            "name": "Blynk",
            "serverurl": "10.1.1.1:8080",
            "token": "******************************",
            "pollerperiod": "10",
            "accessories": [
                {
                    "name": "LampOnOff",
                    "widget": "Switch",
                    "mode": "SWITCH",
                    "caption": "Table Lamp",
                    "pin": "V0"
                }
            ]
        }
    ]
}
soken35 commented 3 years ago

Hello,

Have you resolved the issue? I have exactly the same.

Thank you all

fbaudens commented 3 years ago

Hi I don’t remember if it’s working now, i´ve switched to home-assistant and i use node-red to interact with HA using Blynk web api. My homebridge now only use for connecting my Nest thermostat with Homekit

damjangr commented 3 years ago

I have the same mistake. Is there a solution? Thanks

praveenskylark commented 2 years ago

you can use homebridge-blynk-platform plugin it works perfectly