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

Only virtual devices created #37

Closed aivs closed 7 years ago

aivs commented 7 years ago

I use

My config.json in ~/.homebridge/

{
    "bridge": {
        "name": "FIBARO-HC2",
        "username": "CC:22:3D:E3:CE:70",
        "port": 51826,
        "pin": "012-34-567"
    },
    "platforms": [
        {
            "platform": "FibaroHC2",
            "name": "FibaroHC2",
            "host": "10.0.1.43/",
            "username": "admin",
            "password": "admin",
            "grouping": "",
            "pollerperiod": "2"
        }
    ]
}

My devices: Fibaro Relay x2 Fibaro Roller Shutter x2 Fibaro RGBW Controller x2 Z-Wave.Me Z-Uno x1 Virtual device Denon Remote Virtual device Dune Remote Virtual device Sony TV Remote

After Homebridge starting I see only 3 virtual devices, where is other devices?

pi@raspberrypi:~ $ /usr/local/node_modules/homebridge/bin/homebridge * 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 [10/13/2016, 11:39:14 PM] Loaded plugin: homebridge-fibaro-hc2 [10/13/2016, 11:39:14 PM] Registering platform 'homebridge-fibaro-hc2.FibaroHC2' [10/13/2016, 11:39:14 PM] --- [10/13/2016, 11:39:14 PM] Loaded config.json with 0 accessories and 1 platforms. [10/13/2016, 11:39:14 PM] --- [10/13/2016, 11:39:14 PM] Loading 1 platforms... [10/13/2016, 11:39:14 PM] [FibaroHC2] Initializing FibaroHC2 platform... [10/13/2016, 11:39:15 PM] [FibaroHC2] Configuring Accessory: Dune [10/13/2016, 11:39:15 PM] [FibaroHC2] Configuring Accessory: Sony TV [10/13/2016, 11:39:15 PM] [FibaroHC2] Configuring Accessory: Denon Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

┌────────────┐     
│ 012-34-567 │     
└────────────┘     

Plugin - DidFinishLaunching [10/13/2016, 11:39:15 PM] [FibaroHC2] Fetching Fibaro Home Center rooms ... [10/13/2016, 11:39:15 PM] [FibaroHC2] Server Listening... [10/13/2016, 11:39:15 PM] Homebridge is running on port 51826. [10/13/2016, 11:39:15 PM] [FibaroHC2] Fetching Fibaro Home Center devices ...

http://10.0.1.43/api/devices hc2.json.txt

ilcato commented 7 years ago

It seems to me that the other devices are named with cyrillic letters. I'don't know if this is a possible source of problem. Try to change one of the names, than remove accessories folder and then restart homebridge.

aivs commented 7 years ago

I renamed all devices, rooms and sections to latin letters, the result is same, I see only Virtual devices. Than I renamed Virtual devices to cyrillic, they are still generated. So, the problem is not with cyrillic letters.

Have you tested homebridge-fibaro-hc2 with HC2 on FW version 4.100?

ilcato commented 7 years ago

Yes, I'm on 4.100

ilcato commented 7 years ago

Try to create a user in HC2 and associate to it your devices and than specify in config.json the username and password of the new user. Start with a few devices and than add the others.

aivs commented 7 years ago

Ok, I will try it. Are you use admin user?

ilcato commented 7 years ago

I defined a specific user for homebridge. No admin.

aivs commented 7 years ago

With new user the problem is same. I created new virtual device and I see in log that it added:

 pi@raspberrypi:~/.homebridge $ /usr/local/node_modules/homebridge/bin/homebridge
*** 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>
[10/17/2016, 11:20:56 AM] Loaded plugin: homebridge-fibaro-hc2
[10/17/2016, 11:20:56 AM] Registering platform 'homebridge-fibaro-hc2.FibaroHC2'
[10/17/2016, 11:20:56 AM] ---
[10/17/2016, 11:20:56 AM] Loaded config.json with 0 accessories and 1 platforms.
[10/17/2016, 11:20:56 AM] ---
[10/17/2016, 11:20:56 AM] Loading 1 platforms...
[10/17/2016, 11:20:56 AM] [FibaroHC2] Initializing FibaroHC2 platform...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ 012-34-567 │     
    └────────────┘     

