Request for log entry when a scheduled task (Farmbot Event) is run

At the moment, scheduled tasks do not record a log entry when they are triggered

I had the task set for 11:22 AM.
The log files shows that the launcher ran but it does not state why. There is no entry to state that it was launched as a scheduled task.

Can we please get a feature added that creates a level 1 event for schedule tasks?

What is “the launcher” ?
What tells you “why” ?

launcher is a sequence that verifies the correct head is loadedr and changes it as required before watering

the why is a scheduled task

The point is, you cannot tell that a scheduled task ran

I do this with a custom setting, it lets me not only put when something ran but allow it to be used in other scripts. I also send a message to Microsoft teams as a webhook and can make 0365 automation such as power automate to excel for data recordings for some experiments I do.

The sequence retrieves the current date and time from the system clock and stores it in a variable named “date.”
{
“kind”: “lua”,
“args”: {
“lua”: “env("rpin53","date")”
}
}

“When there is a will there is a way”

1 Like

Nice.

I don’t know what you mean by a custom setting. I am new to FB coding and I can write good sequences and sensible LUA code (simple stuff at the moment).

set these up either manually or through code,

By ‘scheduled task’ , do you mean a Farm Event execution ?

You’ll need to intercept log records from FBOS using methods already outlined in other posts.
I use the farmbot-js JavaScript package to do this but there are a few other ways.

Farm Event execution commencement is logged like this to the FBOS IEx console and elsewhere:

04:55:00.053 [info] Next execution is ready for execution: now

04:55:00.085 [info] Starting --- Forum 9188 ---

04:55:00.131 [info] Turning Boxled3 ON

04:55:00.142 [info] Writing servo: 11: 90

04:55:00.228 [info] Turning Boxled3 OFF

04:55:00.239 [info] Completed --- Forum 9188 ---
iex(farmbot@farmbot-0000000058098dc9.local)8> 

Edit: Ooops, sorry, that Next execution . . . log record is produced by Logger and not FarmbotOS.Logger so won’t be sent to MQTT clients.
You might be better off with @jturbett 's ideas ?
A simple code change in FBOS would send that around the network but there are implications to assess.

Yes. Farm Event

Why do Farm events not get logged? The steps within the sequences do, but not the fact that an Event triggered something to happen. I found it a little odd.

I would have thought this would be a level-1 Info (FB has launched something) followed by a Level-1 success if it was completed successfully or a level-1 error if it failed. Or even better, a new class of log entries called ‘Events’

I think this should be embedded in FBOS because if you had a fully automatic farm, would you not want to know that everything was cool just by looking at that one thing

Yo, I hear you ~:

The Farm Event sequence scheduling code is arcane and bespoke (imho) . . take a look.

Open Source Software means you’re welcome to find a better solution ( with Tests ) and offer it up for possible inclusion into a future FBOS release (Your Name in Lights :slight_smile: )

FarmBot Inc. has a Team of 1 Engineer/Developer a.t.m.

LOL. My programming skills have a lot to be desired.

See
https://forum.farmbot.org/t/did-i-just-wipe-my-farmbot/9196