benleb / ad-automoli

💡 Fully automatic light management based on conditions like motion, illuminance, humidity, and other clever features
https://github.com/benleb/ad-automoli
MIT License
110 stars 29 forks source link

Added support to turn off lights that were manually turned on and minor bug fixes #92

Closed mkotler closed 6 months ago

mkotler commented 2 years ago

Fixes #24: If only_own_events is False, then added state change listeners for all lights. Then, when a state change occurs outside automoli, manually setup the timers. Also added an additional, optional config property, delay_outside_events, that if present will override the standard delay in the cases when the light has been turned on manually.

delay_outside_events is useful, for example, when you want lights to go off quickly when turned on automatically, but have a longer delay if a light switch is used. I have a 3 minute delay in a hallway (assuming someone is just passing through) but have set delay_outside_events to 15 minutes if the light switch is used (and someone might need to linger in the hallway).

In an attempt to minimize backward compatibility issues, the code assumes that if only_own_events is not present in the config, it is None and not False.

Additionally, applied bug fixes for handling multiple lights, one daytime, and minor log/readme cleanup:

evildad commented 1 year ago

@mkotler Tried the PR with only_own_events but automoli still turned the lights, turned on outside of automoli, off.

TonnyMunkNielsen commented 6 months ago

@

@mkotler Tried the PR with only_own_events but automoli still turned the lights, turned on outside of automoli, off.

Same, unfortunately.

It seems to somewhat work whenever the outside event happens before motion is detected, but it fails in my scenario where I: 1) Trigger the motion sensor to go to the laundry room. 2) Turn off and on the light to get to "manual mode". 3) Trigger the motion sensor again on the way out of the laundry room. 4) Wait for the timer to expire.

mkotler commented 6 months ago

@evildad and @TonnyMunkNielsen, my apologies that the PR is not working. That PR is very old. However, if you want to look at my fork of Automoli, feel free to try it out. A lot of the code has been rewritten and there are a lot of additional features. Huge thanks to benleb for the starting point and inspiration. If my fork still doesn't work in your situation (or you find other issues) please let me know!