slashback100 / presence_simulation

Home Assistant Presence Simulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rapid turn on/off when random time is used

Szpadel opened this issue · comments

When "Add random time" setting is greater than 0 and events timing gathered from history is adjusted
there is possibility to turn on and turn off times to point at the same point in time
This may cause very rapid turn on/off sequence that can cause issues with some devices (eg. wled device crashes)

It would be great that extension would eliminate such rapid events (eg. if there is turn off and turn on in at the same time, it could do nothing (keep in mind that there could be sequence as on,off,on that should be merged into on)) or throttle them to not be executed faster than some time (eg. 1s, but probably anything over 200ms would be also fine)

I added a minimal delay of 1 sec between actions on single an entity.
But it will cause a problem for instance for blinds. If the history states were position to 0%, 10%, 20%... and if I add a delay in between, the blinds will not shut down smoothly...
So I will keep digging in this.

You could gate this workaround only when random time is active, in that case such cases would not work properly anyway

Yep, good idea