scheduler-component icon indicating copy to clipboard operation
scheduler-component copied to clipboard

Schedules are turned off or not triggering

Open Marvin3241 opened this issue 10 months ago • 35 comments

Checklist

  • [X] I checked for similar existing issues (both open and closed) before posting.
  • [X] I will participate in further discussion about this issue and can help by testing (if requested).

Card Version

v3.2.13

Component Version

No response

Bug description

My schedules are often turned off after triggering. For example, I have a schedule that should trigger 3 or 4 times during the day but after the first trigger it turns itself off. Sometimes the schedule is not turned off, but it will say show that it is finished for the day and it will be waiting for the next schedule to trigger. Here you can see the lowest schedule is turned off. This happened after it triggered. WhatsApp Image 2024-04-16 at 19 29 22 Here you can see that there are still triggers planned for the day, but these won't be happening. WhatsApp Image 2024-04-16 at 19 29 23

Steps to reproduce

To reproduce I created an input_number in the home assistant helpers and created a schedule with this number. I added multiple days to the schedule and set multiple triggers for each day. After the first trigger, the problem already occured.

Additional info

No response

Marvin3241 avatar Apr 17 '24 05:04 Marvin3241

I have a very similar issue, which is really rather annoying as I use this to schedule my heating!

I'm my case the schedule always stays on, but it does not apply new updates to the climate entities after 1 day. The schedule is set to repeat.

simonhills avatar Apr 23 '24 22:04 simonhills

I am also experiencing a similar issue. I have a schedule that sets a number helper for adjusting a certain lights brightness value throughout the day. It used to work fine but now it seems that it is only triggered once, and never again.

DeniTCH avatar Apr 25 '24 09:04 DeniTCH

Seeing the same issue here, since last HA update 2024.4.3. I've since update the scheduler component also.

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:957
First occurred: April 24, 2024 at 6:50:00 PM (8 occurrences)
Last logged: April 24, 2024 at 6:50:00 PM

