Laat je Twitch-kijkers jouw Blackmagic ATEM Mini Pro bedienen via Bits!
ATWITCHEM koppelt je Twitch-chat aan je Blackmagic ATEM Mini Pro videomixer. Kijkers doneren Bits in de chat, en jouw ATEM reageert automatisch β camera wisselen, CUT of AUTO overgang, Picture-in-Picture aanpassen, noem maar op.
Alles is instelbaar via een netjes web-dashboard dat meestart in je browser. Geen ATEM Software Control nodig tijdens gebruik.
- π₯ Automatisch camera's wisselen via Twitch Bits en/of Channel Points
- β±οΈ Instelbare cooldown per regel β voorkom spam
- β‘ Ondersteuning voor CUT, AUTO, preview en PiP-acties
- π Ingebouwd web-dashboard op
http://localhost:5000 - π Automatisch herverbinden als de ATEM wegvalt
- π Regels live beheren vanuit het dashboard (bewaard in
config.json) - π§ͺ Test-modus voor zowel Bits als Channel Points simuleren
- Python 3.8 of hoger
- Een Blackmagic ATEM Mini Pro (of vergelijkbaar model) bereikbaar via netwerk
- Een Twitch-account met OAuth-token
| Package | Versie | Waarvoor |
|---|---|---|
twitchio |
β₯ 2.8, < 3.0 | Twitch chat & Bits events luisteren |
flask |
β₯ 3.0 | Web-dashboard server |
flask-socketio |
β₯ 5.3 | Realtime updates in het dashboard |
Installeer alles in één keer:
pip install -r requirements.txt1. Config instellen
Kopieer het voorbeeldbestand en vul je gegevens in:
# Windows
copy config.json.example config.json
# Linux / macOS
cp config.json.example config.jsonOpen config.json en pas aan:
{
"atem_ip": "192.168.1.xxx",
"twitch_channel": "jouwnaam",
"twitch_token": "oauth:xxxxxxxxxxxxxx",
"dashboard_port": 5000,
"rules": []
}π‘ Twitch OAuth-token aanvragen? Ga naar twitchapps.com/tmi en log in.
π Channel Points gebruiken? Zorg dat je token de scope
channel:read:redemptionsheeft. Zonder die scope werken Bits-regels gewoon door β Channel Points worden dan stilletjes genegeerd.
2. Starten
# Windows (dubbelklik of via terminal)
start.bat
# Linux / macOS
bash start.sh
# Of direct via Python
python src/main.py3. Dashboard openen
Ga naar http://localhost:5000 in je browser.
Regels bepalen wat er gebeurt bij een Bits-donatie of Channel Point redemption. Een regel bestaat uit:
| Veld | Omschrijving |
|---|---|
trigger_type |
"bits", "channel_points" of "both" |
bits_min |
Minimaal aantal Bits (voor Bits/beide) |
bits_max |
Maximaal aantal Bits (optioneel) |
reward_name |
Naam van de Channel Point reward om op te matchen (optioneel, gedeeltelijke match) |
trigger_text |
Tekst in het bericht/gebruikersinput (optioneel) |
action |
Welke actie uitvoeren (zie hieronder) |
value |
Waarde voor de actie (bijv. camera-ingang 1β4) |
cooldown_seconds |
Cooldown in seconden tussen twee triggers (0 = geen) |
name |
Naam voor in het dashboard |
Beschikbare acties:
| Actie | Omschrijving | Waarde |
|---|---|---|
switch_program |
Wissel live (on-air) camera | ingang 1β4 |
switch_preview |
Wissel preview camera | ingang 1β4 |
cut |
CUT-overgang uitvoeren | β |
auto |
AUTO-overgang uitvoeren | β |
toggle_downstream_key |
DSK on-air schakelen | 1 of 2 |
set_pip_source |
PiP-bron wisselen | ingang 1β4 |
Voorbeeld:
{
"name": "Schakel naar Cam 2",
"bits_min": 200,
"trigger_text": "cam2",
"action": "switch_program",
"value": 2
}ATWITCHEM connects your Twitch chat to your Blackmagic ATEM Mini Pro video switcher. Viewers donate Bits in chat, and your ATEM responds automatically β switch cameras, trigger a CUT or AUTO transition, change Picture-in-Picture sources, and more.
Everything is configurable through a clean web dashboard that starts alongside the bot. No ATEM Software Control needed during operation.
- π₯ Automatically switch cameras via Twitch Bits and/or Channel Points
- β±οΈ Configurable cooldown per rule β prevent spamming
- β‘ Support for CUT, AUTO, preview and PiP actions
- π Built-in web dashboard at
http://localhost:5000 - π Auto-reconnect if the ATEM becomes unreachable
- π Manage rules live from the dashboard (saved to
config.json) - π§ͺ Test mode for simulating both Bits and Channel Point events
- Python 3.8 or higher
- A Blackmagic ATEM Mini Pro (or similar) reachable on your network
- A Twitch account with an OAuth token
| Package | Version | Purpose |
|---|---|---|
twitchio |
β₯ 2.8, < 3.0 | Listen to Twitch chat & Bits events |
flask |
β₯ 3.0 | Web dashboard server |
flask-socketio |
β₯ 5.3 | Real-time updates in the dashboard |
Install everything at once:
pip install -r requirements.txt1. Configure
Copy the example config and fill in your details:
# Windows
copy config.json.example config.json
# Linux / macOS
cp config.json.example config.jsonOpen config.json and edit:
{
"atem_ip": "192.168.1.xxx",
"twitch_channel": "yourchannel",
"twitch_token": "oauth:xxxxxxxxxxxxxx",
"dashboard_port": 5000,
"rules": []
}π‘ Need a Twitch OAuth token? Visit twitchapps.com/tmi and log in.
π Using Channel Points? Make sure your token has the
channel:read:redemptionsscope. Without it, Bits rules still work β Channel Points are silently ignored.
2. Run
# Windows (double-click or via terminal)
start.bat
# Linux / macOS
bash start.sh
# Or directly with Python
python src/main.py3. Open the dashboard
Navigate to http://localhost:5000 in your browser.
Rules define what happens on a Bits donation or Channel Point redemption. A rule consists of:
| Field | Description |
|---|---|
trigger_type |
"bits", "channel_points", or "both" |
bits_min |
Minimum Bits to trigger (for Bits/both) |
bits_max |
Maximum Bits (optional) |
reward_name |
Channel Point reward title to match (optional, partial match) |
trigger_text |
Text in message/user input (optional) |
action |
Which action to execute (see below) |
value |
Value for the action (e.g. camera input 1β4) |
cooldown_seconds |
Cooldown in seconds between triggers (0 = none) |
name |
Display name in the dashboard |
Available actions:
| Action | Description | Value |
|---|---|---|
switch_program |
Switch live (on-air) camera | input 1β4 |
switch_preview |
Switch preview camera | input 1β4 |
cut |
Execute a CUT transition | β |
auto |
Execute an AUTO transition | β |
toggle_downstream_key |
Toggle DSK on-air | 1 or 2 |
set_pip_source |
Change PiP source | input 1β4 |
Example:
{
"name": "Switch to Cam 2",
"bits_min": 200,
"trigger_text": "cam2",
"action": "switch_program",
"value": 2
}ATWITCHEM/
βββ src/
β βββ main.py # Opstartpunt / Entry point
β βββ atem_controller.py # UDP-communicatie met ATEM / UDP comms with ATEM
β βββ twitch_client.py # Twitch chatbot / Twitch chatbot
β βββ rule_engine.py # Bits β acties koppeling / Bits β actions mapping
β βββ dashboard.py # Flask web-dashboard
β βββ templates/
β βββ index.html # Dashboard UI
βββ static/
β βββ css/style.css
β βββ js/dashboard.js
βββ config.json # Jouw instellingen (niet committen!) / Your settings (don't commit!)
βββ config.json.example # Voorbeeldconfig / Example config
βββ requirements.txt
βββ start.bat # Windows opstartscript / Windows start script
βββ start.sh # Linux/macOS opstartscript / Linux/macOS start script
Made with β€οΈ by DIMENTS