slashback100 / presence_simulation

Home Assistant Presence Simulation
423 stars 22 forks source link

Rapid turn on/off when random time is used #111

Closed Szpadel closed 4 months ago

Szpadel commented 4 months ago

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)

slashback100 commented 4 months ago

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.

Szpadel commented 4 months ago

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

slashback100 commented 4 months ago

Yep, good idea