Closed shlomki closed 1 year ago
This is not caused by scheduler. You would have gotten the same error when using a regular HA automation for operating the switch. It is probably caused by the integration which controls your switch entity. Please raise the issue in the HA core instead.
Thanks for the reply, I will try to make an automation that does the same to see if it reproduces that way.
Hey again @nielsfaber , I've been running this as an automation and it doesn't seem to happen at all. It turns on & off as expected and keeps working this way. The problem seems to be related to the scheduler component and not to HA Core. Are there any logs that I could turn on?
You can enable debug logging by adding this to configuration.yaml:
logger:
default: warning
logs:
custom_components.scheduler: debug
You will need to restart HA afterwards.
When the timer is set you should see something like (this information is also visible in the properties of the switch entity):
DEBUG (MainThread) [custom_components.scheduler.timer] Timer of 9514a0 set for 2022-12-15 20:03:00+01:00
When the schedule triggers you should see something like:
Timer 9514a0 has reached slot 0 Schedule 9514a0 is triggered, proceed with actions Executing service switch.turn_on on entity switch.my_switch Finished execution of actions
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days
Checklist
Steps to Reproduce
Expected behavior
Expected that the schedule would continue running as expected (turn on at a certain time and turn off after 1 hour).
Actual behavior
After a few days have passed with the schedule working properly, a day would come where the switch would turn on but never turns off. From that point, the switch wouldn't even turn on the next day, and more of the same error would appear in the logs.
An error appears in the log at the same time the switch was scheduled to turn off: 2022-12-10 18:15:00.024 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending! 2022-12-10 18:15:00.064 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending! 2022-12-10 18:15:00.075 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending!