ebaauw / homebridge-hue

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

nativeHomeKit vs philipsLights #259

Closed Kugelfang666 closed 6 years ago

Kugelfang666 commented 6 years ago

First of all many thanks for this great addon! I've been using it for quite a while not and its great!

I'm aware that the Hue bridge does natively expose sensors and switches as of a few weeks. However, to my experience, the devices natively exposed are much less sensitive.

E.g. if have a motion sensor recognize a motion i see that the instance exposed by homebirdge-hue is immediately triggered (lighting up in homekit) whereas the identical, natively exposed one does not fire most of the time. Same holds true for button events.

Moreover, I use homebridge-sensors to toggle the motion detectors on and off. The instances exposed by homebridge-hue do switch to inactive once toggled to "off" whereas the natively exposed instances show up as not reachable (red lable in homekit).

Fundamentally your implementation seems to be working much better. Hence i would like to use homebirdge-hue to expose both, all sensors (Lux,Temp, motion, buttons) and all non-Philips lights (Osram). Up until now this was possible with the "philipsLights" command. However if i understand your switch to "nativeHomeKit " correctly, this will not be possible anymore am i correct?

CooperCGN commented 6 years ago

You need to "blacklist" the native lights. I am doing exactly the same as you with my Osrams and Busch-Jaeger flush mounted lamps . Go into the hue app and under settings -> about you will find the numbers of all lamps. Then create a json in a text editor like this containing all numbers you wish to exclude

{ "name": "homebridge-hue", "classid": 1, "description":"blacklist", "links": [ "/lights/2", "/lights/6", "/lights/35" ] }

Finally you need to post this to your bridge over the clip debug tool found under http://IP of your Hue Bridge/debug/clip.html with the link /api/USERNAME/resourcelinks and the json as body, restart homebridge. Replace USERNAME with the user you created for the config.json of homebridge. Remember, every time you add/change native lamps you need to update this.

ebaauw commented 6 years ago

Hence i would like to use homebirdge-hue to expose both, all sensors (Lux,Temp, motion, buttons) and all non-Philips lights (Osram). Up until now this was possible with the "philipsLights" command.

@Kugelfang666, you're the third person to ask this, I'll split nativeHomeKit into nativeHomeKitLights and nativeHomeKitSensors.

However if i understand your switch to "nativeHomeKit " correctly, this will not be possible anymore am i correct?

As @CooperCGN indicates, the current workaround is to use a blacklist for your Philips Hue lights. You can also get the light numbers in Eve (or any another HomeKit app except Apple's Home): it lists them under the Resource characteristic.

Moreover, I use homebridge-sensors to toggle the motion detectors on and off.

You can use homebridge-hue for that as well. The difference is that I deliberately expose the sensor's config.on as Enabled, a custom characteristic, instead of as On, so Siri won't turn off the motion sensor when I tell her to turn off the room the sensor is in. Again, Apple's Home doesn't support this, but Eve does. You can create a HomeKit scene that includes Enabled in Eve, and then recall the scene from Apple's Home and/or Siri.

Kugelfang666 commented 6 years ago

Dear all, RE nativeHomekit: thanks a lot for the quick response! i guess i will just wait on the updated version with the seperated nativeHomeKit variables!

RE: switching ON/OFF motion sensord: I had many times problems that motion sensors were interfering with activated scenes allthoug i did use iconnecthue to specifically block them from doing so. Hence, i set up rules in homekit which deactivate the motion sensors upon using a physical button to switch on lights and reactivate them when switching lights off using physical buttons. This helped a lot to reduce these kind of problems. Up untill now i did not relaize that the Motionsensors were deactivated one i asked Siri to switch off al lights

ebaauw commented 6 years ago

i guess i will just wait on the updated version with the seperated nativeHomeKit variables!

No, you don't ;-) v0.5.63.

I had many times problems that motion sensors were interfering with activated scenes allthoug i did use iconnecthue to specifically block them from doing so.

The problem with motion sensors is that they're just that: motion sensors. Great for turning on lights when there's motion. Fine for turning off lights in hallways when there's no more motions. Stupid to turn off lights in rooms, while you're still there, sitting still, watching TV, or happily enhancing homebridge-hue. I've implemented an elaborate series bridge/gateway rules to turn off the lights only when I've left a room (motion in the room - motion in the adjacent hallway - no more motion in the room within 15 seconds - no more motion for the next five minutes). I blink the lights after four minutes as a warning, prompting me to wave at the sensor in case some-one else left the room.

Kugelfang666 commented 6 years ago

@ebaauw: wow thanks a lot again, I'll test it tomorrow and report back!

RE: interfering motion sensors: i was thinking in the same direction. In fact im currently tetsing running homebirdge as a plugin for HASSIO. (which apparently works realy nice) Since home assistangt has a much more comprehensive idear of whats going on in the rooms (e.g. TV is on/off, which rooms are playing music, etc) i wanted to playe with more elaborate rules as well. Lets see where this leads to!

EDIT: ok, could not resists and tryed it right away, works like a charm! Thanks a lot for the update!

CooperCGN commented 6 years ago

Thanks, so basically I can delete my blacklist and set nativeHomeKitSensors to true to just get sensors and non Philips lights? Is that correct? Just want to make sure that I get it right before destroying all my scenes again. ;)

Kugelfang666 commented 6 years ago

i set "nativeHomeKitLights": true, "nativeHomeKitSensors": false, to get all osram lamps and all sensors to show up while all philps lights are not beeing shown

CooperCGN commented 6 years ago

I see, it’s the other way round, got it, thanks!