runIn not getting scheduled

Hi folks,
I am attempting to implement runIn functionality that is launched from Initialize() in a form of:

runIn(10,"SetChildAction",[data:"Parent"])

This is part of parent/child app however I am scheduling fro Parent to run function defined in Parent.
it executes one time and there is no scheduling entry after this one run. On app initialization property reporting that it is scheduled to run once
I am running HE version

Hubitat Elevation® Platform Version

2.2.3.148

Hardware Version

Rev C-4

Cheers,

Simon

If I remember correctly, runIn does not repeat it is meant for a single time (such as turning something off X amount of time after it was turned on). What you want is schedule.

1 Like

Thank you.
schedule('0/30 0 0 ? * * *',"SetChildAction",[data:"Parent"])
puts it on the schedule, but first run is set for next day - how do I specify to run immediately?

My bad. correct cron entry is 0/30 * * ? * * *

If you want it to run immediately after scheduling it you could just call it immediately afterwards or use your runIn command.

So, based on your examples:

schedule('0/30 * * ? * * *',"SetChildAction",[data:"Parent"])
SetChildAction( [data:"Parent" )

OR

schedule('0/30 * * ? * * *',"SetChildAction",[data:"Parent"])
runIn(10,"SetChildAction",[data:"Parent"])