ebaauw / homebridge-hue

Homebridge plugin for Philips Hue
Apache License 2.0
901 stars 91 forks source link

Error homebridge hue during initialization #428

Closed fvanderbos closed 5 years ago

fvanderbos commented 5 years ago

Hi,

My homebridge/homebridge hue was running perfectly fine, however, now with a few additions (two ubisys D1 dimmers) to my network it hangs up after a couple of steps (see -D log file below):

[1/12/2019, 8:56:09 PM] Loaded plugin: homebridge-hue [1/12/2019, 8:56:09 PM] Registering platform 'homebridge-hue.Hue' [1/12/2019, 8:56:09 PM] --- [1/12/2019, 8:56:09 PM] Loading 1 platforms... [1/12/2019, 8:56:09 PM] [Hue] Initializing Hue platform... [1/12/2019, 8:56:09 PM] [Hue] homebridge-hue v0.11.8, node v11.6.0, homebridge v0.4.45 [1/12/2019, 8:56:09 PM] [Hue] warning: not using recommended node version v10.15.0 LTS [1/12/2019, 8:56:09 PM] [Hue] npm registry: get /homebridge-hue [1/12/2019, 8:56:09 PM] Loading 0 accessories... [1/12/2019, 8:56:09 PM] [Hue] npm registry: get /homebridge-hue ok [1/12/2019, 8:56:09 PM] [Hue] config.json: {"platform":"Hue","name":"Hue","host":"10...03","users":{"00212EFFFF02A6AA":"***1"},"lights":false} [1/12/2019, 8:56:09 PM] [Hue] 10.*..03: bridge request 1: get /config [1/12/2019, 8:56:09 PM] [Hue] 10..***.03: bridge request 1: ok [1/12/2019, 8:56:09 PM] [Hue] Phoscon-GW: dresden elektronik deCONZ gateway v2.5.54, api v1.16.0 [1/12/2019, 8:56:09 PM] [Hue] Phoscon-GW: gateway request 2: get / [1/12/2019, 8:56:09 PM] [Hue] Phoscon-GW: gateway request 2: ok [1/12/2019, 8:56:09 PM] [Hue] Phoscon-GW: gateway request 3: get /groups/0 [1/12/2019, 8:56:09 PM] [Hue] Phoscon-GW: gateway request 3: get /groups/0 [1/12/2019, 8:56:09 PM] [Hue] Phoscon-GW: gateway http status 404 Not Found

Regards, Fedderik

ebaauw commented 5 years ago

That's weird. It would seem deCONZ returns an http status 404, but I've not seen that before. Also the communication with deCONZ seems OK, given that the get /config and the get / succeed.

When restarting homebridge, does it always hang at this point?

What happens when you try to query the group manually?

$ ph -H 10.x.x.03 get /groups/0

Are you running other plugins?

fvanderbos commented 5 years ago

Hi Erik,

In response to your queries

On 12 Jan 2019, at 21:11, Erik Baauw notifications@github.com wrote:

That's weird. It would seem deCONZ returns an http status 404, but I've not seen that before. Also the communication with deCONZ seems OK, given that the get /config and the get / succeed.

When restarting homebridge, does it always hang at this point?

What happens when you try to query the group manually?

$ ph -H 10.x.x.03 get /groups/0 Are you running other plugins?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ebaauw/homebridge-hue/issues/428#issuecomment-453777462, or mute the thread https://github.com/notifications/unsubscribe-auth/AseQ2dqhmMbSJYR-DmOY1rVh1pnF-Dckks5vCkFggaJpZM4Z80pl.

ebaauw commented 5 years ago

Could you unlock the gateway and run ph -H 10.0.0.03 createuser and try ph -H 10.0.0.03 get /groups/0 again?

fvanderbos commented 5 years ago

After running ph -H .. createuser I get the following pi@phoscon:~/.homebridge $ ph -H 10.0.0.03 get /groups/0 ph get: error: 3 resource, /groups/0, not available

On 12 Jan 2019, at 21:28, Erik Baauw notifications@github.com wrote:

Could you unlock the gateway and run ph -H 10.0.0.03 createuser and try ph -H 10.0.0.03 get /groups/0 again?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ebaauw/homebridge-hue/issues/428#issuecomment-453778582, or mute the thread https://github.com/notifications/unsubscribe-auth/AseQ2aOTe7hoKeSZXHESTlwe-CCKG3_xks5vCkV6gaJpZM4Z80pl.

ebaauw commented 5 years ago

This is an issue with deCONZ, as far a I know, /groups/0 should always be available.

I should change homebridge-hue to log the error message (when available) instead of the http status, like ph.

fvanderbos commented 5 years ago

Thanks for the very quick support. Will check deconz first now.

Sent from my iPhone

On 12 Jan 2019, at 22:17, Erik Baauw notifications@github.com wrote:

This is an issue with deCONZ, as far a I know, /groups/0 should always be available.

I should change homebridge-hue to return the error message (when available) instead of the http status, like ph.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

ebaauw commented 5 years ago

