Automation
Automation rules let br\u016bhi take actions without operator intervention. Both platforms support automation, but the trigger and action types differ.
Desktop Automation
Section titled “Desktop Automation”Trigger Types
Section titled “Trigger Types”| Trigger | Description |
|---|---|
| Clock time | Fires at a specific wall-clock time (HH:MM:SS) |
| Before track end | Fires N seconds before the current track finishes |
| Playlist position | Fires when a specific track index is reached in the playlist |
| Queue empty | Fires when the broadcast queue becomes empty |
| Recurring | Fires on a repeating schedule (daily / weekly / monthly / custom interval) |
Action Types
Section titled “Action Types”| Action | Description |
|---|---|
| Load playlist to deck | Loads a regular or smart playlist to Deck A or B |
| Load track to deck | Loads a single track to a deck |
| Trigger soundboard pad | Plays a cart wall pad |
| Set master gain | Changes the master output level |
| Start recording | Starts a file recording session |
| Stop recording | Stops the current recording |
| Run script | Executes a br\u016bhi Script program |
Fire Debounce
Section titled “Fire Debounce”To prevent accidental double-fires:
- A 150 ms debounce window blocks duplicate fires for the same rule.
- A 1-second re-fire guard prevents the same rule firing again within 1 second.
Recurring Rules
Section titled “Recurring Rules”Recurring triggers can be set to repeat on:
- Daily — same time every day
- Weekly — same time on selected days of the week
- Monthly — same time on a specific date each month
- Custom interval — every N minutes/hours
Conditional Triggers
Section titled “Conditional Triggers”Combine a trigger with a condition to create conditional automation. For example:
Trigger: Clock time 23:00 Condition: Queue is empty Action: Load playlist “Overnight” to Deck A
This loads the overnight playlist only if the queue is empty at 23:00. If a live show is still running with content in the queue, the action is skipped.
Example: Morning Show Preparation
Section titled “Example: Morning Show Preparation”| Time | Action |
|---|---|
| 05:50 | Load playlist “Morning Music” to Deck A |
| 05:55 | Trigger soundboard pad “Station ID” |
| 06:00 | Set master gain to 100% |
| 06:01 | Start recording (morning show archive) |
| 09:00 | Stop recording |
Persistence
Section titled “Persistence”Automation rules are stored in the SQLite database with their full configuration, last-fired timestamp, and fire count.
Cloud Automation
Section titled “Cloud Automation”Trigger Types
Section titled “Trigger Types”| Trigger | Description |
|---|---|
| Manual | Triggered explicitly via API call |
| Schedule | Time-based (cron-style, HH:MM) |
| Source change | Fires when the active audio source changes |
| Stream start | Fires when a DJ connects and goes live |
| Stream stop | Fires when a DJ disconnects |
Action Types
Section titled “Action Types”| Action | Description |
|---|---|
| Telnet command | Sends a raw command to the station’s Liquidsoap telnet port |
| Set variable | Sets a Liquidsoap variable |
| Switch source | Switches the active audio source |
| Log | Writes a message to the station log |
Telnet Command Action
Section titled “Telnet Command Action”The most powerful action type. Anything Liquidsoap supports can be triggered via telnet:
# Switch to the scheduled playlist sourcestation.select("scheduled")
# Set the output metadatarequest.push("/path/to/file.mp3")
# Check the current sourcesource.statusRule Management
Section titled “Rule Management”Rules are managed via the dashboard’s Automation panel or the API:
GET /api/stations/{id}/automation/rules # List all rulesPOST /api/stations/{id}/automation/rules # Create a rulePUT /api/stations/{id}/automation/rules/{rid} # Update a ruleDELETE /api/stations/{id}/automation/rules/{rid} # Delete a ruleEach rule records:
- Last fired — timestamp of the most recent execution
- Fire count — total number of times the rule has executed
- Enabled — toggle to disable a rule without deleting it
Example: Auto-start Overnight Playlist
Section titled “Example: Auto-start Overnight Playlist”{ "name": "Overnight playlist at midnight", "trigger": { "type": "schedule", "time": "00:00" }, "action": { "type": "telnet_command", "command": "station.select(\"scheduled\")" }, "enabled": true}