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

Issue when refreshing devices... #36

Closed Gazous closed 6 years ago

Gazous commented 7 years ago

Hi,

Few days ago I found that sometimes my devices refresh was not working and iOS 10 tell me that he wasn't able to refresh. I wanted to test homebridge using an Apple Watch and it's not able to connect to devices.

If I have a look to logs, I have this

[10/12/2016, 8:19:22 PM] [FibaroHC2] There was a problem getting value from296-null [10/12/2016, 8:19:22 PM] [FibaroHC2] There was a problem getting value from28-null [10/12/2016, 8:19:22 PM] [FibaroHC2] There was a problem getting value from28-null

Any idea ?

ilcato commented 7 years ago

It seems a problem in the connection between homebridge and Home Center.

Gazous commented 7 years ago

Thanks for the quick answer but the problem is that sometimes it's working...

ilcato commented 7 years ago

Which version of Home Center firmware do you have?

Gazous commented 7 years ago

4.100

ilcato commented 7 years ago

Did you tried a reboot of the machines :-)

Gazous commented 7 years ago

Here i switch on off its working. Just after I try to refresh and have a timeout.. And just after I can turn on/off...

[10/12/2016, 8:23:08 PM] [FibaroHC2] Command: turnOff [10/12/2016, 8:23:08 PM] [FibaroHC2] Command: turnOff [10/12/2016, 8:23:08 PM] [FibaroHC2] Command: turnOff [10/12/2016, 8:26:24 PM] [FibaroHC2] There was a problem getting value from296-null [10/12/2016, 8:26:24 PM] [FibaroHC2] There was a problem getting value from28-null [10/12/2016, 8:26:24 PM] [FibaroHC2] There was a problem getting value from28-null [10/12/2016, 8:27:43 PM] [FibaroHC2] Command: turnOff [10/12/2016, 8:27:48 PM] [FibaroHC2] Command: turnOff [10/12/2016, 8:27:49 PM] [FibaroHC2] Command: turnOn

ilcato commented 7 years ago

only with device id 296 and 28 ?

Gazous commented 7 years ago

I juste made an update of homebridge and hc2 plugin. Everything is up to date. I can reboot the HC2

Gazous commented 7 years ago

What is strange is that devices 296 and 28 seems not to exist anymore...

Gazous commented 7 years ago

I think that I had to remove and re-add them in HC2, mabe I can do something in homebridge config ?

ilcato commented 7 years ago

Do they exist in Home Center?

Gazous commented 7 years ago

I think no because if I try to browse HC2 url with those ides I go back to homepage...

ilcato commented 7 years ago

You need to delete accessories folder. But if you have triggers or scenes in HomeKit they will be loose. I'm currently fixing this bug.

Gazous commented 7 years ago

ok... if it solve my issue I can do the configuration again...

ilcato commented 7 years ago

try

Gazous commented 7 years ago

If not better can I restore folder content ?

ilcato commented 7 years ago

not sure

Gazous commented 7 years ago

Just tried and it did not work...

[10/12/2016, 9:25:54 PM] [FibaroHC2] Adding Accessory: Lampe [10/12/2016, 9:25:54 PM] [FibaroHC2] Adding Accessory: Lampe [10/12/2016, 9:25:54 PM] [FibaroHC2] Adding Accessory: Suspension [10/12/2016, 9:25:54 PM] [FibaroHC2] Adding Accessory: Plafonnier [10/12/2016, 9:25:54 PM] [FibaroHC2] Adding Accessory: Plafonnier [10/12/2016, 9:25:54 PM] [FibaroHC2] Adding Accessory: Spots Salon [10/12/2016, 9:25:54 PM] [FibaroHC2] Adding Accessory: Température [10/12/2016, 9:25:54 PM] [FibaroHC2] Adding Accessory: Lampadaire [10/12/2016, 9:25:54 PM] [FibaroHC2] Adding Accessory: Spots SAM [10/12/2016, 9:25:55 PM] [FibaroHC2] Adding Accessory: Mezzanine [10/12/2016, 9:27:01 PM] [FibaroHC2] There was a problem getting value from48-null [10/12/2016, 9:27:57 PM] [FibaroHC2] There was a problem getting value from48-null

