Hi everyone,
I'm pretty sure this is really trivial, but I can't seem to figure it out.
I'm trying to get the albumid for the currently playing spotify album. For that I set up a General Broadcast trigger for the action com.spotify.music.metadatachanged.
I know from a tasker profile that the albumid is available from the broadcast, I'm simply trying something like this for the intent extras field:
albumid=getString("albumid")
But I don't know the name of the value for albumid, so I want to get everything that is in the broadcast.
I'm attaching the working tasker profile as well, maybe that is helpful.
Hopefully someone can point my in the right direction on how to do that.
How do I access all intent extras of a specific broadcast
Moderator: Martin
-
- Posts: 6
- Joined: 24 Dec 2015 15:33
How do I access all intent extras of a specific broadcast
- Attachments
-
- Spotify_Song_Changed.prf.xml
- Tasker profile
- (3.21 KiB) Downloaded 833 times
Re: How do I access all intent extras of a specific broadcas
Hi,
The names of the extras are case sensitive. You should get the value with getString("albumId").
Here's the list of extras that seem to be available:
Some of the values are documented on this page:
https://developer.spotify.com/technolog ... fications/
Ensure that Device Broadcast Status in the settings of Spotify is enabled, otherwise Spotify does not send the broadcast.
I add the Spotify intents to the list of examples in Automagic since this might be of interest to others as well.
Regards,
Martin
The names of the extras are case sensitive. You should get the value with getString("albumId").
Here's the list of extras that seem to be available:
Code: Select all
timeSent = getLong("timeSent", -1);
duration = getLong("duration", -1);
artist = getString("artist");
length = getInt("length", -1);
albumId = getString("albumId");
playbackPosition = getInt("playbackPosition", -1);
id = getString("id");
album = getString("album");
track = getString("track");
position = getLong("position", -1);
https://developer.spotify.com/technolog ... fications/
Ensure that Device Broadcast Status in the settings of Spotify is enabled, otherwise Spotify does not send the broadcast.
I add the Spotify intents to the list of examples in Automagic since this might be of interest to others as well.
Regards,
Martin
-
- Posts: 6
- Joined: 24 Dec 2015 15:33
Re: How do I access all intent extras of a specific broadcas
Oh man, so close, yet so far away
Thanks very much, this was exactly what I needed!
I'm not sure if you're aware of that, but automagic is playing a major role for some people in an open source home automation system called fhem.
You can read about it here.
http://www.fhemwiki.de/wiki/AMAD
I'm using this to get the album art and display it on my wall mounted tablet amongst other things.
Thanks very much, this was exactly what I needed!
I'm not sure if you're aware of that, but automagic is playing a major role for some people in an open source home automation system called fhem.
You can read about it here.
http://www.fhemwiki.de/wiki/AMAD
I'm using this to get the album art and display it on my wall mounted tablet amongst other things.
Re: How do I access all intent extras of a specific broadcas
Thanks for the link. I was aware that Automagic is used with FHEM. Unfortunately I did not yet find the time to install FHEM myself.