Streaming Hub 0.1

Track signal data with Statistics

Collect counters, totals, latest values, minimums, maximums, and formulas directly from incoming signals without creating an automation.

Alpha
BeginnerUpdated 2026-07-28

Result

Statistics lets Streaming Hub remember useful values from incoming signals even when no automation handles those signals.

After this guide, you will be able to:

  • count how many times a signal arrived;
  • keep the latest value from one of its fields;
  • calculate a sum, minimum, or maximum;
  • update a number with a formula such as {stats.donations} + 1;
  • read the result from automations, macros, conditions, and templates through stats.*.
The Statistics workspace configures the value in the center and automatically opens the selected signal in Encyclopedia on the right.

How Statistics differs from Variables

A Variable is a general project value that actions can read and write.

A Statistic is a read-only derived value. Streaming Hub updates it only when its configured signal arrives. An automation can read stats.*, but actions cannot assign or increment it directly.

No donation, follower, subscription, or other value is collected automatically. A plugin must provide the signal, and you must explicitly create and configure the Statistic.

Step 1. Add a Statistic

Open the Statistics tab and select Add.

Configure its identity:

FieldPurpose
EnabledPauses or resumes updates without deleting the current value.
NameFriendly name shown in the Statistics lists.
KeyStable path after stats., for example donations.
DescriptionOptional explanation for other project editors.

With the key donations, the primary read path is:

stats.donations

Keys should be short, stable, and descriptive. Changing a key also changes the path used by every automation and template.

Step 2. Select the source signal

Select Source signal to open the same searchable signal picker used by automations.

Choose the real event that should update the Statistic, such as:

  • DonationAlerts Donation Received;
  • Twitch Follow;
  • YouTube New Sponsor;
  • OBS Stream Started;
  • a signal supplied by another installed plugin.

The Encyclopedia panel automatically selects that signal. Use its Contract Fields table to find the exact paths available for Source field, Filter field, and Formula.

You can collapse Encyclopedia with its header button when more editing space is needed.

Step 3. Choose an operation

OperationWhat it storesSource field
CountAdds one for every accepted signal.Not used
Last ValueReplaces the value with the latest selected field.Required
SumAdds the selected numeric field to the running total.Required
MinKeeps the smallest selected numeric value.Required
MaxKeeps the largest selected numeric value.Required
FormulaEvaluates a numeric expression for every accepted signal.Not used directly

For Donation Received, a Sum Statistic might use:

event.payload.Amount

Use the exact field path shown by Encyclopedia. If a plugin changes its signal contract, verify the path again after updating the plugin.

Step 4. Use Formula when a simple aggregate is not enough

Formula is evaluated once for every signal that passes the optional filter and deduplication checks. Its result becomes the new value of the current Statistic.

Count incoming donations:

{stats.donations} + 1

Add the incoming donation amount:

{stats.donation_total} + {event.payload.Amount}

Apply a multiplier:

{stats.weighted_support} + ({event.payload.Amount} * 1.5)

Formulas can reference:

  • stats.* for current Statistic values;
  • event.* and payload.* for the incoming signal;
  • vars.* for project configuration values.

When a Formula references its own Statistic before the first value exists, that self-reference starts at zero. Formula must produce a finite number; invalid fields or expressions put the Statistic into Error status and show the reason in the editor.

Step 5. Choose the storage scope

ScopeBehavior
SessionKeeps the value for the current app/project session and clears it with Reset all session values.
PersistentSaves the current value beside the project and restores it later.
BothMaintains separate session and persistent values.

For Session and Persistent, read the configured value through:

stats.donations

For Both, the primary path returns the persistent value. You can explicitly select either value:

stats.donations.session
stats.donations.persistent

Use Reset all session values to start a new session counter. Use Reset persistent value to clear only the persistent value of the selected Statistic.

Step 6. Filter incoming signals

Leave Filter field empty to accept every occurrence of the selected signal.

To accept only matching events, configure:

FieldExample
Filter fieldevent.payload.Currency
Expected filter valueUSD

The comparison is case-insensitive. A signal whose field is missing or has a different value does not update the Statistic.

Keep Ignore duplicate correlation IDs enabled for events that may be delivered more than once. Streaming Hub then counts one correlation ID only once per Statistic during the current session.

Step 7. Read Statistics in automations

Open Insert Field and select the Stats tab to copy or insert configured paths.

Use a raw path in conditions and source fields:

stats.donation_total

Use braces in templates:

We have received {stats.donation_total} in donations this stream.

Statistics are read-only. Write targets must use vars.* or runtime.*; actions such as Set Variable, Increment Value, Math Number Operate, and Random cannot target stats.*.

The Statistics side panel in Automation and Macros shows current values without opening the configuration workspace.

Step 8. Export or import current values

Statistic definitions are part of the core project configuration.

When exporting a project, enable Current statistics values if the exported file should also contain the current session and persistent values. Leave it disabled when another user should start with empty values.

During import:

  • importing the core project brings in Statistic definitions;
  • importing Current statistics values restores values for matching Statistic IDs;
  • values can be imported separately into an already loaded matching project.

Verify the setup

  1. Create and enable a Statistic.
  2. Select its source signal.
  3. Choose Count, or choose Sum and select a numeric contract field.
  4. Trigger or test the signal.
  5. Confirm that Status changes from Waiting to Active.
  6. Confirm that Current value and Last updated change.
  7. Insert stats.<key> into an automation condition or Log template and test it.

If it does not work

  • Status stays Waiting: confirm the Statistic is enabled, the plugin is connected, and the selected signal actually arrived.
  • Field was not found: copy the exact path from the selected signal's Contract Fields table in Encyclopedia.
  • The selected field is not numeric: use Last Value for text, or select a numeric field for Sum, Min, and Max.
  • Formula reports an error: verify every placeholder and make sure the final expression produces a finite number.
  • Some events are ignored: review Filter field, Expected filter value, and correlation-ID deduplication.
  • The value resets after restart: use Persistent or Both instead of Session.
  • An automation cannot write to the Statistic: this is intentional; change its Statistics configuration or write to a Variable instead.
  • A plugin signal is missing: install, enable, or reconnect the plugin that provides it.

Related