SmartApps Monthly Challenge!

I was able to get the Beats Per Minute (BPM) via a smartapp that subscribes to the Sonos device type.

Sonos doesn’t return it, so I had to go look it up.

Was also able to get a lot of other cool things about the track, like danceability, acousticness and liveness ratings of each track along with tempo.

Ultimately, its what to do with this data per track that I am at a loss. ST really sucks at flashing lights at a frequency…

The other issue is I am using an industry inside server that isn’t free for general use, so to release it, it will cost me money to do it publicly.

Since I really can’t make money off this, ST would have to be willing to pay the licensing fee for access to the data… Doubt that will happen.

Was originally going to use a decibel meter and log the peaks and valleys over time and return that, but ultimately, ST can’t log that fast…

1 Like

Yeah, that’s always going to be the problem–most of SmartThings is not set up for real time monitoring.

On the other hand, you ought to be able to do a DJ mood shift thing where you decide in advance what tracks you’re going to play, you know how long they’re going to last, you put a few pauses in and you do light control during the “intermissions” so you don’t have to be exact to the second. Play a block of 3 songs with one mood, intermission and the lights change, play a new block of songs with a new mood, etc. Use some ramp up, ramp down effects which again don’t have to be perfectly in synch.

Could be fun and impressive as a party effect without having to keep things right to the beat. But it would all be preplanned, not responsive.

You could get the album cover art for the current track from an API like Last.fm or iTunes Store and run it through Pictaculous to get the colors that go with the cover art. Then use those colors on your color lights. I don’t have any color lights to test with but something along those lines might work if anybody has time to play with that. Just a thought.

And now phase 2, to “thingify” the DJ app so it’s not something you could do with just a smartphone…

Get two United Security Pressure Mats, wired to a door sensor as discussed in the following topic:

Make stepping on one turn on slow music with the associated lights. Make stepping on the other one turn on fast music with that mood lighting.

Now you got a DJ kit you can pull out for parties and show off your dance moves as well as your smart home. :microphone: :musical_note: :bulb:

1 Like

Ironically, while listening to the dev call, I hooked up my BPM smartApp to my lights and set the light level based on the BPM, danceability, acousticness and liveness as a weighted average to map to light level…

The higher the average, the brighter the lights.

So a slow, undanceble, live song, the lights are almost down (think Marvin Gaye Lets Get it on / the righteous brothers you’ve lost that loving feeling)

and a fast paced, dance track the lights are almost at full blast…

Google Play, I’m feeling lucky, through sonos, ST mood lighting based on the tracks. Modern day mood ring.

5 Likes

sounds like we just found our first winner… is it still using the commercial API?

It looks like that same info for tracks is available from Echo Nest which is free for non-commercial use. Is that what you are using @pstuart?

I like their statement on commercial use. :smile:

Do not use the API or feeds for commercial use without talking to us. - The Echo Nest’s API is free for non-commercial purposes. To use them commercially, talk to us and we will go over the licensing options. In either case, we request that you give us proper branding and attribution when using our data. If you are a lone developer selling advertising that is barely covering your running costs, we consider that non-commercial. If you are a company writing paychecks, making plenty of money or driving a venture-capital-purchased MacBook Pro, you’re probably commercial. For commercial use, we have standard terms & conditions that we can share with you. We want to be flexible and support many uses of the platform, so just contact us at biz@echonest.com if you have any questions about whether your use is commercial.

My problem exactly. 20 chars

1 Like

Yes this is one of the api’s i hooked up to…

Debated on releasing a version that requirsa each user to register and get their own api key.

Still trying another source that has the same data, what radio stations use for the track meta data.

Also trying to enhance this with direct calls to sonos to get more info on current playing and next playing.

Frustrating trying to get good track info reliable from other music sources.

@April
Any chance of a Device Handler contest??

Best new device type for the item below??

http://images.staples-3p.com/s7/is/image/Staples/s0793743_sc7?wid=600&hei=600&wid=600&hei=600

The Aeon Labs Power Strip DCS11-ZWUS

Once a new device is supported by Smartthings the Smart App’s will follow on their own :sunglasses:

2 Likes

There is a badge for device handler codeslinger… :stuck_out_tongue: So I guess so

PS: When does this challenge start?

@April
Any thought of this monthly challenge which the community would submit a really cool device type for the Aeon Labs Power Strip that is presently not on the internal Smarttings roadmap to be officially supported?

Aeon Labs Aeotec Z-Wave Smart Energy Power Strip (DSC11-ZWUS) 

Aeon Labs
$89.99

Haha, that would be really cool : Though, I know we’re still working on approving a backlog of device types too! :slight_smile:
Certainly think I need to go back to the drawing board first though. Now that Kris has joined the team, and is approving smartapps, we can certainly rev up these contests a bit more. However, at the mean time, we gotta clear our queue of DT and SA. :slight_smile:

1 Like