Changes

no edit summary
Line 1: Line 1: −
===<p><b>When is this trigger activated?</b></p>===
+
<pre class="header-style">This trigger will fire when various Spotify events occur. In order for this trigger to function, you must enable the "Device Broadcast Status" option within the Spotify app's settings page.</pre>
   −
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
''' Options '''
Triggered when Spotify events occur.</pre>
     −
===<p><b>Magic Text</b></p>===
+
* '''Playback Started''' - The trigger fires when music playback begins in Spotify
 +
* '''Playback Stopped''' - The trigger fires when music playback stops or is paused in Spotify
 +
* '''Song Changed''' - The trigger fires when the currently playing track changes
   −
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
''' Requirements '''
This action supports the use of magic text, you can use extracting it from some previously defined variable, using the (...) button.
  −
It also has magic output text [spotify_track_id], [spotify_artist], [spotify_album], [spotify_track], [spotify_length_s], [spotify_is_playing] </pre>
  −
* ''''' [https://macrodroidforum.com/wiki/index.php/Magic_text#Spotify Spotify magic text] '''''
  −
<br>
     −
===<p><b>Supported configurations</b></p>===
+
* Spotify app must be installed
 +
* "Device Broadcast Status" must be enabled in Spotify app settings
   −
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
''' Enabling Device Broadcast Status '''
* Playback started - Starts when spotify starts playing.
  −
* Playback stopped - Starts when Spotify pauses or stops playback.
  −
* Song changed - Starts when any playback changes.
  −
</pre><br>
     −
===<p><b>Example</b></p>===
+
To enable broadcasting in Spotify:
 +
# Open the Spotify app
 +
# Go to Settings (gear icon)
 +
# Scroll down to find "Device Broadcast Status"
 +
# Enable the option
   −
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
Without this setting enabled, the trigger will not receive any events from Spotify.
Speak the name of the next song only when the screen is off.
  −
</pre><br>
     −
<pre style="background-color: #AC2424; color: white; border-radius: 10px; padding: 10px;">
+
''' Magic Text Variables '''
Triggers
     −
Spotify (Song changed)
+
When this trigger fires, Spotify-specific Magic Text values is available:
</pre><br>
  −
<pre style="background-color: #1665B0; color: white; border-radius: 10px; padding: 10px;">
  −
Actions
     −
Speak text
+
{spotify_track_id}, {spotify_artist}, {spotify_album}, {spotify_track}, {spotify_track_length_s}, {spotify_is_playing}
‘[
  −
{spotify_track} - {spotify_artist}
  −
</pre><br>
  −
<pre style="background-color: green; color: white; border-radius: 10px; padding: 10px;">
  −
Constraints
     −
Screen off
+
''' Examples '''
</pre><br>
+
 
 +
'''Example 1: Music mode'''
 +
 
 +
Enable music-friendly settings when Spotify starts playing:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Spotify: Playback Started</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Media Volume: 70%
 +
Do Not Disturb: Enable (Allow media sounds)
 +
Display Notification: "Spotify playing - DND enabled"</pre>
 +
 
 +
'''Example 2: Restore settings on stop'''
 +
 
 +
Restore normal settings when music stops:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Spotify: Playback Stopped</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Do Not Disturb: Disable
 +
Media Volume: 50%</pre>
 +
 
 +
'''Example 3: Track change logging'''
 +
 
 +
Show current artist and track as floating text:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Spotify: Song Changed</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Floating Text: "{spotify-artist} - {spotify_track}"</pre>
 +
 
 +
''' Notes '''
 +
 
 +
* If Spotify is not installed, a warning will be displayed when configuring this trigger with a link to install it
 +
* The trigger listens for Spotify-specific broadcast intents: playbackstatechanged, metadatachanged, and queuechanged
 +
* The "Device Broadcast Status" setting in Spotify controls whether these broadcasts are sent
 +
* This trigger only works with the official Spotify app, not Spotify Lite or web player
 +
* Some metadata may not be available depending on Spotify's current broadcast implementation
 +
 
 +
''' See Also '''
 +
 
 +
* [[Trigger:_Media_Button_Pressed|Media Button Pressed]]
 +
* [[Action:_Control_Media|Control Media Action]]
 +
* [[Constraint:_Music_Active|Music Active Constraint]]