ilcato / homebridge-Fibaro-HC2

Homebridge plugin for Fibaro Home Center 2 (and Home Center Lite ...)
Apache License 2.0
66 stars 27 forks source link

Crash during pairing process #72

Closed ludovi-com closed 6 years ago

ludovi-com commented 6 years ago

Starting homebridge after displaying the pairing code: [2017-9-21 22:18:27] [FibaroHC2] Error getting data from Home Center: null

During pairing process (customizing sensors and lights) or trying to turn on/off a light after restarting homebridge make it runs in this issue with a resulting crash: [2017-9-21 22:19:07] [FibaroHC2] Setting value to device: 113 parameter: On /usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:202 let setFunction = this.setFunctions.setFunctionsMapping.get(characteristic.UUID); ^

TypeError: Cannot read property 'setFunctionsMapping' of undefined at FibaroHC2.setCharacteristicValue (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:202:48) at Characteristic.characteristic.on (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:186:18) at emitMany (events.js:146:13) at Characteristic.emit (events.js:223:7) at Characteristic.setValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:292:10) at Bridge. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:812:22) at Array.forEach () at Bridge.Accessory._handleSetCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:757:8) at emitMany (events.js:146:13) at HAPServer.emit (events.js:223:7)

node v8.5.0 npm v5.3.0 homebridge v0.4.28 homebridge-Fibaro-HC2 v2.0.7 HC2 OS v4.134

ilcato commented 6 years ago

not clear the sequence of events.

what's the first error that did you get?

ludovi-com commented 6 years ago

First, after the whole starting process (where it loads all the items from the fibaro, shows the code etc...) it displays this and waits for pairing: [2017-9-21 22:18:27] [FibaroHC2] Error getting data from Home Center: null

It doesn’t make homebridge crash but being an error code I think it would be useful to report it.

Then proceeding with the pairing process all seems to go well. It requests you the pairing code and starts to let you cpstumize all the elements. During this process it displays all the other errors and crash. Then if you try to relaunch homebridge it crash in the same way whenever you try to turn on/off a light.

If it can be useful I can share with you all the outputs from the $homebridge launch.

ilcato commented 6 years ago

yes, please

ludovi-com commented 6 years ago

$ homebridge WARNING The program 'node' uses the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node WARNING The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister [2017-9-21 22:18:26] Loaded plugin: homebridge-fibaro-hc2 [2017-9-21 22:18:26] Registering platform 'homebridge-fibaro-hc2.FibaroHC2' [2017-9-21 22:18:26] --- [2017-9-21 22:18:26] Loaded config.json with 0 accessories and 1 platforms. [2017-9-21 22:18:26] --- [2017-9-21 22:18:26] Loading 1 platforms... [2017-9-21 22:18:26] [FibaroHC2] Initializing FibaroHC2 platform... [2017-9-21 22:18:26] [FibaroHC2] Configured Accessory: 141.0.1 [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: 141.0 [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Luce Corridoio [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Luce Ragazzi [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Libero Bagno Letto [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Luce Bagno Letto [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Lum. Bagno Letto [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Temp. Bagno Letto [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Movimento Bag, Letto [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Luce Cam. Letto [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Lume Cam. Letto [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Movimento Cam. Letto [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Temp. Cam. Letto [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Lux Camera Letto [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Luce Amb. Sala [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Lux Sala [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Temperatura Sala [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Movimento Sala [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: 6.0 [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: Fan [2017-9-21 22:18:27] [FibaroHC2] Configured Accessory: TV Samsung Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

┌────────────┐     
│ 031-45-529 │     
└────────────┘     

[2017-9-21 22:18:27] [FibaroHC2] didFinishLaunching. [2017-9-21 22:18:27] Homebridge is running on port 51826. [2017-9-21 22:18:27] [FibaroHC2] Error getting data from Home Center: null [2017-9-21 22:19:07] [FibaroHC2] Setting value to device: 113 parameter: On /usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:202 let setFunction = this.setFunctions.setFunctionsMapping.get(characteristic.UUID); ^

TypeError: Cannot read property 'setFunctionsMapping' of undefined at FibaroHC2.setCharacteristicValue (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:202:48) at Characteristic.characteristic.on (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:186:18) at emitMany (events.js:146:13) at Characteristic.emit (events.js:223:7) at Characteristic.setValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:292:10) at Bridge. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:812:22) at Array.forEach () at Bridge.Accessory._handleSetCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:757:8) at emitMany (events.js:146:13) at HAPServer.emit (events.js:223:7) pi@raspberrypi:~ $

ilcato commented 6 years ago

Can you post also the configure.json (without password)

ludovi-com commented 6 years ago

{ "bridge": { "name": "Homebridge-Fibaro", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "031-45-529" },

"description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",

"platforms": [
    {
        "platform" : "FibaroHC2",
        "name" : "FibaroHC2",
    "host" : "192.168.101.20",
    "username" : "u.manto@******.it",
    "password" : "*********"
    }
]

}

ilcato commented 6 years ago

please, insert also the following params:

  "pollerperiod": "1"
  "securitysystem": "disabled"
ludovi-com commented 6 years ago

Now I can complete the pairing process without any error but trying to turn on/off a light it immediately crashes displaying this outputs:

[2017-9-22 12:57:23] [FibaroHC2] Setting value to device:  113  parameter: On
/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:202
            let setFunction = this.setFunctions.setFunctionsMapping.get(characteristic.UUID);
                                               ^

TypeError: Cannot read property 'setFunctionsMapping' of undefined
    at FibaroHC2.setCharacteristicValue (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:202:48)
    at Characteristic.characteristic.on (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:186:18)
    at emitMany (events.js:146:13)
    at Characteristic.emit (events.js:223:7)
    at Characteristic.setValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:292:10)
    at Bridge.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:812:22)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleSetCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:757:8)
    at emitMany (events.js:146:13)
    at HAPServer.emit (events.js:223:7)
ilcato commented 6 years ago

If you turn on or off the light outside of homebridge/homekit is homebridge able to see the change?

ludovi-com commented 6 years ago

No, lights are off and the door sensor is on open. I can suppose that it displays the states ridden at the time of the pairing process.

ilcato commented 6 years ago

try to remove the accessories folder and restart homebridge

ludovi-com commented 6 years ago

Thank you so much, now all works fine. I was going mad, thanks again!

ilcato commented 6 years ago

evviva !