nfarina / homebridge-dummy

Dummy switches for Homebridge: https://github.com/nfarina/homebridge
262 stars 82 forks source link

(feature) random timed switch #51

Closed setempler closed 1 year ago

setempler commented 2 years ago

Hi,

Thank you for the very useful plugin. Using timed/non-stateful switches now in automations regularly, I found a randomized timer is very helpful, too. With this PR I implemented a simple switch in the options to allow random delays for non-stateful switches.

Figure with the review of the settings in homebridge UI for a random timing enabled switch:

image

Figure with the preview of the log entry in homebridge UI when a randomized delay is enabled:

image

I hope you find this feature helpful and merge it into any upcoming release.

Thanks, Sven

setempler commented 2 years ago

Hi, did you find time to check the feature? Thank you

setempler commented 1 year ago

Hello @nfarina , any plans to merge my PR? Thx

nfarina commented 1 year ago

Hey sorry I missed this before! Somehow I didn't get notified. I like your implementation - what's your use-case for random shutoffs?

setempler commented 1 year ago

Hi, thanks a lot for catching up.

A use case is to make it a part of a home security system, where after motion a randomly delayed light turns on to scare off. Another one is to randomize light-on periods when away to imitate presence.

nfarina commented 1 year ago

Gotcha, sorry for my slow responses here, I haven't looked at this plugin for quite a while! But this change seems good and is also nicely isolated so I am OK with merging!