slashback100 / presence_simulation

Home Assistant Presence Simulation
423 stars 22 forks source link

Updating presence_simulation switch took longer than the scheduled update interval #48

Closed snowmangh closed 2 years ago

snowmangh commented 2 years ago

I installed and configured the "presence_simulation" add-on successfully as per documentation. If this add-on works as expected, it will remove the complexity of creating my own simulation. Great work. Kudos to the developers.

image

I am getting a warning and not sure what it relates to.

What is the scheduled update interval? Is it the Refresh interval (in seconds)? I am tempted to say yes but thought I'd get a clarification and what action I should take if any. Thanks

Logger: homeassistant.components.switch Source: helpers/entity_platform.py:719 Integration: Switch (documentation, issues) First occurred: 00:58:26 (1 occurrences) Last logged: 00:58:26 Updating presence_simulation switch took longer than the scheduled update interval 0:00:05

slashback100 commented 2 years ago

This warning is triggered by HA when an action is taking more time than expected. Here apparently, switching the presence_simulation (to on I guess?) took more than 5 seconds, which is apparently considered as a long time for HA.
When turning the switch to on, it calls the service presence_simulation.start, which will get the history of all your lights in the DB and then launch a process for each light. This could take some time, depending on what your machine is busy with, on the number of light, on the number of days you simulation runs on, on the performance of your machine and DB... In any way, this is just a warning.

snowmangh commented 2 years ago

@slashback100 Thanks for the fast response and explanation. Much appreciated.