{"id":"AudioGetItem","jsonrpc":"2.0","result":{"item":{"album":"","artist":["BBC Radio 4 Ex"],"duration":4200,"fanart":"","id":21,"label":"BBC Radio 4 Ex","thumbnail":"","title":"What Happened, Miss Simone?","type":"channel"}}}
This query
result.item.title;
The output is
["What Happened, Miss Simone?"]
So I guess I'm looking for a way to strip out the [] and "" parts.
I seem to remember you saying previously that the HTTP command isn't great at handling multiple tags.
So is the following possible?
Can the full text from a http / Json query be pushed into a custom sensor, so that a rule could strip out the various elements and push them into different in-memory commands ?
For example, the Audio status query from Kodi returns things like this :-
{"id":"AudioGetItem","jsonrpc":"2.0","result":{"item":{"album":"","artist":[],"duration":0,"fanart":"","file":"http://radio.virginradio.co.uk/stream","label":"Now Playing: Take Your Mama - Scissor Sisters","thumbnail":"","title":"Now Playing: Take Your Mama - Scissor Sisters","type":"song"}}}
Can a rule strip out the :
thumbnail URL - for use in a webview
fanart URL - for use in a Webview
label, title, artist & album - for use in UI labels?
Sure you can. I'm doing this all the time, especially when a protocol is a bit more complicated - think about OAuth2, more than a single param, dynamic query, etc. I was even able to implement non trivial Smappee cloud protocol purely by rules. Didn't used even the HTTP protocol but shell exec with curl. You can look at these rules in wiki under Smappee integration.