I looked at handling the error in homebridge-hue, but the code is too delicate to mess with (at least until moving to dynamic platform accessories). You might check the groups table of in the deCONZ database if the row for /groups/0 is missing or has been marked deleted. It should look like: screenshot 2019-01-13 at 21 42

mtjoernelund commented 3 years ago

I think I may have a similar issue. I updated deConz, lost access to my RaspBee, revered to earlier version of deConz, downgraded firmware on the RaspBee for deConz to rediscover the RaspBee. Then I updated deConz again (initially to 2.5.84) and updated firmware of the RaspBee through the Phoscon web app. After all of this, everything seems to work as expected in the Phoscon app, but now I just discovered that my homebridge instance is in an endless reboot loop. It starts up and then after a moment it restarts. Only error I get in the log is below:

`0|homebrid | [22/11/2020, 11:13:18] [Homebridge UI] Homebridge Config UI X v4.33.0 is listening on :: port 8000

0|homebrid | [22/11/2020, 11:14:41] [Hue] config.json: warning: forceCt: ignoring unknown key

0|homebrid | [22/11/2020, 11:14:41] [Hue] warning: not using recommended node version v14.15.0 LTS

0|homebrid | [22/11/2020, 11:14:42] [Hue] PlayPi: warning: not using recommended deCONZ gateway version 2.5.84

0|homebrid | [22/11/2020, 11:14:43] [Hue] PlayPi: gateway request 2: get /groups/0

0|homebrid | [22/11/2020, 11:14:43] [Hue] PlayPi: gateway request 2: error 3 resource, /groups/0, not available

0|homebrid | HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 0000008C-0000-1000-8000-0026BB765291. Adding anyway.

0|homebrid | HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 0000008C-0000-1000-8000-0026BB765291. Adding anyway.

0|homebrid | HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 0000008C-0000-1000-8000-0026BB765291. Adding anyway.

0|homebrid | HAP Warning: Characteristic 000000E3-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 0000008C-0000-1000-8000-0026BB765291. Adding anyway.

0|homebrid | [22/11/2020, 11:14:50] [Homebridge UI] Homebridge Config UI X v4.33.0 is listening on :: port 8000`

I have tried the steps outlined above and after trying ph -H 127.0.0.1 get groups/0 I get the response ph get: warning: api error 3: resource, /groups/0, not available

Can I just add /groups/0 to the deConz database to fix this?

ebaauw commented 3 years ago

Yeah, you can try that. Not sure how /groups/0 gets to disappear from the REST API. I should always be there.

mtjoernelund commented 3 years ago

Well, I ended up reinstalling Homebridge. Had it running via pm2 rather than with hb-service. The crash in deConz had already caused HomeKit to lose all my lights and sensors, so had to put everything in place anyways. However after reinstalling I still have the same error in the homebridge log, but it does not seem to do anything. Homebridge no longer crash and I can control everything. Crossing my fingers all is well (knock on wood ... famous last words...)

Ghitafjorback commented 3 years ago

Hi, I Think I have a similar issue. See error below. Can you help me fix this?

[11/01/2021, 08:42:29] [Hue] Fjorback-GW: api error 3: resource, /groups/0, not available - retrying in 15s [11/01/2021, 08:42:44] [Hue] Fjorback-GW: dresden elektronik deCONZ gateway v2.7.1, api v1.16.0 [11/01/2021, 08:42:45] [Hue] Fjorback-GW: request 2: api error 3: resource, /groups/0, not available [11/01/2021, 08:42:45] [Hue] Fjorback-GW: api error 3: resource, /groups/0, not available - retrying in 15s [11/01/2021, 08:43:00] [Hue] Fjorback-GW: dresden elektronik deCONZ gateway v2.7.1, api v1.16.0 [11/01/2021, 08:43:00] [Hue] Fjorback-GW: request 2: api error 3: resource, /groups/0, not available [11/01/2021, 08:43:00] [Hue] Fjorback-GW: api error 3: resource, /groups/0, not available - retrying in 15s [11/01/2021, 08:43:15] [Hue] Fjorback-GW: dresden elektronik deCONZ gateway v2.7.1, api v1.16.0 [11/01/2021, 08:43:15] [Hue] Fjorback-GW: request 2: api error 3: resource, /groups/0, not available [11/01/2021, 08:43:15] [Hue] Fjorback-GW: api error 3: resource, /groups/0, not available - retrying in 15s

Ghitafjorback commented 3 years ago

I solved it by doing as @ebaauw mentioned regarding the database. My 0x0000 was indeed missing. How I have still not figured out. I added the line manually saved the database and restarted my pi. It took several hours for the pi to restart, and I was close to giving up, (I took out the ConbeeII stick and tried again.... waited ages) then suddenly I could access my pi via VNC, and I came to the login screen... Normally my pi would just login after a restart, but this time I had to login. I attached the ConbeeII stick again, opened a cmd in the pi, and tried to start deconz, but I had to run "systemctl daemon-reload" and then "sudo systemctl start deconz"... Waited another half an hour and the FINALLY Homebridge started and I am now back to my old setup. :)