Streaming Hub 0.1

Track signal data with Statistics

Build reusable counters, totals, latest values, and calculations from one or more incoming signals without creating automations.

Alpha
BeginnerUpdated 2026-08-26

Result

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

After this guide, you will be able to:

  • create a typed value under stats.*;
  • update one Statistic from one or several signals;
  • read a signal field, use a constant, or calculate an expression;
  • replace, add, minimize, or maximize the stored value;
  • filter and deduplicate each update rule independently;
  • read the result from automations, macros, conditions, and templates.

How Statistics differs from Variables

A Variable is general project state. Actions can read and write it.

A Statistic is a read-only derived value. Users define how incoming signals update it, while automations and templates consume the result through stats.*. Actions cannot assign to a Statistic directly.

No donation, follower, subscription, or other value is collected automatically. A plugin must provide the signal, and you must explicitly create both the value and its update rules.

The Statistics workspace

Statistics keeps the complete value-and-rule workflow on one screen:

PanelWhat it defines
Statistic valuesWhat is stored: key, type, initial value, scope, and current value.
Update rulesWhich rules are enabled and quick actions to duplicate or delete them.
Value settingsConfiguration and runtime state for the selected value.
Rule settingsHow an incoming signal produces a value and where that value is applied.
EncyclopediaThe contract and fields of the signal selected by the current rule.

The Values and Rules lists are separated by a splitter, as are Value settings and Rule settings. Value settings can be collapsed to give Rule settings more room without hiding either list. The Encyclopedia panel can also be collapsed.

This separation is important. One value can have any number of update rules, and each rule can listen to a different signal.

The data flow is:

Signal → Field / Constant / Expression → Replace / Add / Min / Max → stats.<key>

Step 1. Create a value

Open Statistics and choose Add beside Statistic values.

Configure:

FieldPurpose
EnabledPauses all rules targeting this value without deleting it.
NameFriendly name shown in the Statistics workspace.
KeyStable path after stats., for example donation_total.
DescriptionOptional explanation for other project editors.
Value typeNumber, Text, or Boolean.
Initial valueValue used when the Statistic is created or reset.
ScopeSession, Persistent, or Both.

With the key donation_total, the primary read path is:

stats.donation_total

Keep keys short, stable, and unique. Changing a key also changes the path used by automations and templates.

Storage scopes

ScopeBehavior
SessionKeeps a value for the current app/project session.
PersistentSaves the value beside the project and restores it later.
BothMaintains independent session and persistent values.

For Both, you can explicitly read either lane:

stats.donation_total.session
stats.donation_total.persistent

The primary stats.donation_total path reads the persistent lane when scope is Both.

Step 2. Add an update rule

Choose Add beside Update rules. If a Statistic is selected, the new rule uses it as the initial destination.

The Rules list provides quick controls to enable or disable, duplicate, or delete each rule. Use Remove in the section header to delete the selected rule.

Give the rule a descriptive name, such as Add DonationAlerts amount. Then select Signal to open the same searchable signal picker used by automations.

The Encyclopedia panel on the right automatically follows the selected signal. Use its contract fields to see which paths the plugin sends. Encyclopedia can be collapsed when more editing space is needed.

Examples of possible sources include:

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

Step 3. Choose the incoming value

Each rule has one incoming-value source:

SourceUse it forExample
FieldRead one field from the incoming signal.payload.amount
ConstantUse the same value whenever the signal arrives.1
ExpressionCalculate a value from event fields, Variables, Statistics, or current.{payload.amount} * 1.5

For Field, choose a contract path from the list or type the exact path shown in Encyclopedia.

In an Expression, current means the current value of the destination Statistic. For example:

current + {payload.amount}

When scope is Both, the expression is evaluated independently for the session and persistent lanes. This lets one lane continue from its own current value after the other is reset.

Step 4. Choose the destination and apply mode

Select the destination Statistic, then choose how the incoming value affects it:

