Monitor Spotify Playback via MQTT and Log Track Data
Workflow Description
An automation template that listens to Spotify playback events through MQTT triggers, processes incoming data with filters and conditional logic, and logs music information while executing custom actions based on playback state.
How it works
- 1.Receive playback state signals from MQTT broker
- 2.Parse and split incoming data using splitOut node
- 3.Apply filters and conditional logic to categorize events
- 4.Execute HTTP requests based on playback status
- 5.Log relevant track and playback details
Use cases
- Track favorite songs and collect listening statistics automatically
- Trigger external workflows when specific music genres or artists start playing
- Document listening patterns and usage analytics for personal insights
Requirements
- Active Spotify account connection configured
- Running MQTT broker with proper credential setup
- Understanding of conditional logic and data filtering
Service Value
Ready-made workflow template for automation delivery and service execution.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (26)
Spotify Next
If
Spotify Resume
If
Spotify Pause
If
Sticky Note
Sticky Note
Spotify API - Volume up 5pct
HTTP Request
Spotify API - Volume down 5pct
HTTP Request
Sticky Note8
Sticky Note
Spotify API - Get Available Devices
HTTP Request
Extract Individual Devices
Split Out
Select Device by Name to get device_id
Filter
Custom Function 1 - P1
HTTP Request
Custom Function 2 - P2
If
Custom Function 1 - P3
If
Spotify API - Activate Target Playback Device
HTTP Request
Route to Requested Function
Switch
Custom Function 2 - P1
If
Filter
Filter
Globals
Set
Custom Function 2 - P3
If
Oops. How was this reached?
No Op
Spotify API - Get Device Status
HTTP Request
Already playing on Target Device?
If
Is Playing?
If
Spotify Prev
If
MQTT Trigger - Remote Switch
Mqtt Trigger
Remote Action -> Function Router
Switch