Plugin - DidFinishLaunching
[10/17/2016, 11:20:58 AM] [FibaroHC2] Fetching Fibaro Home Center rooms ...
[10/17/2016, 11:20:58 AM] [FibaroHC2] Server Listening...
[10/17/2016, 11:20:58 AM] Homebridge is running on port 51826.
[10/17/2016, 11:20:58 AM] [FibaroHC2] Fetching Fibaro Home Center devices ...
[10/17/2016, 11:20:58 AM] [FibaroHC2] Adding Accessory: Dune
[10/17/2016, 11:20:58 AM] [FibaroHC2] Adding Accessory: Sony TV
[10/17/2016, 11:20:58 AM] [FibaroHC2] Adding Accessory: Denon
[10/17/2016, 11:20:58 AM] [FibaroHC2] Adding Accessory: New Device

But if I added real device, it does not appear.

In HC2 in menu "Edit access right" I removed all 4 virtual devices from my new user. Now virtual devices are not created, but real and also not created

ilcato commented 7 years ago

I tried to import your device list through the debugger and it works. Very strange. I will further investigate.

aivs commented 7 years ago

What version of node are you using?, I'm 6.7

ilcato commented 7 years ago

I'm on 6.8. Which version of Homebridge are you using?

aivs commented 7 years ago

now I'm updated to 6.8.1, the result is same, I will try with another HC2

ilcato commented 7 years ago

ok, keep me up to date.

aivs commented 7 years ago

I have another RPI3 and another HC2. On RPI3 I installed RASPBIAN JESSIE LITE (sudo apt-get update && sudo apt-get upgrade).

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.4.23-v7+ #913 SMP Tue Oct 4 14:16:19 BST 2016 armv7l GNU/Linux

Then I installed Node 6.8.1:

pi@raspberrypi:~ $ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
pi@raspberrypi:~ $ sudo apt install -y nodejs
pi@raspberrypi:~ $ node -v
v6.8.1

Created .homebridge/config.json

{
    "bridge": {
        "name": "FIBARO-HC2",
        "username": "CC:22:3D:E3:CE:80",
        "port": 51826,
        "pin": "012-34-568"
    },
    "platforms": [
        {
            "platform": "FibaroHC2",
            "name": "Fibaro",
            "host": "192.168.0.59/",
            "username": "admin",
            "password": "admin",
            "grouping": "",
            "pollerperiod": "1"
        }
    ]
}

Again I see only virtual devices in log and in app Home I see buttons from this devices, so real devices not appeared.

aivs commented 7 years ago

I can give you access to my RPI and HC2 If you want

aivs commented 7 years ago

On the same Raspberry I tested homebridge-zway, all works fine.

aivs commented 7 years ago

Try to create clean raspbian and install node v6.8.1 with homebridge.

ilcato commented 7 years ago

In my test environment (a mac) I have:

Plugin - DidFinishLaunching [2016-10-17 22:35:15] [FibaroHC2] Server Listening... [2016-10-17 22:35:15] Homebridge is running on port 51826. [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Уличный Фонарь [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Запустить Котел [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Котел потух [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: LED дверь [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: LED спальня [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Ворота [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Лампа ворот [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Вытяжка [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Левая рольставня [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Dune [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Средняя рольставня [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Столешница [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Правая рольставня [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Sony TV [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: Denon [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: 15.2 [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: 15.3 [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: 15.4 [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: 55.0 [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: 55.4 [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: 55.5 [2016-10-17 22:38:19] [FibaroHC2] Adding Accessory: 15.0

ilcato commented 7 years ago

Can you give access to your environment?

aivs commented 7 years ago

Github unsupported private message, please write me on aivsATz-wave.me, I will send you access info.

ilcato commented 7 years ago

Found the problem. It was an error on config.json for the grouping parameter. Allowed values are "none" or "room". An empty value is wrong. I will add a check in the startup procedure.

aivs commented 7 years ago

Now it's working with grouping="none" Cool! thanks!