Jason-Morcos / homebridge-magic-occupancy

Occupancy sensor linked to one or more switches with a built-in delay not-unoccupied delay for Homebridge
GNU General Public License v3.0
79 stars 3 forks source link

Feature Request - Different TimeOut settings #27

Open darrenmcuk opened 2 years ago

darrenmcuk commented 2 years ago

Would it be possible to extend the plugin to permit different occupancy timeouts depending on the time of day.

Example….in the bathroom during the day 10 mins…during the dead of night 3 mins?

Thanks

Darren

Jason-Morcos commented 2 years ago

Hey there, It's theoretically possible but I think it could be pretty complex to make it configurable in a nice and clean way.

How about creating multiple occupancy sensors and making the links between each occupancy sensor and your accessory only apply for certain parts of the day? (Ex. A daytime and nighttime occupancy sensor each with the same switches linked to the same triggers but with their output automations set for different hours.). Would this perhaps work?

trickster-is-weak commented 2 years ago

Something similar that could be cool is changing the timeout based on how often motion is detected in a single occupation. So for example, in my home office, the timeout is 2 minutes. However, it would be cool if there was away to create a changing time out based on how long its been occupied or how many motion triggers are hit.

  1. Motion is triggered, minimum timer set, 2 minutes for example
  2. Motion is triggered while still occupied, increase time out by by 10%
  3. Repeat until a maximum is hit, say 5 minutes.

I'm not much of a javascript guy, but I might try and fiddle with it myself and submit a PR if it works.

darrenmcuk commented 2 years ago

That could be really useful…Dining Rooms etc….