IoT button - need help with hardware selection

I listen to spotify while I wash the dishes - only thing that keeps me sane!
But, my hands are too soapy to control playback on my phone.

I was going to build a custom button board with volume control, skip AND ADD TO PLAYLIST.
I listen to random songs, and would like a way to tag songs for review.
I think the easiest will be to add them to a custom playlist.

I built a proof of concept using Node-RED on a Raspberry Pi, and discovered that volume control is handed off to the playback device (if it is a phone) and therefore cannot be included in my custom button board.

At this point, I bought a bluetooth button and can now control playback and volume since it simply pairs with my phone.

I really, really, really want the add to playlist functionality.
It seems like it has to be done via API, as there is no bluetooth shortcut for it.

The Spotify API: https://developer.spotify.com/console/post-playlist-tracks/
A candidate button: https://shop.espruino.com/puckjslite

Thoughts?

1 Like

I mean… not to be a jerk, but it sounds like what you need is a little google home… they have small ones that are pretty cheap and will do all of what you want and then some.

To do it your way, I see two challenges: 1) Finding the current playing song, maybe this helps, and 2) adding it to playlist, which is trivial since the playlist id is easy to get (“share” an album and catch that first weird ID in the share link). Then you only need something that runs that script which I guess could be triggered from a button.

Sorry Brendon, I agree with Amit on this one, you should had thoung if you should built it before thinking you could built it :smiley:

At this point, turn your bluetooth button in an “Ok Google” or “Alexa!” button to summon your favourite digital overlord assistant…

I definitely will support the privacy fight :slight_smile:

I have written a spotify web app that adds your current playing to a set spotify playlist. All you need is to hit a particular url from your button. Happy to share the code or just add your spotify account to my app preview account. They won’t approve apps for just a couple users.

Thanks for the “new” direction to think about this. I would press on with building something just for the fun/learning, but in this instance, I want something that “just works”.

I have managed to use Google Assistant to add the currently playing song to favourites, but not to a custom playlist. Not perfect, but good enough.

I previously gave up on Google assistant because I had to unlock my phone and then long press a hardware button. I guess things have moved along now, as I can just activate it from my buds. Probably going to end up with a soapy, greasy ear, but that is a small price to pay. My button doesn’t seem to have a way to trigger Google Assistant.

Kyle, I’ll chat with you in the space next time I see you. Code and hardware might be worth exploring.

I would just grab a https://www.seeedstudio.com/Seeed-IoT-Button-for-AWS-p-4527.html for $20 and then do one click play/pause, double click add to playlist. You would use AWS lambda functions but the first million button presses each month are free :slight_smile: Lower power consumption, rechargeable battery.

1 Like

I don’t use Google Assistant but I imagine you can command it to visit a bookmark or something similar. That could visit the url I’ve created to add current song to a particular playlist.

Good thought Kyle. Let’s avoid the corporate overlords by using an AWS service :stuck_out_tongue:

1 Like

More of a privacy thing but point taken :slight_smile:

I’m gonna just throw in my 2 cents. Google home and Alexa are pretty toxic imo, and I don’t really want to have my conversations harvested for analysis just in order to add songs to playlists. Also, tactile buttons good, shouting at Alexa over the sound of washing dishes not so good.

IoT button is a pretty good shout, I have one kicking around somewhere in the office. They’re pretty slow, and iirc the app you used to onboard them was kinda crappy. Also looking at the api docs you linked it’s not going to be just that one call, since you need to know the uuid for the song you wanna add. I guess the flow would be the get currently playing track endpoint first, then the add to playlist one.

I guess my other suggestion would be use a lambda but don’t bother with the iot button, just use an esp32 with a little lipo battery, a 3d printed enclosure, and an MX style switch. Then just trigger the lambda over https from the esp32. I’m sure I’ve got a spare qt py and a little lipo, and I’ve got switches for days if you wanna try that out.

2 Likes