Streaming Hub 0.1

Control a Twitch prediction from Stream Deck

Create, lock, resolve, and cancel a two-outcome Twitch prediction with dedicated Stream Deck buttons.

Alpha
IntermediateTwitchStream DeckUpdated 2026-07-26

Result

In this guide, you will control a Twitch Channel Points Prediction without leaving your Stream Deck:

  • Start creates “Will I win this?” with Win and Lose outcomes.
  • Win resolves the first outcome.
  • Lose resolves the second outcome.
  • Lock closes entries before you select the winning outcome.

The prediction ID returned by Twitch is stored in a project variable, allowing separate button automations to control the same active prediction.

Before you start

You need:

  • a Twitch broadcaster account connected in Streaming Hub;
  • a working Stream Deck or compatible StreamDock connection;
  • permission to manage predictions on the connected Twitch channel.

Complete Stop or mute Piper TTS from Stream Deck first if you have not yet installed and connected the Streaming Hub controller plugin.

Step 1. Create the Stream Deck buttons

In the Stream Deck or StreamDock application, create three Streaming Hub Signal buttons:

ButtonButton ID
Start predictionprediction_start
Resolve as Winprediction_win
Resolve as Loseprediction_lose

The screenshot contains a fourth button named Lock Prediction. You can add it now with:

prediction_lock

Its automation is configured later in this guide.

Each Signal button uses a unique Button ID that will be matched by a StreamDeck Button Up signal.

Step 2. Create the button automations

In Streaming Hub, create these automations with the StreamDeck Button Up signal:

AutomationButton ID
Prediction Startprediction_start
Prediction Winprediction_win
Prediction Loseprediction_lose

Using Button Up runs the automation once when the key is released.

Test each physical button while the default Log action is still present. The corresponding automation should appear in Logs.

Step 3. Create the prediction

In Prediction Start, delete the default Log action and add Twitch Predictions Create Prediction.

Configure:

FieldValue
TitleWill I win this?
Outcomes Input ModeManual
Outcome 1Win
Outcome 2Lose
Window SecondsThe time viewers may submit predictions

Window Seconds controls the entry window. For example, 120 gives viewers two minutes to choose an outcome.

In Manual mode, add the outcomes directly in the editor. JSON mode is useful when another action or variable supplies a dynamic JSON array instead.

An equivalent JSON value for this example is:

["Win", "Lose"]
Create Prediction writes the new Twitch prediction ID to Runtime before Set Variable stores it for other automations.

Step 4. Store the prediction ID

After Create Prediction, add Core Set Variable:

FieldValue
Target Pathvars.prediction_id
Value Template{runtime.twitch.prediction.id}

Create Prediction writes the latest prediction ID to:

runtime.twitch.prediction.id

Runtime belongs to the current automation run, so it will not be available when a different Stream Deck button starts another automation. vars.prediction_id preserves the ID at project level for the Lock, Win, Lose, and optional Cancel buttons.

Step 5. Resolve the Win outcome

In Prediction Win, delete Log and add Twitch Predictions Resolve Prediction:

FieldValue
Prediction ID{vars.prediction_id}
Winning Outcome Index1
Winning Outcome IDEmpty

Outcome indices are one-based. 1 selects the first configured outcome, which is Win.

If Winning Outcome ID is empty, Streaming Hub requests the current prediction from Twitch and converts the selected index into the corresponding Twitch outcome ID.

Step 6. Resolve the Lose outcome

Copy Resolve Prediction from Prediction Win and paste it into Prediction Lose.

Change:

FieldValue
Winning Outcome Index2

The second configured outcome is Lose.

Step 7. Add the Lock button

Create one more StreamDeck Button Up automation:

FieldValue
Automation namePrediction Lock
Button IDprediction_lock

Delete Log and add Twitch Predictions Lock Prediction:

FieldValue
Prediction ID{vars.prediction_id}

For the most reliable workflow, use this button before Win or Lose. Once locked, viewers can no longer spend Channel Points on either outcome, and the prediction is ready to be resolved.

Step 8. Optional: add a Cancel button

To refund the viewers' Channel Points without selecting a winner, create another Signal button and automation:

FieldValue
Button IDprediction_cancel
SignalStreamDeck Button Up
ActionTwitch Predictions Cancel Prediction
Prediction ID{vars.prediction_id}

Cancel ends the prediction without a winning outcome.

Step 9. Group the automations

Create a folder for:

  • Prediction Start
  • Prediction Win
  • Prediction Lose
  • Prediction Lock
  • optional Prediction Cancel

Keeping these controls together makes the next guide easier to extend. The follow-up will read prediction events in real time, display the title and outcomes in OBS, and show a simple winner animation.

Verify the complete workflow

Test on a channel where Predictions are available:

  1. Press Start and confirm that the prediction appears on Twitch.
  2. Inspect runtime.twitch.prediction.id in the completed Start run.
  3. Confirm that vars.prediction_id contains the same ID.
  4. Press Lock and confirm that Twitch stops accepting entries.
  5. Only after Twitch reports the prediction as locked, press Win and confirm that the first outcome is resolved.
  6. Start another prediction, lock it, then press Lose and confirm that the second outcome is resolved.
  7. If you added Cancel, start another prediction and confirm that Cancel ends it without selecting an outcome.

If it does not work

  • Create Prediction fails: confirm that the broadcaster account is connected, the channel supports Predictions, and the authorization includes permission to manage them.
  • A button does nothing: verify the Button ID on both the controller and StreamDeck Button Up signal.
  • The other automations cannot find the prediction: confirm that Set Variable runs after Create Prediction and inspect vars.prediction_id.
  • Resolve Prediction fails while entries are open: press the Lock button, confirm the prediction is locked on Twitch, then press Win or Lose again.
  • Resolve reports an invalid index: ensure that the prediction contains at least two outcomes and use index 1 or 2.
  • The wrong outcome wins: compare the Create Prediction order with the one-based Winning Outcome Index.
  • Lock fails: only an active prediction can be locked; it may already be locked, resolved, canceled, or expired.
  • A new prediction cannot be created: resolve or cancel the previous prediction before starting another one.

Adapt it

  • Put the title, outcomes, and window duration in project variables.
  • Use JSON input mode to build dynamic outcome lists in another automation or macro.
  • Add separate buttons for three or more outcomes and assign the matching one-based index.
  • Write the active prediction ID to OBS diagnostics while testing.
  • Add Stream Deck status actions so the buttons show whether a prediction is active, locked, resolved, or canceled.
  • Trigger Lock automatically from a timer while keeping the physical button as a manual override.

Related