Entity switch.schedule_hw_boiler (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_refresh. Instead it should use self.async_write_ha_state(), please create a bug report at https://github.com/nielsfaber/scheduler-component/issues
Entity switch.schedule_saturday_hot_water_set_to_65 (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_refresh. Instead it should use self.async_write_ha_state(), please create a bug report at https://github.com/nielsfaber/scheduler-component/issues
Entity switch.schedule_switch_to_sensor_lights (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_refresh. Instead it should use self.async_write_ha_state(), please create a bug report at https://github.com/nielsfaber/scheduler-component/issues
Entity switch.schedule_disable_sensor_lights_dawn (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_refresh. Instead it should use self.async_write_ha_state(), please create a bug report at https://github.com/nielsfaber/scheduler-component/issues
Entity switch.schedule_lights_on_sunset (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_refresh. Instead it should use self.async_write_ha_state(), please create a bug report at https://github.com/nielsfaber/scheduler-component/issues

Farmer-Eds-Shed avatar Apr 26 '24 08:04 Farmer-Eds-Shed

+1

rssluca avatar Apr 28 '24 11:04 rssluca

I think I have the same problem here. My schedule are not always triggered for my heating... Hopefully we are in spring 😉

Swiiney avatar Apr 30 '24 20:04 Swiiney

Is this problem affecting any type of schedule/entity for you guys? I’m keen to update HA to the latest version, but not if Scheduler is affected. I’m just too reliant on it!

sddgit avatar Apr 30 '24 21:04 sddgit

Is this problem affecting any type of schedule/entity for you guys? I’m keen to update HA to the latest version, but not if Scheduler is affected. I’m just too reliant on it!

It's not affecting the schedules I have for my A/C units it seems. They are still running fine. I haven't tested it on anything other than the input_number helper, so I'm not sure if anything else is affected at this moment. Maybe if you could share the setup of your schedule I can give it a try.

Marvin3241 avatar May 01 '24 08:05 Marvin3241

Same/similar story here. Today a scheduled task works but it doesn't do the next day. Unless I have restarted HA or toggled the scheduled task manually inbetween.

Did already change from daily to choose (all days) but no difference. Even removing the repository and reinstalling it didn't solve the issue.

Very annoying when you expect that your covers will open/close automatically.

AppleFlapp avatar May 01 '24 08:05 AppleFlapp

Same/similar story here. Today a scheduled task works but it doesn't do the next day. Unless I have restarted HA or toggled the scheduled task manually inbetween.

Did already change from daily to choose (all days) but no difference. Even removing the repository and reinstalling it didn't solve the issue.

Very annoying when you expect that your covers will open/close automatically.

That's the same as I'm having. I've setup an automation to toggle the schedules on/off after midnight every day to keep things running until a proper solution can be implemented, it's obviously not ideal but works. (it may be easier to schedule a restart either)

All my schedules are set to trigger once on the given day and I don't use the scheme option at all so not sure how they are affected.

Farmer-Eds-Shed avatar May 01 '24 09:05 Farmer-Eds-Shed

@Farmer-Eds-Shed what is the benefit of the Scheduler card then if you need an automation to toggle the schedules? Then you can also build the automations to do the scheduling without using the Scheduler card.

Btw, I think the problems started around the time Europe was changing DST or the HA core/supervisor built following that.

AppleFlapp avatar May 01 '24 09:05 AppleFlapp

@Farmer-Eds-Shed what is the benefit of the Scheduler card then if you need an automation to toggle the schedules? Then you can also build the automations to do the scheduling without using the Scheduler card.

Btw, I think the problems started around the time Europe was changing DST or the HA core/supervisor built following that.

It's not a proposed fix, just an interim workaround but the benefit is:

  • Not having to change the entire config while waiting for the proper solution.
  • It's 1 extra temporary automation, instead of replacing all existing schedules with individual automations.
  • Keeps the house running until then.
  • Easy to undo when the scheduler is fixed

Read the post, I said it's obviously not ideal

Farmer-Eds-Shed avatar May 01 '24 09:05 Farmer-Eds-Shed

Is this problem affecting any type of schedule/entity for you guys? I’m keen to update HA to the latest version, but not if Scheduler is affected. I’m just too reliant on it!

It's not affecting the schedules I have for my A/C units it seems. They are still running fine. I haven't tested it on anything other than the input_number helper, so I'm not sure if anything else is affected at this moment. Maybe if you could share the setup of your schedule I can give it a try.

Thank you for the offer. My most importaint schedules just involve shemes that turn switches on and off a number of times each day. Simple stuff really.

sddgit avatar May 01 '24 09:05 sddgit

@Farmer-Eds-Shed no need to be so defensive. I never said is was your fault. Just mentioning that with using automations to keep the Scheduler card/repository working the Scheduler does loose a lot of its added value. That has nothing to do with your workaround.

AppleFlapp avatar May 01 '24 14:05 AppleFlapp

I haven't seen any issues with a schedule not triggering or disabling itself myself. In my setup I use multiple schedules that trigger on a daily basis, so any broken functionality would be noticed. There are no significant changes made to this component in over a year, so I have no idea what causes this recent issue (this is likely introduced by changes in HA).

If anyone has some reproduction scenario or error logs that could help identifying the issue, please share. For those who want to contribute: it may be useful to install the profiler integration and call service profiler.set_asyncio_debug (with enabled=true) to increase the likelihood of the problem occuring and catching the issue in the HA error logs.

nielsfaber avatar May 01 '24 14:05 nielsfaber

@Farmer-Eds-Shed no need to be so defensive. I never said is was your fault. Just mentioning that with using automations to keep the Scheduler card/repository working the Scheduler does loose a lot of its added value. That has nothing to do with your workaround.

?? You asked a question on what benefit, and I simply answered. Obviously it was just a temporary workaround, regardless of loosing value or not I still need my hot water schedule to work even if it's in a baling twine and pallets sort of way. Others here may be in a similar predicament easy to remove the addition when all is fixed.

I didn't think you were assigning blame at all.

Farmer-Eds-Shed avatar May 01 '24 15:05 Farmer-Eds-Shed

If anyone has some reproduction scenario or error logs that could help identifying the issue, please share. For those who want to contribute: it may be useful to install the profiler integration and call service profiler.set_asyncio_debug (with enabled=true) to increase the likelihood of the problem occuring and catching the issue in the HA error logs.

I'm running that now on my instance

Farmer-Eds-Shed avatar May 01 '24 15:05 Farmer-Eds-Shed

Maybe this is useful? Schedule triggered at 4:30 but next trigger time is showing as 4 min ago

Logger: homeassistant.util.logging
Source: util/logging.py:103
First occurred: 4:30:00 PM (1 occurrences)
Last logged: 4:30:00 PM

Exception in async_timer_finished when dispatching 'scheduler_timer_finished': ('396d91',) Traceback (most recent call last): File "/config/custom_components/scheduler/switch.py", line 258, in async_timer_finished await self._action_handler.async_queue_actions( File "/config/custom_components/scheduler/actions.py", line 258, in async_queue_actions for queue in self._queues.values(): RuntimeError: dictionary changed size during iteration

image

Farmer-Eds-Shed avatar May 01 '24 15:05 Farmer-Eds-Shed

Let me guess what happens next: Tomorrow it shows "yesterday" instead of 4 minutes ago or any other expected update on the status and even if it is then 4:35 nothing has happened.

That is about what happens here for the daily open/close schedules of my covers.

Only a toggle of the schedule will bring the configured schedule back alive.

AppleFlapp avatar May 01 '24 16:05 AppleFlapp

@Farmer-Eds-Shed

Maybe this is useful? Schedule triggered at 4:30 but next trigger time is showing as 4 min ago

Are you sure you are running the latest version? I thought this error was adressed a while ago, see: https://github.com/nielsfaber/scheduler-component/issues/343

nielsfaber avatar May 01 '24 17:05 nielsfaber

I'm here because I have the same problem...

  • I migrated my Home Assistant installation from a Raspberry Pi 3 to a Raspberry Pi 5 4GB a couple of weeks ago. My initial assumption was that this migration caused the fault and it might therefore be a good idea if everyone affected states what hardware they're using just in case it isn't a software fault.
  • The migration method used was making a full backup then restoring this backup in the setup wizard on a fresh SD card. I haven't wiped the old SD card so I can put it back in the Pi 3 later and check what versions of relevant software it had installed.
  • "Tomorrow it shows "yesterday" instead of 4 minutes ago or any other expected update on the status and even if it is then 4:35 nothing has happened" - this is exactly what happens to my installation too.
  • I have schedules of various different types (make a scheme, run a script, turn on/off) and they are all affected. In the case of the 'make a scheme' ones, it will always stop at midnight, whereas the run a script will work on the next trigger time but not again after,

My software versions on the Pi 5 are:

  • Scheduler 3.3.0
  • Core 2024.4.4
  • Supervisor 2024.04.4
  • Operating System 12.2
  • Frontend 20240404.2

I will check what the versions are on the Pi 3 SD card and report back.

deveon95 avatar May 01 '24 17:05 deveon95

I forgot to mention that in my case, if a schedule is turned off, then the displayed time that it would run next if it were turned on is updated correctly.

The Pi 3 SD card has:

  • Scheduler 3.3.0
  • Core 2024.3.0
  • Supervisor 2024.04.0
  • Operating System 12.1
  • Frontend 20240306.0

I disabled automatic updates so that I could manually update each component and see which one breaks it.

With the above versions, I set a schedule to run a script in a few minutes with daily repeat enabled, and the time updated as expected.

I then updated Home Assistant Supervisor to 2024.04.4, repeated the experiment, and again the time updated as expected.

Next, I updated the Home Assistant Operating System to 12.2, repeated the experiment, and again the time updated as expected.

After that, I updated Home Assistant Core to 2024.5.0, which had just come out, and the time has not updated (it shows as 3 minutes ago, etc.) and probably won't repeat tomorrow, so the fault is caused by a change to Home Assistant Core and the version which introduced the fault was something between 2024.3.0 and 2024.4.4 inclusive, remembering that the installation on the Pi 5 has the problem with 2024.4.4.

deveon95 avatar May 01 '24 20:05 deveon95

@Farmer-Eds-Shed

Maybe this is useful? Schedule triggered at 4:30 but next trigger time is showing as 4 min ago

Are you sure you are running the latest version? I thought this error was adressed a while ago, see: #343

@nielsfaber I was sure I was, as I updated through hacs last week. However I'm after reinstalling the component and card and it looks to be working as expected now. I'll report back if I still have an issue later. Thanks.

Farmer-Eds-Shed avatar May 02 '24 05:05 Farmer-Eds-Shed

@Farmer-Eds-Shed @nielsfaber I did a full removal and reinstall of the component and card last week without success. Maybe only one time that it worked as expected but that could also be the first time when it always succeeds similar like when you toggle the schedules.

AppleFlapp avatar May 02 '24 07:05 AppleFlapp

@Farmer-Eds-Shed @nielsfaber I did a full removal and reinstall of the component and card last week without success. Maybe only one time that it worked as expected but that could also be the first time when it always succeeds similar like when you toggle the schedules.

Maybe @AppleFlapp, but they ran this morning and are showing next execution as tomorrow instead of in the past. But time will tell.

Farmer-Eds-Shed avatar May 02 '24 08:05 Farmer-Eds-Shed

In an attempt to reproduce the issue, I created a schedule which changes an input_number entity 3 times per day (similar to the original problem description by @Marvin3241 )

I will check the history of the entity in a couple of days to see if any actions are missed. If anyone has a better idea, please let me know.

nielsfaber avatar May 02 '24 16:05 nielsfaber

It's possible to downgrade Home Assistant Core using ha core update --version x.y.z so I've tried this to narrow down which version of the core stopped the scheduler from working properly.

2024.4.0 - affected; schedules only run once

2024.3.3 - not affected; Scheduler works normally

Downgrading to 2024.3.3 can be used as a temporary fix until someone figures out exactly what change in Home Assistant Core is causing the problem.

deveon95 avatar May 02 '24 19:05 deveon95

@deveon95 Great finding. This was also something I was expecting that it might have to do with new HA core version.

Only thing is that the workaround from @Farmer-Eds-Shed is easier to implement and has less risk compared to downgrade HA.

AppleFlapp avatar May 03 '24 09:05 AppleFlapp

My testing schedule as described here has been running for a few days now, I have not been able to reproduce the reported issue.

As shown below, the schedule triggers correctly at the programmed times, no occurences are skipped. image

nielsfaber avatar May 07 '24 15:05 nielsfaber

What HA version are you running @nielsfaber ?

sddgit avatar May 07 '24 21:05 sddgit

FWIW I started seeing this problem with schedules that had been working reliably for many months after upgrading to HA Core 2024.4.3 For me, the problem seems to have been fixed by updating scheduler-component to 3.3.3 in HACS

pyrosteve avatar May 09 '24 10:05 pyrosteve