Documentation / LemmeSee Hub

Tasks

A task is something the hub runs for you. Each task has a type, a name, an on or off switch, and settings for its type. Tasks are stored in the hub's database, start automatically when the hub starts, and are managed on the Tasks page.

Tasks in LemmeSee
Daemons, scripts, and plugins

Task types

TypeShown asWhat it doesSchedule
scriptScriptRuns a Python script, waits for it to finish, and records the result.Every N minutes, or cron
daemonDaemonStarts a long-running Python script and restarts it if it crashes.Runs continuously
urlwatchURL WatcherFetches a web page and sends an alert when it changes.Every N minutes, or cron
pluginPlugin ScriptRuns one of the hub's plugins.Runs continuously
relayRelayed serverPasses another LemmeKnow Server's messages, pushed in through a Mosquitto bridge, on to phones. See Relayed servers.Runs continuously

Scripts and daemons are covered in depth in Scripts and daemons, URL watchers in Watchers, and schedules in Scheduling.

The Tasks page

Each task is a card showing its name, type and status. The buttons along the top filter the list by type.

TypeThe card shows
Script and URL watcherThe schedule (every 5m or the cron expression), when it last ran, and ok or error from that run.
Daemonrunning with its uptime and restart count, or starting, restarting, or stopped, plus its log source, which links to the Logs page filtered to it.
Plugin ScriptIts status, plus a button for each page the plugin offers. In a browser they open in a new tab. In LemmeKnow, a page the app can show opens in the same view, and any other page opens in your phone's browser, already signed in.
Relayed serverwaiting for <server id> until its bridge sends something, then receiving <server id> with how long ago its last heartbeat arrived, and a count of messages dropped by the relay's checks. The key button opens Bridge setup.

The colored dot is green when all is well, yellow while a daemon restarts, and red after an error or when an enabled daemon isn't running. A switched-off task has no color.

Drag a card by its handle on the left to reorder the list. The order is saved, and the hub starts enabled tasks in that order, top to bottom.

Each card has these buttons, if you may edit tasks:

  • Run now (scripts and URL watchers) runs the task immediately, outside its schedule.
  • Restart (daemons, plugins, and relayed servers) stops the task and starts it again.
  • Enable or Disable (Start or Stop for daemons) switches the task on or off. Off tasks keep their settings but don't run.
  • Edit opens the task's settings. You can change everything except the type.
  • Delete removes the task after asking you to confirm. A running daemon is stopped first.

+ Add opens the Add Task dialog: give the task a name, pick a type, fill in its settings and, for scripts and URL watchers, a schedule.

Settings by type

script

FieldRequiredMeaning
pathyesThe .py file to run, as a full path or relative to the hub folder.
source_namenoThe log source its output is filed under. When it's blank or left out, the task's name is used.
argsnoA list of command-line arguments passed to the script. Set through the API only.

daemon

FieldDefaultMeaning
pathrequiredThe .py file to run, as a full path or relative to the hub folder.
source_namedetectedThe log source for its output. When blank, the hub looks for a log_client.SOURCE = "name" line in the script, then falls back to the file name without .py.
restart_delay5Seconds to wait before restarting after a crash.
capture_outputfalseForward the script's printed output to the hub as debug log entries.

urlwatch

FieldDefaultMeaning
urlrequiredThe page to watch.
modehashhash (any change in the page's text), selector (the text of one element) or keyword (a word appearing or disappearing).
selectornoneCSS selector, for selector mode.
keywordnoneThe word to look for, for keyword mode. Not case-sensitive.
alert_levelimportantLog level of the alert. The form offers important, warning, and error.
jsfalseLoad the page in a headless Chromium browser so JavaScript runs first.
wait_fornoneWith js on, a CSS selector to wait for (up to 10 seconds) before reading the page.

plugin

FieldMeaning
scriptThe plugin's name: its file name without .py, in the folder set by plugins_path. The form lists the plugins it finds there.
other keysThe plugin's own settings. When the plugin declares them, the form shows a field for each and the hub checks them when you save. Otherwise you can enter them as JSON.

See Installing hub plugins and Writing a LemmeSee plugin.

relay

FieldMeaning
server_idThe relayed server's 8-character server id. Required.
allow_fromAddress ranges its bridge may sign in from. Empty means private networks.

Bridge settings, with the relay's publish key, come from Bridge setup on the card, or POST /api/relays/{id}/bridge. See Relayed servers.

Tasks over the API

Everything on the Tasks page is also available through the REST API, for users allowed to edit tasks. A task looks like this:

{
  "id": "5f0c2c1e-8a8e-4d0b-9f43-0b6f5d1f7a10",
  "name": "Nightly backup",
  "type": "script",
  "enabled": true,
  "schedule": { "type": "cron", "cron": "0 2 * * *" },
  "config": { "path": "/path/to/backup.py", "source_name": "backup" },
  "last_run": "2026-10-23T02:00:04.812345+00:00",
  "last_status": "ok",
  "last_message": null
}
FieldMeaning
idAssigned by the hub.
nameDisplay name.
typescript, daemon, urlwatch, plugin, or relay.
enabledOn or off. Defaults to true when creating.
scheduleFor scripts and URL watchers, {"type": "interval", "minutes": 5} or {"type": "cron", "cron": "..."}. Always null for daemons, plugins, and relayed servers. See Scheduling.
configThe settings for the type, as above.
last_runWhen it last ran, in UTC, or null.
last_statusnever, ok, or error.
last_messageThe error from the last failed run, or null.
MethodPathWhat it does
GET/api/tasksList tasks.
GET/api/tasks/{id}One task.
POST/api/tasksCreate a task from name, type, enabled, schedule, and config.
PATCH/api/tasks/{id}Change name, enabled, schedule, or config. A config you send replaces the whole config.
DELETE/api/tasks/{id}Delete a task.
POST/api/tasks/{id}/toggleSwitch a task on or off.
POST/api/tasks/{id}/runRun now, or restart a daemon, plugin, or relayed server.
POST/api/tasks/reorderBody {"ids": [...]}: put those tasks in that order. Tasks you can't see keep their places.

A script or URL watcher created through the API without a schedule runs every 5 minutes. Users who may see tasks but not edit them get the list without each task's config. See the REST API for authentication and the remaining endpoints.