nitaybz / homebridge-delay-switch

Delay switches for Homebridge: https://github.com/nfarina/homebridge
MIT License
146 stars 20 forks source link

Use with Hue motion sensor #39

Closed krazyflipj closed 3 years ago

krazyflipj commented 3 years ago

How would I setup using a Phillip hue sensor light level? I have it setup to turn on lights if light is less than 5 lux which works. Problem is it won’t reset timer because lights are on, meaning the room is above 5 Lux.

jsiegenthaler commented 3 years ago

Make these automations:

  1. When the motion sensor detects motion, AND the light level is below your desired threshold, turn on the lights.
  2. When the motion sensor detects motion, switch on the delay switch. This will reset the timer at each motion detection. (You can combine this into the above automation if you run it as a shortcut and use a couple of steps with an IF action to detect the light level, if you want to. Or also switch the delay switch on only if the light is on).
  3. When the delay switch motion sensor detects motion (it is fired at the end of the delay), switch off the lights

This makes the lights automatically come on with motion, and stay on for the delay time after the last motion is detected. You can also turn on the lights lights manually by tapping the tile in the Home app And you can turn off the auto-off at any time by turning of the delay-switch

krazyflipj commented 3 years ago

Wow thanks. I will definitely try this out. Any tips to recreating how hue app dims lights to 50% before turning off with hue sensor?

jsiegenthaler commented 3 years ago

I don't bother with any fancy dim. But if you wanted, you could make a second delay switch to control the dim period, as follows

Any motion detected turns on the lights to the desired initial (bright) brightness level, and turns on Auto-Dim and turns off Auto-Off delay switches. When the Auto-Dim delay switch timer fires, turn the lights down to the desired dim level, and switch on the Auto-Off delay switch. When the Auto-Off delay switch timer fires, turn the lights off.

Make sure you have a manual override: turning off Auto-Dim also turns off Auto-Off, allowing you to have the lights on continuosly if desired.

krazyflipj commented 3 years ago

I’ll play around with it. Thanks for the help!