Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not picking up all Hue accessories #220

Closed
jdshkolnik opened this issue Nov 23, 2017 · 9 comments
Closed

Not picking up all Hue accessories #220

jdshkolnik opened this issue Nov 23, 2017 · 9 comments
Labels

Comments

@jdshkolnik
Copy link

I have 2 Hue bridges at home. It's been working fine for a while but, in the last week or two, this plugin has stopped picking up all the accessories from one of the bridges. It's all the same config yet it gets all 9 sensors upstairs yet only 1 out of the 5 downstairs. I'm on the latest version of everything.

@jdshkolnik
Copy link
Author

I removed both bridges and, when attempting to add, it throws this error:

fullsizeoutput_53b6

@ebaauw
Copy link
Owner

ebaauw commented Nov 24, 2017

Please post the output of homebridge -D (see Troubleshooting in the README), so I can have a look.

@CooperCGN
Copy link

@ebaauw If you remember I had the same problem. I added a new lamp and a new Hue tap yesterday and the problems are back again.
I hope I did the right thing, attached ist the log
log.txt

@ebaauw
Copy link
Owner

ebaauw commented Nov 25, 2017

Thanks, @CooperCGN!

I think I have found a bug that the Battery service isn't created when the sensor's config.battery is 0. This would explain both the error and why it disappears spontaneously when restarting homebridge after a while: the Hue bridge has updated the battery value.

Not sure how the Hue bridge works here - I don't have any motion sensors connected to my Hue bridge at the moment. But I could image it initialises config.battery to 0 and waits for the first report from the sensor before updating it. This could be up to two hours for the Hue motion sensor. Would be nice if you can confirm config.battery is/was 0 at the time of the error.

Anyways, I'll improve the error handling during setup, to:

  • Log the resource on which homebridge-hue chokes together with the error;
  • Continue setup for the remaining resources.

ebaauw added a commit that referenced this issue Nov 25, 2017
Encapsulate creating the accessory for each individual resource in a
try/catch and log the resource when an error is caught.  This also
causes setup to continue with the other resources after an error.
@ebaauw ebaauw added the bug label Nov 25, 2017
@CooperCGN
Copy link

I guess you’re right as just shortly before that happened the Home app told me that the batteries were almost empty on a few devices. I will install the new version today in the afternoon and then see what happens. How can I find out what state config.battery is in?

@ebaauw
Copy link
Owner

ebaauw commented Nov 26, 2017

I will install the new version today

v0.5.47

How can I find out what state config.battery is in?

Using the CLIP API debugger on the Hue bridge or with ph.sh:

$ ph_get /sensors/xx/config/battery
100

As of v0.5.47, homebridge-hue should log the full resource in case of an error during setup (incl. config.battery).

@CooperCGN
Copy link

OK,now it's getting even more weird. Version 0.5.43 was the one I had installed before. Now with the latest version the service enters a failed state, see attached log.txt. Also attached the dump for the sensors from the bridge and my config.json.
config.txt
log.txt
sensors.txt

@CooperCGN
Copy link

CooperCGN commented Nov 26, 2017

Oh I see, I might need to update my homebridge version first
Did it, it's up and running again, sensors are back.

@ebaauw
Copy link
Owner

ebaauw commented Nov 26, 2017

Nov 26 13:01:50 raspberrypi homebridge[3077]: Error: The requested platform 'Hue' was not registered by any plugin.

Homebridge throws this error when you try and initialise a platform from config.json for which the plugin wasn't loaded. Typically, the plugin hasn't been installed, or has been installed to the wrong directory. Make sure to install homebridge and homebridge-hue using:

sudo npm -g install homebridge --unsafe-perm
sudo npm -g install homebridge-hue

@ebaauw ebaauw closed this as completed Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants