Hi. Just want to let you know I have not forgotten about this. Time is the enemy. I really do appreciate you digging in to this. I'll try to find some time over the weekend to get to the bottom of this.
That's a good thing to have done. (Although I'm guilty of using older versions myself) it helps the developer know that the problem is still active.
All good Steve. Thank you for checking in!
Iām trying as many different things as my limited brain can think of in the meantime.
Let me know if there is anything else you need or want me to try!
Anything I can do to possibly help you out here @Steve-Mcl ?
Love the gif. My apologies Benji. Time is my enemy. I have not forgotten about this tho.
Sorry, just checking....
So are you still having the problem?
Yes, need to force cron-plus to rebuild schedules every day for the time being.
Hopefully Steve can figure it out!
I managed to recreate the problem with a simplified flow (it works most of the time)
The order of events is:
Preamble.
Lets call the problematic schedule bad-boy-1
Lets call the pausing schedule mr-pauser
Lets call the un-pausing schedule mr-starter
- Trigger
mr-pauser
beforebad-boy-1
has itself elapsedlist-inactive
should show that it pausedbad-boy-1
- wait until after the time
bad-boy-1
would have naturally elapsed - Trigger
mr-starter
tostart-all
- Fire
list-inactive
- if the timing was right,bad-boy-1
is still listed as paused. - If you wait another 1 minute and trigger
mr-starter
again, then do alist-inactive
if often picks up/starts
I cannot see why just yet but having a reproducible flow & that is half the battle.
This is the demo flow I used to debug and fix (posted for future reference)
[{"id":"83377da89619ca30","type":"cronplus","z":"309299239afff48a","name":"Solar Events","outputField":"payload","timeZone":"","storeName":"","commandResponseMsgOutput":"fanOut","defaultLocation":"55.884532, -3.265735","defaultLocationType":"fixed","outputs":7,"options":[{"name":"before-bb1","topic":"before bad-boy-1","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"","offset":"300","solarType":"selected","solarEvents":"solarNoon"},{"name":"after-bb1","topic":"after bad-boy-1","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"","offset":"399","solarType":"selected","solarEvents":"solarNoon"},{"name":"bad-boy-1","topic":"soon1","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"55.884532, -3.265735","offset":"381","solarType":"selected","solarEvents":"solarNoon"},{"name":"mr-pauser","topic":"Sunset","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"","offset":"0","solarType":"selected","solarEvents":"sunset"},{"name":"mr-starter","topic":"Solar Midnight","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"55.884532, -3.265735","offset":"0","solarType":"selected","solarEvents":"nadir"}],"x":510,"y":240,"wires":[[],[],[],["5c1a25a6df4c4baf"],["0ed91870ed533024"],[],["c71ee11f76b9ca64"]]},{"id":"5c1a25a6df4c4baf","type":"change","z":"309299239afff48a","name":"Pause bad-boy-1","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"command\":\"pause\",\"name\":\"bad-boy-1\"}]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":200,"wires":[["f08bb57fd9ec54a8"]]},{"id":"f08bb57fd9ec54a8","type":"link out","z":"309299239afff48a","name":"link out 3","mode":"link","links":["e90d4488386de958"],"x":915,"y":200,"wires":[]},{"id":"e90d4488386de958","type":"link in","z":"309299239afff48a","name":"link in 2","links":["bab5574a50b1fb39","f08bb57fd9ec54a8"],"x":325,"y":160,"wires":[["83377da89619ca30"]]},{"id":"0ed91870ed533024","type":"change","z":"309299239afff48a","name":"Resume Schedules","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"command\":\"start-all\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":240,"wires":[["bab5574a50b1fb39"]]},{"id":"bab5574a50b1fb39","type":"link out","z":"309299239afff48a","name":"link out 4","mode":"link","links":["e90d4488386de958"],"x":915,"y":240,"wires":[]},{"id":"10643f04ed8460b1","type":"inject","z":"309299239afff48a","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"start-all","x":110,"y":320,"wires":[["a97d8ef37dba4fc2"]]},{"id":"ddc8b3fbee7fe6f3","type":"inject","z":"309299239afff48a","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"list-inactive","x":130,"y":280,"wires":[["a97d8ef37dba4fc2"]]},{"id":"e9a276684548e0b9","type":"debug","z":"309299239afff48a","name":"paused","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload.result.config.name","targetType":"jsonata","statusVal":"","statusType":"auto","x":1020,"y":260,"wires":[]},{"id":"09bbdf7fc3173611","type":"inject","z":"309299239afff48a","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"list-all","x":110,"y":360,"wires":[["a97d8ef37dba4fc2"]]},{"id":"1906c4d60362a966","type":"inject","z":"309299239afff48a","name":"trigger mr-pauser","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"trigger","payload":"mr-pauser","payloadType":"str","x":140,"y":160,"wires":[["27d2427582bee8ed"]]},{"id":"415427f25c08c257","type":"inject","z":"309299239afff48a","name":"trigger mr-starter","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"trigger","payload":"mr-starter","payloadType":"str","x":140,"y":200,"wires":[["27d2427582bee8ed"]]},{"id":"c71ee11f76b9ca64","type":"switch","z":"309299239afff48a","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"list-inactive","vt":"str"},{"t":"eq","v":"list-all","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":750,"y":280,"wires":[["e9a276684548e0b9"],["96164a2d4dcc3b58"]]},{"id":"96164a2d4dcc3b58","type":"debug","z":"309299239afff48a","name":"all","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload.result.config.name","targetType":"jsonata","statusVal":"","statusType":"auto","x":1010,"y":300,"wires":[]},{"id":"b8a36e3f665b7041","type":"change","z":"309299239afff48a","name":"list-inactive","rules":[{"t":"set","p":"topic","pt":"msg","to":"list-inactive","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":325,"y":240,"wires":[["83377da89619ca30"]],"icon":"font-awesome/fa-list-ol","l":false},{"id":"72c97e5a1df31db5","type":"delay","z":"309299239afff48a","name":"","pauseType":"delay","timeout":"50","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":255,"y":240,"wires":[["b8a36e3f665b7041"]],"l":false},{"id":"27d2427582bee8ed","type":"junction","z":"309299239afff48a","x":280,"y":200,"wires":[["83377da89619ca30","72c97e5a1df31db5"]]},{"id":"a97d8ef37dba4fc2","type":"junction","z":"309299239afff48a","x":340,"y":320,"wires":[["83377da89619ca30"]]},{"id":"e6eaaa86953bb5b2","type":"global-config","env":[],"modules":{"node-red-contrib-cron-plus":"2.2.1"}}]
Damnit mr-starter
! Get it together!
Glad you could replicate! That indeed helps immensely.
I haven't tried this part myself, but if this works, I might configure it to do that automatically again as a hack around for now.
or you could update to v2.2.3
(2.2.2 was skipped as I make a boo-boo!)
It is in the library: node-red-contrib-cron-plus (node) - Node-RED (but can take upto 30 mins for it to appear in Node-RED catalogue)
YOU ALREADY FOUND THE PROBLEM?!
I will be sure to update before today's cycle and will report back!
EDIT: It's in the Node-RED catalogue, so updated the pallet to 2.2.3, and have restarted Node-RED.
READY TO TEST!
(Anxiously waiting to hear from you)
So..... we're SO CLOSE.....
First night was a bright day, so my automation only pauses one schedule, and thus start-all would only need to catch and resume one schedule. This worked, when I checked it, there were no paused schedules.
Last night was an overcast day, and thus my automation paused two schedules, and start-all would need to catch and resume both.
When I went to check, it looks like one of schedules had been resumed correctly, but not both however, manually triggering a start-all again successfully resumed the remaining paused schedule!
So it's almost there, I forgot to check if the one that did get resumed was chronologically first or second.
Since start and start-all operate the same (fixed) code, this is surprising. Please check your logs.
Q. In the automation do you issue a start-all or issue individual named start
commands?
As I spent a lot of time debugging this, and I dont relish the thought of there being a harder bug so I am asking (begging ) you to try and pin this down by process of elimination until you can get a repeatable set of steps to recreate it faithfully (please
).
(Just to throw it out there.....)
@LondonBenji
Can you make a very basic flow (no GUI) which forces the problem and Put it out there for people to also try and see if they can also find problems with the workings.
Not that I'm wanting poor @Steve-Mcl to be overwhelmed with problems.
But just that the more people trying it, the better the chance of things happening.
Use inject
nodes to set conditions, and debug
nodes to show the output.
So far it seems to only be when >1 schedule is paused, I'm going to add in another duplicate of a solar event to the list and have it pause all three, to see if only one is still paused.
It was another overcast day yesterday, so that's what triggers two of the schedules to be paused, and I checked which one managed to be resumed by my "Resume Schedules" node, and of the two schedules that were paused, it was the first out of the two chronologically of solar events on the list, so I am not sure if that's a hint, but I will try pausing three schedules and see what I can see.
Just to recap:
- If triggered, pauses two schedules by setting msg.payload to (JSON) -
[{"command":"pause","name":"Evening Golden Hour Starts"},{"command":"pause","name":"Civil Dusk - Golden Hour Ends"}]
- If triggered instead, pauses one schedule by setting msg.payload to (JSON) -
{"command":"pause","name":"Early GHE"}
- Resumes all schedules (because we don't care what's paused, we just want them all enabled again) by setting msg.payload to (JSON) -
{"command":"start-all"}
- The manual way I restart all (only if I need to now! And it works now!) but is configured differently from when I was messing around with syntax tests, and injects the following (STRING) -
The test really just boils down to if only one schedule is paused, will it get restarted (it does, without fail now), or if two (or possibly more) schedules are paused, will they all get restarted (one does without fail, but not both).
I'm not sure I follow, I posted the flow that you can import here in this post:
To make it simpler though, since we're potentially only concerned now with two or more schedules, I have updated the example flow to copy so that there are no HA nodes in it anymore:
[{"id":"ad1329a369dc4021","type":"link in","z":"489173351d96a294","name":"link in 1","links":["c149ede859fd699d","c5569589359e6a29"],"x":265,"y":300,"wires":[["12218241a361f06f"]]},{"id":"12218241a361f06f","type":"cronplus","z":"489173351d96a294","name":"Solar Events","outputField":"payload","timeZone":"America/New_York","storeName":"","commandResponseMsgOutput":"fanOut","defaultLocation":"37.1881071713213, -80.41689781544531","defaultLocationType":"fixed","outputs":18,"options":[{"name":"Night End - Astronomical Dawn","topic":"Night End - Astronomical Dawn","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"0","solarType":"selected","solarEvents":"nightEnd"},{"name":"Nautical Dawn","topic":"Nautical Dawn","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"0","solarType":"selected","solarEvents":"nauticalDawn"},{"name":"Civil Dawn - Golden Hour","topic":"Civil Dawn - Golden Hour","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"0","solarType":"selected","solarEvents":"civilDawn"},{"name":"Sunrise","topic":"Sunrise","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"0","solarType":"selected","solarEvents":"sunrise"},{"name":"Sunrise End","topic":"Sunrise End","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"0","solarType":"selected","solarEvents":"sunriseEnd"},{"name":"Morning Golden Hour Ends","topic":"Morning Golden Hour Ends","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"0","solarType":"selected","solarEvents":"morningGoldenHourEnd"},{"name":"Solar Noon","topic":"Solar Noon","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"-240","solarType":"selected","solarEvents":"solarNoon"},{"name":"Check EGH","topic":"Check EGH","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"","offset":"-30","solarType":"selected","solarEvents":"eveningGoldenHourStart"},{"name":"Evening Golden Hour Starts","topic":"Evening Golden Hour Starts","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"0","solarType":"selected","solarEvents":"eveningGoldenHourStart"},{"name":"Sunset Start","topic":"Sunset Start","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"0","solarType":"selected","solarEvents":"sunsetStart"},{"name":"Sunset","topic":"Sunset","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"0","solarType":"selected","solarEvents":"sunset"},{"name":"Early GHE","topic":"Early GHE","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"","offset":"-15","solarType":"selected","solarEvents":"civilDusk"},{"name":"Civil Dusk - Golden Hour Ends","topic":"Civil Dusk - Golden Hour Ends","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"-5","solarType":"selected","solarEvents":"civilDusk"},{"name":"Nautical Dusk","topic":"Nautical Dusk","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"0","solarType":"selected","solarEvents":"nauticalDusk"},{"name":"Astronomical Dusk - Night Starts","topic":"Astronomical Dusk - Night Starts","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"0","solarType":"selected","solarEvents":"nightStart"},{"name":"Solar Midnight","topic":"Solar Midnight","payloadType":"default","payload":"","expressionType":"solar","expression":"0 * * * * * *","location":"37.1881071713213, -80.41689781544531","offset":"0","solarType":"selected","solarEvents":"nadir"}],"x":370,"y":300,"wires":[[],[],[],[],[],[],[],["192206f961a65a8f"],[],[],[],[],[],["e61faa0f7b74f9a1"],[],[],[],[]]},{"id":"192206f961a65a8f","type":"change","z":"489173351d96a294","name":"Pause Late Schedules","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{\"command\":\"pause\",\"name\":\"Evening Golden Hour Starts\"},{\"command\":\"pause\",\"name\":\"Civil Dusk - Golden Hour Ends\"}]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":280,"wires":[["c149ede859fd699d"]]},{"id":"c149ede859fd699d","type":"link out","z":"489173351d96a294","name":"link out 1","mode":"link","links":["ad1329a369dc4021"],"x":695,"y":280,"wires":[]},{"id":"e61faa0f7b74f9a1","type":"change","z":"489173351d96a294","name":"Resume Schedules","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"command\":\"start-all\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":360,"wires":[["c5569589359e6a29"]]},{"id":"c5569589359e6a29","type":"link out","z":"489173351d96a294","name":"link out 2","mode":"link","links":["ad1329a369dc4021"],"x":675,"y":360,"wires":[]}]
I did state:
Can you make a very basic flow (no GUI) which forces the problem and Put it out there for people to also try and see if they can also find problems with the workings.
Ok, I didn't explain it 100% clear, but home assistant nodes are not part of what I wanted.
I don't have HA and won't install it.
No need to. See previous post.
As @dceejay mentioned, last line of my post has an example without any need for Home Assistant
I wasn't entirely sure what you meant by "no GUI".
To update, I created two additional solar events, that I don't actually use, but I wanted to pause more than two, and see how the 'start-all' command behaved and here's what happened -
Solar events to be paused (in chronological order):
- Evening Golden Hour Starts
- Sunset 2
- Sunset 3
- Civil Dusk - Golden Hour Ends
Here's the JSON formatted command string to suspend them:
[{"command":"pause","name":"Evening Golden Hour Starts"},{"command":"pause","name":"Civil Dusk - Golden Hour Ends"},{"command":"pause","name":"Sunset 2"},{"command":"pause","name":"Sunset 3"}]
I guess I didn't order the pause command in the same order though:
- Evening Golden Hour Starts
- Civil Dusk - Golden Hour Ends
- Sunset 2
- Sunset 3
After the automatic 'start-all' command was sent, I injected the 'list-inactive' and was returned the following:
{"_msgid":"2ce516bda7afad60","payload":{"command":{"command":"list-inactive"},"result":[{"config":{"topic":"Sunset 2","name":"Sunset 2","index":11,"payloadType":"default","payload":"","limit":null,"expressionType":"solar","solarType":"selected","solarEvents":"sunset","location":"REMOVED","offset":"1","isDynamic":false,"modified":false,"isRunning":false,"count":0},"status":{"type":"static","modified":false,"isRunning":false,"count":0,"limit":0,"nextDescription":"sunset in 4 hours 58 minutes 15 seconds","nextDate":"2025-09-27T23:14:36.212Z","nextDateTZ":"Sep 27, 2025, 19:14:36 EDT","timeZone":"America/New_York","serverTime":"2025-09-27T18:16:21.198Z","serverTimeZone":"America/New_York","description":"Solar Events: 'sunset'","solarState":{"state":"Day","direction":"fall","day":true,"night":false,"astrologicalTwilight":false,"nauticalTwilight":false,"civilTwilight":false,"goldenHour":false,"twilight":false,"morningTwilight":false,"eveningTwilight":false,"dawn":false,"dusk":false,"morningGoldenHour":false,"eveningGoldenHour":false},"solarStateOffset":{"state":"Day","direction":"fall","day":true,"night":false,"astrologicalTwilight":false,"nauticalTwilight":false,"civilTwilight":false,"goldenHour":false,"twilight":false,"morningTwilight":false,"eveningTwilight":false,"dawn":false,"dusk":false,"morningGoldenHour":false,"eveningGoldenHour":false},"solarTimes":[{"event":"sunset","time":"2025-09-27T23:13:36.212Z","timeOffset":"2025-09-27T23:14:36.212Z"}]}},{"config":{"topic":"Civil Dusk - Golden Hour Ends","name":"Civil Dusk - Golden Hour Ends","index":14,"payloadType":"default","payload":"","limit":null,"expressionType":"solar","solarType":"selected","solarEvents":"civilDusk","location":"REMOVED","offset":"-5","isDynamic":false,"modified":false,"isRunning":false,"count":0},"status":{"type":"static","modified":false,"isRunning":false,"count":0,"limit":0,"nextDescription":"civilDusk in 5 hours 17 minutes 30 seconds","nextDate":"2025-09-27T23:33:51.679Z","nextDateTZ":"Sep 27, 2025, 19:33:51 EDT","timeZone":"America/New_York","serverTime":"2025-09-27T18:16:21.198Z","serverTimeZone":"America/New_York","description":"Solar Events: 'civilDusk'","solarState":{"state":"Day","direction":"fall","day":true,"night":false,"astrologicalTwilight":false,"nauticalTwilight":false,"civilTwilight":false,"goldenHour":false,"twilight":false,"morningTwilight":false,"eveningTwilight":false,"dawn":false,"dusk":false,"morningGoldenHour":false,"eveningGoldenHour":false},"solarStateOffset":{"state":"Day","direction":"fall","day":true,"night":false,"astrologicalTwilight":false,"nauticalTwilight":false,"civilTwilight":false,"goldenHour":false,"twilight":false,"morningTwilight":false,"eveningTwilight":false,"dawn":false,"dusk":false,"morningGoldenHour":false,"eveningGoldenHour":false},"solarTimes":[{"event":"civilDusk","time":"2025-09-27T23:38:51.679Z","timeOffset":"2025-09-27T23:33:51.679Z"}]}}]}}
Evening Golden Hour Starts- Civil Dusk - Golden Hour Ends (still paused)
- Sunset 2 (still paused)
Sunset 3
Now what's potentially REALLY interesting, is that now when I manually hit my 'start-all' inject (which I have changed to setting msg.payload to JSON {"command":"start-all"}
), I was expecting the remaining two solar events to be resumed.... and they weren't....HOWEVER, one of them was, so now we are in this state -
Evening Golden Hour Starts- Civil Dusk - Golden Hour Ends (still paused)
Sunset 2Sunset 3
Pushing my manual 'start-all' inject for a second time and BOOM! The last remaining paused solar event has been resumed correctly! So while it was able to resume two of the four right off the bat (and I'm not sure why it was only able to do one of the two in the original setup), it does seems that repeated 'start-all' commands are resuming still paused schedules one at a time in my testing.
I'm thinking that has to be a clue, no? Some sort of array/counting issue? I don't know, I'm definitely not a programmer!