Extracting Track Data from Homey

Hi everyone,

I’m new to SharpTools and I’m trying to get some help with extracting track data from Homey to display in a dashboard. First off, I just want to say, I’m really impressed with how powerful SharpTools is – great work by the developers!

Now onto my issue – I’m pulling track data from Homey into SharpTools, and the format looks something like this:

{“title”:“Feel Good Inc.”,“album”:“Demon Days”,“artist”:“Gorillaz”}

What I’d like to do is extract, for example, just the title to display it separately in a tile. I’ve been trying to use expressions in SharpTools, but I can’t seem to get it to work. I’m sure I’m missing something simple, but I’m still getting used to how expressions work in SharpTools and am not good at coding.

If anyone has some tips or ideas, I’d really appreciate the help!

Thanks in advance!

Never mind, solved the issue using the parseJson() function in the rule engine.

For anyone struggling with the same issue:

Set up a rule engine triggered by updates to the audioTrackData from the device.

Action 1: set one variable to store the trackdata
Action 2: use expression to extract the title from the JSON:parseJson($trackdata).title and store it in variable

1 Like