ebaauw / homebridge-hue

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

Question - unreachable lights #80

Closed brownad closed 7 years ago

brownad commented 7 years ago

Hi Is there a way to activate discovery of unreachable lights?

When the switches are off they still have capability in this plugin to falsely switch them on. Is this something available and I've missed?

ebaauw commented 7 years ago

Is there a way to activate discovery of unreachable lights?

Short answer: no.
Long answer: For lights (and sensors) connected to the Hue bridge, homebridge-hue exposes the reachable attribute through the StatusFault characteristic. The iOS built-in Home app happily ignores this, but Eve shows a red exclamation mark when reachable is false.
Note however, that reachable does not indicate whether the light is actually reachable. It only indicates whether the Hue bridge received a response, the last time it polled the light. The Hue API provides no way to check whether a light can be reached currently, let alone whether it's disconnected from power.

When the switches are off [...]

The Hue bridge doesn't know that.

[...] they still have capability in this plugin to falsely switch them on. Is this something available and I've missed?

This is a feature of the Hue bridge, the official Philips Hue app works exactly the same: you can still change the light when reachable is false.

brownad commented 7 years ago

Thank you

Sent from my iPhone

On 15 Mar 2017, at 21:03, Erik Baauw notifications@github.com wrote:

Is there a way to activate discovery of unreachable lights?

Short answer: no. Long answer: For lights (and sensors) connected to the Hue bridge, homebridge-hue exposes the reachable attribute through the StatusFault characteristic. The iOS built-in Home app happily ignores this, but Eve shows a red exclamation mark when reachable is false. Note however, that reachable does not indicate whether the light is actually reachable. It only indicates whether the Hue bridge received a response, the last time it polled the light. The Hue API provides no way to check whether a light can be reached currently, let alone whether it's disconnected from power.

When the switches are off [...]

The Hue bridge doesn't know that.

[...] they still have capability in this plugin to falsely switch them on. Is this something available and I've missed?

This is a feature of the Hue bridge, the official Philips Hue app works exactly the same: you can still change the light when reachable is false.

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

friko21 commented 7 years ago

Is it possible to set the default value for unreachable to power off? Maybe with a key in the config file. The only time my lights are unreachable is if they are shut off by using the wall mounted switch.

ebaauw commented 7 years ago

Is it possible to set the default value for unreachable to power off?

What do you mean by default value? Technically, I could report Power false when reachable is false. This is what homebridge-philipshue used to do. I suppose when you regularly use the wall switches (so 20th century), you would rather incorrectly report the light as off occasionally while it's actually reachable and on, than incorrectly report it as on, all the time while it's powered off.

Setting the light on to false when reachable is false is a bad idea. Lights would turn off spontaneously, seemingly at random, when there's a glitch in the ZigBee network.

Maybe with a key in the config file.

That would be a good idea, as it would result in some weird behaviour: if you'd switch the light on in HomeKit while it's still powered off, homebridge-hue would report it as on, as the Hue bridge returns OK. At the next heartbeat, homebridge-hue would report the light as off, as reachable is still false. Also any change in brightness or colour (temperature) would be accepted when on is true, whereas the Hue bridge returns error 201 when you try to change them when on is false.

The only time my lights are unreachable is if they are shut off by using the wall mounted switch.

See my previous post: the reachable attribute does not reflect whether the light is actually reachable. The Hue api provides is no way to detect accurately whether the light is reachable.

friko21 commented 7 years ago

I thought that unreachable lights are shown as "on" by default by homebridge/homekit. But I can change the state to "off" manually.

My wish is to report the unreachable lights as power off to HomeKit. Not to change the state in the HueBridge. That way the lights would not be turned off by a glitch. It's only for cosmetic purpose.

I have a wall mounted zigbee light switch (Busch Jäger dimming switch) an it's works quite fine with non smart lights, a living colors and your plugin. I can't give up the wall mounted switches because of the woman accaptens factor;-)

ebaauw commented 7 years ago

I thought that unreachable lights are shown as "on" by default by homebridge/homekit. But I can change the state to "off" manually.

No, the Hue bridge continues to report them as on true and homebridge-hue simply copies that.

My wish is to report the unreachable lights as power off to HomeKit. Not to change the state in the HueBridge. That way the lights would not be turned off by a glitch. It's only for cosmetic purpose.

I'll see what I can do.

I have a wall mounted zigbee light switch (Busch Jäger dimming switch) an it's works quite fine with non smart lights, a living colors and your plugin

Cool! I've been looking at those, but the price is ridiculous and they're only rated for 200W. I'm still looking for a way to integrate my dinner table light, which consists of three pendants with an 80W R7S 230V halogen bulb each.
Is the switch working correctly from HomeKit? Could you please post the unsupported light warning message for the switch?

friko21 commented 7 years ago

That would be great if you could implement that. Thanks.

The model I have used this switch: http://www.busch-jaeger-catalogue.com/6710-0-0007,artikel.html and http://www.busch-jaeger-catalogue.com/6730-0-0074,artikel.html

I use it with 6 E14 dimmable Leds. It works great with your plugin. Even the manufacturer is promoted. I can turn the lights on and off, set the dimming value from the home app, eve and Siri.

I can't post the warning at the moment because the homebridge log file got that big, that my iPhone won't load it correctly over homebridge-server anymore :-o

ebaauw commented 7 years ago

v0.3.12 reports light Power as Off when the Hue bridge reports reachable as false.

Maybe with a key in the config file.

That would be a good idea, as it would result in some weird behaviour: if you'd switch the light on in HomeKit while it's still powered off, homebridge-hue would report it as on, as the Hue bridge returns OK. At the next heartbeat, homebridge-hue would report the light as off, as reachable is still false. Also any change in brightness or colour (temperature) would be accepted when on is true, whereas the Hue bridge returns error 201 when you try to change them when on is false.

While testing, my worries seem unwarranted, so no config.json parameter. In the iOS builtin Home app, you cannot set colour or brightness without also setting the light on, and, as of v2.6, Eve sets the light on automatically when you change the colour or brightness while it's off.

@friko21, I'd really appreciate the warning message for the Busch Jäger dimmer. Maybe you can recycle the log file while upgrading to v0.3.12? Thanks.

friko21 commented 7 years ago

I have done the update to v0.3.12 and its exactly what I thought of. Thank you so much!

And I got the warning message for you: [2017-03-24 17:33:16] [Hue] Philips hue: /lights/5: warning: unknown light model {"state":{"on":false,"bri":254,"alert":"none","reachable":true},"type":"Dimmable light","name":"SZ_HUE_DECKENLICHT","modelid":"RM01","manufacturername":"Busch-Jaeger","uniqueid":"XX:XX:XX:XX:XX:XX:XX:XX-XX","swversion":"1.0.0"}

ebaauw commented 7 years ago

Busch-Jäger dimmer added as supported light in v0.3.13.

ebaauw commented 7 years ago

so no config.json parameter

Bad idea, see issue #92. Added the config.json parameter, wallSwitch to v0.3.14.

@brownad, @friko21: by default, homebridge-hue behaves like v0.3.11 - be sure to add "wallSwitch": true to your config.json to keep the v0.3.12 behaviour.