Skip to main content


One of the key features of NetDaemon is the scheduling features.


Even if Observable has schedulers we recommend using the built-in ones. Then all errors is caught and logged. Also you have to take care of the scheduler life cycle your self.


There are several RunEvery implementations.


Run daily at specific time.

You have to use the hh:mm:ss format setting time of day

RunDaily("23:00:00", () => DoSomeWork());
private void DoSomeWork()
// Do stuff

or maybe just on weekends?. The dayof week will be implemented in future versions but can be solved like this:

var DayOfWeek[] weekend = new DayOfWeek[]
RunDaily("23:00:00", ()=>
if (weekend.Contains(DateTime.Now.DayOfWeek))
// Do weekend stuff


There are specific implementations of RunEvery... like the RunEveryMinute.

RunEveryMinute(0, () => Log("Once a minute at second 0"));
RunEveryHour("15:00", () => Log("Log every hour quater past"));


If you need to delay excecution a specific time this is the prefered way to do it rather than using await Task.Delay().

RunIn(TimeSpan.FromSeconds(10), () => DoStuffInTenSeconds());

Cancel scheduled tasks#

Every scheduled task return a IDisposabe object. You can use that to cancel any running schedules

// set class variable you want to save
_savedSchedulerResult = RunIn(TimeSpan.FromHours(2), () => DoStuffInTwoHours());
// Some other function needs to cancel it