isalkind / homebridge-away-mode

Homebridge plugin that provides triggers to turn on and turn off lights to simulate occupancy.
MIT License
26 stars 5 forks source link

Trigger not activated if the sum of planned off-time + planned on-time is past the set "end" time #10

Closed Jodifoto closed 3 years ago

Jodifoto commented 3 years ago

The Motion-Trigger is not activated if the sum of planned off-time + planned on-time is past the set "end"-time for that trigger. I use a very big "minOnTime"-time to take care that the trigger will only pulled ONCE between "start" & "end" time. The "minOffTime" and "maxOffTime" are within the "start" & "end" time so that a random delay will occur before the Motion-Trigger is activated ONLY ONCE. Please allow the Motion-Trigger to activate if the ON-time is before the "end" time. Thanks.

isalkind commented 3 years ago

What is the actual behavior you're looking for? I might rather add functionality than try to "fix" the current functionality to match the behavior you're trying to achieve.

Jodifoto commented 3 years ago

Hi isalkind. The actual behaviour is that the "Motion Sensor" should only be activated ONCE within the same defined time-period in the config.json ... for example "start": "sunset", "end": "11:45". This is needed to close roller-shutters BUT I want to be able to open a roller-shutter again manually if I am at home and I need this ... without having Home-Kit closing it again ..., If you like to add a functionality, it could be for example an extra parameter "maxNumActivations" being the maximun Number of Activations of the "Motion Sensor" within the same defined time-period in the config.json ... for example "start": "sunset", "end": "11:45". Then it is not restricted to only one activation of the "Motion Sensor" within the same defined time-period. Thanks.

isalkind commented 3 years ago

This should be doable. Give me a couple of days to code/test.

isalkind commented 3 years ago

Released version 1.6 to address this issue. Added 'maxActivations' on 'Active Periods'. It can be set globally or per-sensor.

Please let me know if this meets your needs.

Jodifoto commented 3 years ago

@ isallind, thans for the quick programming. The solution looks perfect to me ! Unfortunately I'll not be able to test in the next 2 weeks ... I'll do it as soon as I can!

Jodifoto commented 3 years ago

@isalkind, After testing I can confirm that the new feature works well. Thanks for your efforts !! ... and your very nice and useful program ! (sorry for the delay due to travel ...)

isalkind commented 3 years ago

Glad it works for you.