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

Problem #70

Closed myroom closed 7 years ago

myroom commented 7 years ago

WARNING The program 'nodejs' 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=nodejs WARNING The program 'nodejs' 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=nodejs&f=DNSServiceRegister [7/16/2017, 7:25:02 AM] Loaded plugin: homebridge-fibaro-hc2 [7/16/2017, 7:25:02 AM] Registering platform 'homebridge-fibaro-hc2.FibaroHC2' [7/16/2017, 7:25:02 AM] --- [7/16/2017, 7:25:02 AM] Loaded config.json with 0 accessories and 1 platforms. [7/16/2017, 7:25:02 AM] --- [7/16/2017, 7:25:02 AM] Loading 1 platforms... [7/16/2017, 7:25:02 AM] [FibaroHC2] Initializing FibaroHC2 platform... [7/16/2017, 7:25:02 AM] Loading 0 accessories... [7/16/2017, 7:25:02 AM] [FibaroHC2] Configured Accessory: 146.0 [7/16/2017, 7:25:02 AM] [FibaroHC2] Configured Accessory: 146.2 Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

┌────────────┐     
│ 000-00-000 │     
└────────────┘     

[7/16/2017, 7:25:02 AM] [FibaroHC2] didFinishLaunching. [7/16/2017, 7:25:02 AM] Homebridge is running on port 44179. [7/16/2017, 7:25:02 AM] [FibaroHC2] Loading accessories [7/16/2017, 7:25:02 AM] [FibaroHC2] Added/changed accessory: 146.0 [7/16/2017, 7:25:02 AM] [FibaroHC2] Added/changed accessory: 146.2 [7/16/2017, 7:25:04 AM] [FibaroHC2] Error getting data from Home Center: TypeError: Cannot read property 'getCharacteristic' of undefined at Accessory._sideloadServices (/usr/lib/node_modules/hap-nodejs/lib/Accessory.js:857:5) at PlatformAccessory._prepareAssociatedHAPAccessory (/usr/lib/node_modules/homebridge/lib/platformAccessory.js:148:32) at Server._handleRegisterPlatformAccessories (/usr/lib/node_modules/homebridge/lib/server.js:431:15) at Server. (/usr/lib/node_modules/homebridge/lib/server.js:36:10) at emitOne (events.js:96:13) at API.emit (events.js:188:7) at API.registerPlatformAccessories (/usr/lib/node_modules/homebridge/lib/api.js:159:8) at ShadowAccessory.resgisterUpdateccessory (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/shadows.js:88:17) at FibaroHC2.addAccessory (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:166:25) at LoadAccessories.devices.map (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:113:22)

ilcato commented 7 years ago

@myroom how many accessories do you have?

skarotech commented 7 years ago

Hi @ilcato

I am getting the same error, only with version 2.0.6, if I go back to 1.1.2 all devices load correctly.

Is there any easy way for it to display the object it is trying to load, so that we can see exactly what device type its failing on?

I have about 80 devices that were loading under 1.1.2, and i' more than happy to send the time with you to fix this issue, even if it means making some local modifications to the files to diagnose.

Error as below

[8/17/2017, 4:05:47 PM] [FibaroHC2] Error getting data from Home Center: TypeError: Cannot read property 'getCharacteristic' of undefined at Accessory._sideloadServices (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:857:5) at PlatformAccessory._prepareAssociatedHAPAccessory (/usr/lib/node_modules/homebridge/lib/platformAccessory.js:148:32) at Server._handleRegisterPlatformAccessories (/usr/lib/node_modules/homebridge/lib/server.js:431:15) at Server. (/usr/lib/node_modules/homebridge/lib/server.js:36:10) at emitOne (events.js:96:13) at API.emit (events.js:191:7) at API.registerPlatformAccessories (/usr/lib/node_modules/homebridge/lib/api.js:159:8) at ShadowAccessory.resgisterUpdateccessory (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/shadows.js:88:17) at FibaroHC2.addAccessory (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:166:25) at LoadAccessories.devices.map (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:113:22

ilcato commented 7 years ago

Do you have virtual devices without any buttons?

skarotech commented 7 years ago

Yes, I do have a vd with no buttons, just a label (however if I exclude this, by prefixing with _, I still get the error.

I have also put some testing code into index.js

LoadAccessories(devices) { this.log('Loading accessories', ''); devices.map((s, i, a) => { this.log('Loading accessory - ',s.name); if (s.visible == true && s.name.charAt(0) != "_") {

to print the name of the accessory as it loads, in my case it appears to be getting an error loading the fibaro account

[8/19/2017, 9:10:01 AM] [FibaroHC2] Loading accessories [8/19/2017, 9:10:01 AM] [FibaroHC2] Loading accessory - zwave [8/19/2017, 9:10:01 AM] [FibaroHC2] Loading accessory - tonyburn74@icloud.com [8/19/2017, 9:10:01 AM] [FibaroHC2] Error getting data from Home Center: TypeError: Cannot read property 'name' of undefined at FibaroHC2.addAccessory (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:144:69) at LoadAccessories.devices.map (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:114:22) at Array.map (native) at FibaroHC2.LoadAccessories (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:111:17) at fibaroClient.getScenes.then.then (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:80:18) at process._tickCallback (internal/process/next_tick.js:109:7)

skarotech commented 7 years ago

Hi,

I have just reinstalled v2.0.6 using npm, and its all working now, and loading all devices.

ilcato commented 7 years ago

The problem with virtual devices without buttons will be fixed in an upcoming release. For now keep excluding it with _ or via a user account without the vd visibility.

framarin commented 6 years ago

I have same problem also with v.2.0.7. I tried vd label only or vd label-button, but nothing... i can't load it on homekit. Some suggestions ?

ilcato commented 6 years ago

@framarin, not sure to understand what your problem is.

framarin commented 6 years ago

Hi @ilcato, the problem is that the virtual device with label (just a label) is not load correctly on Homebridge-Fibaro-HC2 v2.0.7 Instead vd, with button, is correctly loaded. There is some workaround?

ilcato commented 6 years ago

Virtual devices with just a label are not loaded because they are a nonsense in homekit: they cannot be matched to homekit accessories.

framarin commented 6 years ago

So, if i would'like send a value (programmatically readed) between HC2 and homekit can i use a vd with slider ? If label is not usable for this purpose. Thanks for your answer.

ilcato commented 6 years ago

currently only VD button are mapped to homekit accessories. Can you describe your use case? Maybe there's another way to do it.

framarin commented 6 years ago

Simple i would'like read a parameter (ex. battery status or temperature ) on z-wave device and send it via HC2 home bridge plugin to HomeKit. These way it would be more easy than create a plugin ex novo. Thanks for your advice.

ilcato commented 6 years ago

It doesn't work this way. In homekit every aspect is described as an attribute of an accessory.

framarin commented 6 years ago

Yes i know, but virtual device is not mapped on home kit accessory? It Is possible programmatically add some properties or attributes to an vd that can be exported to an Home Kit accessory ? Thanks for your patience ....

ilcato commented 6 years ago

Currently I only mapped buttons on VD to homekit switches.