Music Assistant + Home Assistant Speaker Control
Pricing
$10.00 / 1,000 search executeds
Music Assistant + Home Assistant Speaker Control
Control your self-hosted Music Assistant server (Spotify, Internet Archive, local library, AirPlay/UPnP/HomePod/Chromecast/Sonos) from anywhere with code. Play tracks/albums/playlists, control volume, queue, shuffle, repeat, multi-room. Self-hosted MA required (free, open source).
Pricing
$10.00 / 1,000 search executeds
Rating
0.0
(0)
Developer
Marv B.
Maintained by CommunityActor stats
1
Bookmarked
1
Total users
0
Monthly active users
17 days ago
Last modified
Categories
Share
๐ต Music Assistant Control โ Home Assistant & Self-Hosted Speaker Automation
Welcome! With this actor you can control your self-hosted Music Assistant server effortlessly through code โ from anywhere, without opening the app. Play tracks, albums, or playlists on your AirPlay, UPnP, HomePod, Chromecast, or Sonos speakers, adjust the volume, manage the queue, toggle shuffle/repeat, or control individual rooms and your full multi-room setup.
๐ Home Assistant users: Music Assistant runs beautifully as a Home Assistant add-on. This actor is the perfect companion to automate your speakers from Home Assistant scripts, automations, or any external system via a simple API call.
๐ก In short: You provide your server URL + token + the player you want โ everything else runs automatically. Perfect for smart-home automations, scheduled playback (e.g. a "good-night" song at 19:30), or just starting music quickly without reaching for your phone.
โ ๏ธ Important note: This actor controls your server. It is not a music streaming service. You must already be running a Music Assistant server on your own hardware (Home Assistant add-on, NAS, Docker, Pi). No Music Assistant = this actor cannot work.
๐ง Prerequisites (set this up first)
- Install Music Assistant โ free & open source
- Home Assistant Add-on, or Docker:
docker run -d --name music-assistant --network host ghcr.io/music-assistant/server:latest - Docs: https://music-assistant.io/docs/latest/installation/
- Home Assistant Add-on, or Docker:
- Connect a provider (Spotify, Internet Archive, local files, radio) in the MA app.
- Create an API token: MA app โ Settings โ Users โ Create token. Copy it โ you'll paste it as
api_tokenbelow. - Note your server URL: e.g.
http://192.168.1.50:8095(LAN) or a tunnel/HTTPS URL if running in the cloud. - Note a player name: open the MA app, look at Settings โ Players (e.g. "Living Room", "Kitchen HomePod").
๐ Usage
Input fields
| Field | Required | Description |
|---|---|---|
server_url | โ | URL of YOUR MA server (see prerequisites). |
api_token | โ | API token from YOUR MA server. Stored as Apify secret. |
action | โ | play / pause / play_pause / next / previous / volume_set / volume_up / volume_down / mute / power / search |
player_name | โ | Name of the speaker to control (case-insensitive substring match). |
search_query | โ ๏ธ for play/search | What to search (track, album, artist, playlist). |
media_type | โ | track (default) / album / artist / playlist |
volume | โ | 0-100, for volume_set / power |
power_state | โ | true/false, for power |
mute_state | โ | true/false, for mute |
dry_run | โ | true (default) = show what would happen, no changes |
Example: first run (safe, dry-run)
{"server_url": "http://192.168.1.50:8095","api_token": "YOUR_TOKEN_HERE","action": "search","player_name": "Living Room","search_query": "Daft Punk Around the World","media_type": "track","dry_run": true}
This returns search results + confirms your player is found โ without playing anything.
Example: play on a speaker
{"server_url": "http://192.168.1.50:8095","api_token": "YOUR_TOKEN_HERE","action": "play","player_name": "Kitchen","search_query": "Tame Impala The Less I Know The Better","media_type": "track","dry_run": false}
๐ Running from the cloud (Apify platform)
The actor runs in Apify's cloud. Your MA server is on your private LAN. To let the cloud actor reach it:
- Option A โ local run:
apify runfrom a machine on your LAN (no tunneling needed). - Option B โ tunnel: expose your MA server via Tailscale / WireGuard / ngrok / Cloudflare Tunnel, then use that HTTPS URL as
server_url. - Option C โ standby listener: run a small relay on your LAN that calls this actor (advanced).
Each user controls their own server โ the actor is stateless and stores nothing.
๐ What it does / doesn't
Does:
- Search across all your MA providers
- Play tracks / albums / artists / playlists
- Volume, mute, power, shuffle, repeat, skip, queue
- Multi-room (control any or all players)
- Returns structured JSON (current item, state, volume)
Doesn't:
- Provide music (you bring Spotify/etc.)
- Store credentials (token stays in your Apify secret)
- Scrape anything (uses the official MA WebSocket API)
- Work without a self-hosted MA server
๐ฐ Pricing
Model: Pay-per-event (PER_EVENT) โ $0.01 per command, no cap. A single play action costs $0.01. Bulk operations (e.g. multi-room control) scale linearly. You only pay for what you actually run.
๐ License
MIT โ use freely, modify, self-host.