Apply modeResult
ReplaceStores the incoming value as the new value.
AddAdds the incoming number to the current number.
MinimumKeeps the smaller of the current and incoming numbers.
MaximumKeeps the larger of the current and incoming numbers.

Add, Minimum, and Maximum are available only for Number Statistics. Text and Boolean Statistics use Replace.

The preview summarizes the completed mapping before a signal arrives.

Common recipes

GoalIncoming sourceIncoming valueApply mode
Count donationsConstant1Add
Sum donation amountsFieldpayload.amountAdd
Keep the latest donor nameFieldpayload.usernameReplace
Keep the largest donationFieldpayload.amountMaximum
Add a weighted amountExpression{payload.amount} * 1.5Add
Calculate the complete next valueExpressioncurrent + {payload.amount}Replace

Do not combine current + value with Add unless you intentionally want to add the complete calculated result again.

Step 5. Update one Statistic from several signals

Create another update rule and select the same destination Statistic.

For example, stats.support_points can receive:

  • a Donation Received rule that adds payload.amount;
  • a New Subscription rule that adds the constant 5;
  • a Manual Reward rule that adds payload.points.

The rules are independent. A filter, error, or duplicate in one rule does not prevent another matching rule from updating the destination.

Step 6. Configure advanced rule behavior

Open Advanced on an update rule.

Filter

Leave Filter field empty to accept every occurrence of the selected signal. To accept only matching events, set a field and expected value:

FieldExample
Filter fieldpayload.currency
Expected filter valueUSD

The comparison is case-insensitive. A missing or different value does not match the rule.

Missing field

This policy applies when a Field source cannot be resolved:

PolicyBehavior
IgnoreRecords the match as ignored and leaves the Statistic unchanged.
Use fallbackUses the configured fallback value.
ErrorLeaves the Statistic unchanged and records an error on the rule.

Deduplication

Keep Ignore duplicate correlation IDs enabled when a connector may deliver the same event more than once.

Deduplication is scoped to one update rule. Two different rules may intentionally process the same correlation ID once each.

Step 7. Verify rule diagnostics

Trigger or test the selected signal, then inspect the rule:

  • Status changes from Waiting to Active after a successful update;
  • Last matched shows when the rule received its latest accepted signal;
  • Last input shows the resolved incoming value;
  • Last result shows the destination value after applying the rule;
  • Processed events counts successful updates;
  • Ignored duplicates counts repeated correlation IDs;
  • Last error explains an invalid field, expression, type conversion, or destination.

The Values list shows the combined current value and how many rules target each Statistic.

Step 8. Read Statistics

Open Insert Field and select the Stats tab to copy or insert configured paths. The same category is available in the Insert Field popup opened with the configured hotkey (Ctrl+Space by default).

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.*.

Step 9. Export or import current values

Statistic definitions and update rules are part of the core project configuration.

When exporting a project, enable Current statistics values if the export should also contain current session and persistent values. Leave it disabled when another user should start from the initial value of each Statistic.

During import:

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

Verify the complete setup

  1. Create a typed Statistic from the Values list.
  2. Add an update rule.
  3. Select its real signal through the signal picker.
  4. Select Field, Constant, or Expression.
  5. Select the destination and apply mode.
  6. Trigger or test the signal.
  7. Confirm the rule diagnostics and destination value changed.
  8. Insert stats.<key> into an automation condition or Log template and test it.

If it does not work

  • Status stays Waiting: confirm the rule and destination are enabled, the plugin is connected, and the selected signal actually arrived.
  • Field was not found: copy the exact path from the selected signal contract in Encyclopedia.
  • The selected field is not numeric: use Replace with a Text Statistic, or select a numeric field for Add, Minimum, and Maximum.
  • Expression reports an error: verify every placeholder and ensure a numeric expression produces a finite number.
  • Some events are ignored: review the rule filter, missing-field policy, 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; edit its update rules or write to a Variable instead.
  • A plugin signal is missing: install, enable, or reconnect the plugin that provides it.

Related