Program not Triggering on Schedule
Issue: Scheduled Trigger Not Working
Description: My irrigation program has not triggered automatically in weeks. The schedule counts down to the trigger time, but nothing happens when the time is reached.
Details:
Irrigation Controller Version: 5.4.15 Home Assistant Core Version: 2024.5.4 Expected Behavior: The irrigation system should start automatically at the scheduled time.
Actual Behavior: The countdown completes, but the irrigation system does not start.
Steps Taken:
Checked the logs for any error messages (none found).
Restarted the Home Assistant core and reinstalled the irrigation controller.
Verified the schedule settings are correct.
Tested manual trigger, which works fine.
Hi, config looks fine, and it should never end up with next run being in the past. I will look into this. What hardware/OS are you running on?
Cheers Pete
How are you determining the adjuster value?
Also do you have any other programs defined? i.e. is there another program kicking in with the same start time?
One more comment, Thanks for a great error report
Hi, config looks fine, and it should never end up with next run being in the past. I will look into this. What hardware/OS are you running on?
Cheers Pete
Thank you for the quick response. I’m running Generic x86-64 on a Nuc. Just one program one zone at the moment, planning to add another zone when we get the bug resolve. For the adjuster value I’m using the OWM history integration with the Factor utilizing forecast rain and probability of precipitation template.
Thank you!
Hi, I have not had any luck replicating this issue.
I have changed some code from using the HomeAssistant Util libraries to using standard Python, it should not make a difference but it could be an issue between running on HA OS v on the NUC. But I am just guessing.
I will publish an Alpha version with some debug messages to try and determine where in the code this is happening.
Hi, I have released 5.4.16-alpha as a beta in HACS.
If you turn debugging on you will get some outputs in the Log that will help me debug. https://github.com/petergridge/Irrigation-V5#debug
Cheers Pete
Hi Pete, I have the same issue this summer. Last year it worked smoothly but now (I guess after some updates of HA and your component) the automation doesn't work anymore. Same behaviour as described above, the countdown completes, but the irrigation doesn't start. When I manually start the irrigation of the zone via the custom card it works.
In the logs I found this at exactly the time when the program should begin:
Logger: homeassistant
Source: util/dt.py:153
First occurred: 10:15:00 AM (2 occurrences)
Last logged: 10:15:00 PM
Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/config/custom_components/irrigationprogram/switch.py", line 697, in async_turn_on
zones = await self.build_run_script(False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/irrigationprogram/switch.py", line 629, in build_run_script
if zone.should_run(self.scheduled) is False:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/irrigationprogram/irrigationzone.py", line 457, in should_run
if dt_util.as_timestamp(self._next_run) > dt_util.as_timestamp(dt_util.now()):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/dt.py", line 153, in as_timestamp
raise ValueError("not a valid date/time.")
ValueError: not a valid date/time.
Using V5.4.16.
Thanks for your help and effort!
Hi @jschroeter
Can you share your configuration, screen shots will be fine.
Sure, but I'm not sure what exactly will help you. So please let me know if you need more.
Hi I have release v5.4.17 , a beta, I have changed the way I handle datetime, the HA helpers have all been changed to the datetime library. I am hoping that impacts this issue. if not I have added some addition debug statements that may assist.
Hi Peter, just gave it a try, it failed again but with a different error:
This error originated from a custom integration.
Logger: homeassistant
Source: custom_components/irrigationprogram/irrigationzone.py:459
integration: Irrigation controller (documentation, issues)
First occurred: 11:05:00 AM (1 occurrences)
Last logged: 11:05:00 AM
Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/config/custom_components/irrigationprogram/switch.py", line 705, in async_turn_on
zones = await self.build_run_script(False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/irrigationprogram/switch.py", line 637, in build_run_script
if zone.should_run(self.scheduled) is False:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/irrigationprogram/irrigationzone.py", line 459, in should_run
if datetime.timestamp(self._next_run) > datetime.timestamp(datetime.now()):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: descriptor 'timestamp' for 'datetime.datetime' objects doesn't apply to a 'str' object
Can you run the action:
Hopefully this fixes the problem
Unfortunately not, same error in the log.
Can you check the log for this error message: 'exception processing start time: %s', self._next_run. This will give me what value is being processed.
If you turn debugging on I can get a little more detail of the path the program has gone through to get to this point.
Can you quickly explain how to find the debug logs? I followed the readme and added the lines to the configuration, updated the component again, restarted HA, ran the reset action. But only get the single error as before when the schedule should run.
The debug statements come out in the log file, generally a blue colour. Setting -> system -> logs. then load full logs lets you see the information more clearly.
I have found a couple of things that may help, V5.4.19 is available, I still don't know why it is not working but I found the code that it is falling over on is redundant and could be removed.
Thanks a lot, that helped! It triggers again! But I noticed one issue and want to ask if this is related: it seems that zones I set to „off“ via the frequency as described in the readme now do run.
One step forward, I will check the new issue. I'm not surprised there is a few side effects. I will take down v19 until I have fixed this issue.
V5.4.20 uploaded that fixes the 'off' issue.
Hopefully that finishes this one off 😃, I will check this issue in the morning, please let me know how it goes.
Now everything seems to work fine! Awesome, thanks a lot!! 👏