Guides

Alerts with nobody watching

Run an alert on the machine that sends the stream (the collector or a Python sender), day and night, with no browser open.

An alert normally runs in the browsers that have its workbook open. Tick one more box and it also runs on the machine that sends the stream, the collector or a Python sender: every value is checked there, watched or not, and the alert’s channels are notified as usual. The stream’s data stays on that machine (see What Kymoscope sees). Allow ten minutes.

Step 1: Tick The sending machine

  1. Open a workbook with the stream, the Alerts panel (the bell in the left rail), Rules, and open the alert (or create one).
  2. Under Where it runs, tick The sending machine (collector or Python sender). This browser stays ticked: the alert still runs wherever the workbook is open.
  3. Click Save alert. The alert now carries an On site tag in the Rules list.

It runs on every machine that sends a stream it applies to: a project’s alerts on the project’s streams, your personal alerts on your personal streams. An alert on a math channel can’t run there (“Formula channels run only in the app.”): math channels exist only in the app.

Step 2a: On the collector

Nothing to add: rules: on is the default. The collector asks for its alerts every minute, so the alert reaches it within a minute of saving, with no restart. In a stream with several sources, all of an alert’s channels must come from one source.

Kymoscope’s messages never carry values. To also get each alert with its values on the customer’s network, add your own mail server, a webhook, or both, to collector.yaml and restart the collector:

collector.yaml (excerpt)
rules: on            # the default (off: no alert runs on this machine)
alerts:              # optional: messages with values, on your own network
  email: [shift.lead@customer.example, maintenance@customer.example]
  smtp:
    host: mail.customer.local
    port: 587
    user: kymoscope
    password: file:smtp.txt
    from: kymoscope@customer.local
  webhook:
    url: https://scada.customer.local/kymoscope
    secret: file:webhook-secret.txt

The email reads, for example, “Critical: Oil temperature high · Press 2”, then “Oil temperature high on Press 2 raised at 2026-11-17 03:12:07 UTC.”, “Values: DCS/Oil_Temp = 121.3.” and the severity; the one for the end adds the peak. The webhook gets a signed JSON post: see Alerts on this machine. Both go out once, straight from the collector, and Kymoscope sees neither.

Step 2b: On a Python sender

Install the package with its rules extra (it adds numpy), then pass rules=True:

Shell
pip install "kymoscope[rules]"
Python
import math, time
from kymoscope import LiveStream

API_KEY = "kymoscope_..."   # the project's API key
with LiveStream(API_KEY, "Press 2", mode="live", hz=10, channels=1, state_path="kymoscope-state.json",
                rules=True, on_alert=print) as stream:
    while True:
        t = time.time()      # Unix seconds
        stream.send([{"t": t, "signals": [
            {"name": "Oil_Temp", "unit": "degC", "value": 110 + 15 * math.sin(t / 60)},
        ]}])
        time.sleep(0.1)

The alerts run on every block you send, before it is encrypted, whether anyone watches or not, and are asked for again every minute. Send Unix times (time.time()): they become the alert’s times. on_alert hears every change on this machine, with the alert’s values:

Python
{'rule': 'Oil temperature high', 'ruleId': '6f0c1c1e-…', 'ruleVersion': 3, 'severity': 'critical',
 'stream': '<stream id>', 'kind': 'raised', 't': 1763349127.2, 'raisedAt': 1763349127.2, 'late': False,
 'peak': None, 'values': {'Oil_Temp': 121.3}}

kind is raised, cleared (with its peak) or lost (the alert was changed or turned off while raised). In an end-to-end encrypted project the alerts run once a project member has approved this sender, as for publishing.

Step 3: Check it works

  1. Open the project’s Alerts tab. Coverage lists each sending machine: “Press 2 collector”, Collector or Python sender, “3 rules · 0 waiting”, “Seen 20 s ago” and its version. For a personal alert, the rule editor says under Where it runs: “Watched by Press 2 collector · 20 s ago”.
  2. A number waiting means an alert waits for a channel the stream doesn’t have. Names are matched exactly, including case; the collector’s log names the missing channel.
  3. On the collector, the health stream shows <source>.alerts.rules, <source>.alerts.waiting, <source>.alerts.rule_errors, <source>.alerts.eval_ms and alerts.queued.
  4. To see one arrive, set the alert to a value the data crosses now and save. Within a minute the episode appears in History, marked Collector. Then put the value back.

Step 4: What happens when

WhenWhat happens
The internet dropsThe alerts keep running. Each start and end waits on the machine’s disk (a restart keeps it) and goes to Kymoscope when the connection is back, once: its channels are notified then, and the history marks one more than 10 minutes old Late. Messages from alerts.smtp and alerts.webhook on your network go out at once.
The machine stopsAfter 5 minutes without a word from it, while no other machine runs the same alerts on that stream, Kymoscope sends “Nobody is watching Press 2”: a notice in the app to the project’s leads (a personal stream: its owner) and one message on each email, Slack, Teams or webhook channel of the alerts that stopped. Once per outage, at most once an hour; nothing is sent when it comes back, and Coverage shows it watching again. An internet outage longer than 5 minutes looks the same.
An alert is changed or turned offThe machine has the change within a minute. An episode it had open ends at the last value it checked; a changed alert starts again from the next values.

What Kymoscope sees

From the sending machine Kymoscope gets which alert (its id and version) on which stream, when each episode started and ended, and the episode’s details: how long it lasted and its peak. In an end-to-end encrypted project the details are sealed with the project key, so Kymoscope can’t read them; on personal streams and in projects without end-to-end encryption they are stored readable, as for alerts run in a browser. Every minute it also gets which alerts the machine runs, how many wait, and the sender’s version. Never the stream’s data or channel names.

In an end-to-end encrypted project the alert reaches the machine sealed, and the machine opens it with the project key it already holds. See Data flow.