Templates / IOT button remote / Spotify control integration with MQTT

IOT button remote / Spotify control integration with MQTT

Ready for 3.0

by Hubschrauber ✓ · 4,174 views · created 2024-08-18 · Miscellaneous

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This workflow has 24 nodes and runs on MQTT events. Along the way it connects Spotify and MQTT. It also calls api.spotify.com over HTTP.

How it runs

Trigger: On MQTT events.

  1. Spotify API - Get Available Devices (HTTP Request): calls api.spotify.com
  2. Extract Individual Devices (Split Out): splits a list into separate items
  3. Select Device by Name to get device_id (Filter): keeps only the items that match a condition
  4. Spotify API - Activate Target Playback Device (HTTP Request): calls api.spotify.com (PUT)
  5. Route to Requested Function (Switch): routes items into 5 branches
  6. Spotify API - Volume up 5pct (HTTP Request): calls api.spotify.com (PUT)
  7. Spotify API - Volume down 5pct (HTTP Request): calls api.spotify.com (PUT)
  8. Is Playing? (If): checks a condition and branches into true / false
  9. Custom Function 1 - P (HTTP Request): calls api.spotify.com (PUT)
  10. Custom Function 2 - P (Spotify): get user playlists

…plus 12 more steps. See the full node list below.

Services it uses

SpotifyMQTT

HTTP calls to: api.spotify.com

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (9)

From the author

Overview This template integrates an IOT multi-button switch (meant for controlling a dimmable light) with Spotify playback functions, via MQTT messages. This isn't likely to work without some tinkering, but should be a good head start on receiving/routing…

Excerpt from Hubschrauber's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.