All my Triggers and rooms configuration is lost. Refresh still not working on my Apple Watch argh !!!!!!

Gazous commented 7 years ago

Just delete everything and I am doing all homekit configuration from zero. it seems to solve issue... Tell you later if everything is fine !

Gazous commented 7 years ago

Hi ! I thought everything was OK after reconfigure because now it's working on Apple Watch ! But sometimes Accessories state refresh go in timeout for all devices... Don't know why !

[10/13/2016, 12:07:12 AM] [FibaroHC2] Command: turnOff [10/13/2016, 12:07:12 AM] [FibaroHC2] Command: setValue, value: 100 [10/13/2016, 12:24:06 AM] [FibaroHC2] There was a problem getting value from44-null [10/13/2016, 12:25:36 AM] [FibaroHC2] There was a problem getting value from48-null [10/13/2016, 12:29:01 AM] [FibaroHC2] Command: turnOn [10/13/2016, 12:29:01 AM] [FibaroHC2] Command: setValue, value: 30 [10/13/2016, 12:29:01 AM] [FibaroHC2] Command: turnOn [10/13/2016, 12:29:01 AM] [FibaroHC2] Command: setValue, value: 30 [10/13/2016, 12:29:01 AM] [FibaroHC2] Command: setValue, value: [30]

[http://brice.d.pr/1dDQ5]

oxystin commented 7 years ago

Hi. Thanks for the cool plugin. I have the same problem. Sometimes Accessories state refresh go in timeout for all devices ((

Gazous commented 7 years ago

+1 still going in timeoit for me too. Is your HC2 in 4.100 ? Maybe the issue is that this HC2 firmware limits API access to avoid bugs ?

ilcato commented 7 years ago

In my log with homebridge running for more than a week there is no evidence of that error. The null message should be an error object. Try to modify index.js in the line with:

that.log("There was a problem getting value from" + IDs[0] + "-" + err);

with the following one in order to better understand the error:

that.log("There was a problem getting value from " + IDs[0] + " - " + err + " - " + response);

Gazous commented 7 years ago

Hi ilcato, I have made this change and whan refresh go in timeout I hava this error

[10/16/2016, 2:22:07 PM] [FibaroHC2] There was a problem getting value from 44 - null - undefined

Gazous commented 7 years ago

Next try goes in timeout too with this error

[10/16/2016, 2:23:57 PM] [FibaroHC2] There was a problem getting value from 31 - null - undefined

Gazous commented 7 years ago

Just after that I have a successful Refresh with no logs...

Gazous commented 7 years ago

Just now a timeout when trying to refresh with error

[10/16/2016, 8:08:54 PM] [FibaroHC2] There was a problem getting value from 172 - null - undefined

ilcato commented 7 years ago

Seems to me a problem on the HC2 side. Try to manually access the properties of the device id 172 from the browser several times:

http://HC2_IP_ADDRESS/docs/#!/devices/getDevice

Gazous commented 7 years ago

I made the test lots of times and response is immediate I can try when a timeout occurs...

ilcato commented 7 years ago

:-( If you look at the daily log what is the frequency of the issue ? Which version of node.js do you have? Which version of homebridge do you have?

Gazous commented 7 years ago

Hi, my node.js version is 4.0.0 Homebridge is 0.4.6

ilcato commented 7 years ago

Try upgrading node.js

Gazous commented 7 years ago

OK, I will try that. Is Homebridge working with latest node.js version ? What is the best way to upgrade node.js ? Thanks !

ilcato commented 7 years ago

I'm on node 6.9.1 and it works on a Raspberry Pi 3. On a Rasperry upgrade with:

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -

sudo apt-get install -y nodejs

Gazous commented 7 years ago

OK Thanks, I have tried this but I think there is something to do to force use of new version ?

Here the logs of the installation end 👍 Selecting previously unselected package nodejs. Unpacking nodejs (from .../nodejs_0.6.19~dfsg1-6_armhf.deb) ... Processing triggers for man-db ... Setting up libc-ares2:armhf (1.9.1-3+deb7u1) ... Setting up libv8-3.8.9.20 (3.8.9.20-2+rpi1) ... Setting up libev4 (1:4.11-1) ... Setting up nodejs (0.6.19~dfsg1-6) ... update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode Processing triggers for libc-bin ... pi@raspberrypi ~ $ pi@raspberrypi ~ $ node --version v4.0.0

ilcato commented 7 years ago

How did you install version 4?

Gazous commented 7 years ago

Do not remember... :-(

ilcato commented 7 years ago

What if write: which node

Gazous commented 7 years ago

/usr/local/bin/node

ilcato commented 7 years ago

is /usr/bin/node present ?

ilcato commented 7 years ago

try /usr/bin/node -v

Gazous commented 7 years ago

pi@raspberrypi ~ $ /usr/bin/node -v -bash: /usr/bin/node: No such file or directory

ilcato commented 7 years ago

Can you post the entire log of the installation?

Gazous commented 7 years ago

`pi@raspberrypi ~ $ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -

Installing the NodeSource Node.js v6.x repo...

Populating apt-get cache...

Installing packages required for setup: apt-transport-https lsb-release...

Confirming "wheezy" is supported...

Adding the NodeSource signing key to your keyring...

Creating apt sources list file for the NodeSource Node.js v6.x repo...

Running apt-get update for you...

Run apt-get install nodejs (as root) to install Node.js v6.x and npm

pi@raspberrypi ~ $ sudo apt-get install -y nodejs Reading package lists... Done Building dependency tree
Reading state information... Done The following package was automatically installed and is no longer required: libgssglue1 Use 'apt-get autoremove' to remove it. The following extra packages will be installed: libc-ares2 libev4 libv8-3.8.9.20 The following NEW packages will be installed: libc-ares2 libev4 libv8-3.8.9.20 nodejs 0 upgraded, 4 newly installed, 0 to remove and 8 not upgraded. Need to get 2,122 kB of archives. After this operation, 5,621 kB of additional disk space will be used. Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libc-ares2 armhf 1.9.1-3+deb7u1 [69.1 kB] Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libv8-3.8.9.20 armhf 3.8.9.20-2+rpi1 [1,256 kB] Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libev4 armhf 1:4.11-1 [35.3 kB] Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main nodejs armhf 0.6.19~dfsg1-6 [762 kB] Fetched 2,122 kB in 1s (1,672 kB/s) Selecting previously unselected package libc-ares2:armhf. (Reading database ... 87732 files and directories currently installed.) Unpacking libc-ares2:armhf (from .../libc-ares2_1.9.1-3+deb7u1_armhf.deb) ... Selecting previously unselected package libv8-3.8.9.20. Unpacking libv8-3.8.9.20 (from .../libv8-3.8.9.20_3.8.9.20-2+rpi1_armhf.deb) ... Selecting previously unselected package libev4. Unpacking libev4 (from .../libev4_1%3a4.11-1_armhf.deb) ... Selecting previously unselected package nodejs. Unpacking nodejs (from .../nodejs_0.6.19~dfsg1-6_armhf.deb) ... Processing triggers for man-db ... Setting up libc-ares2:armhf (1.9.1-3+deb7u1) ... Setting up libv8-3.8.9.20 (3.8.9.20-2+rpi1) ... Setting up libev4 (1:4.11-1) ... Setting up nodejs (0.6.19~dfsg1-6) ... update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode Processing triggers for libc-bin ... pi@raspberrypi ~ $ pi@raspberrypi ~ $ node --version v4.0.0 `

ilcato commented 7 years ago

try: nodejs -v

Gazous commented 7 years ago

pi@raspberrypi ~ $ nodejs -v v0.6.19

ilcato commented 7 years ago

sudo find / -name node -print

Search for all node file in the system.

Gazous commented 7 years ago

pi@raspberrypi ~ $ sudo find / -name node -print /usr/local/bin/node /usr/local/lib/node_modules/airsonos/node_modules/babel/node_modules/babel-core/lib/generation/node /usr/local/share/doc/node /usr/local/include/node /usr/share/doc/node ...

ilcato commented 7 years ago

Try removing with: apt-get remove nodejs nodejs-legacy -y apt-get remove npm -y

In the mean time node 7 is available (will test it tonight),

Gazous commented 7 years ago

Why should I remove npm ?