-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroon.json
238 lines (237 loc) · 28.2 KB
/
roon.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
{ "name":"Roon Player",
"manufacturer":"Roon",
"type":"AUDIO",
"version":16,
"persistedvariables":{
"ToInitiate":false
},
"discover":{
"welcomeheadertext":"Roon Media Player",
"welcomedescription":"powered by meta\nby JAC459",
"command": {"type":"http-get", "command":"http://$MetaIP:1880/roon/discover", "queryresult":"$.zones.*"}
},
"template" : {
"dynamicname":"DYNAMIK_INST_START DYNAMIK \"Roon - \" + JSON.parse(\"$Result\").display_name DYNAMIK_INST_END",
"dynamicid":"DYNAMIK_INST_START DYNAMIK JSON.parse(\"$Result\").zone_id DYNAMIK_INST_END",
"variables":{
"MyCurrentZone":"DYNAMIK_INST_START DYNAMIK let dz = JSON.stringify(\"$Result\"); dz.substring(1, dz.length-1) DYNAMIK_INST_END",
"MyPreviousZone":"",
"MyChosenZone":"",
"MyZones":"",
"ZoneId":"DYNAMIK_INST_START DYNAMIK JSON.parse(\"$Result\").zone_id DYNAMIK_INST_END",
"Output":"DYNAMIK_INST_START DYNAMIK let op = JSON.stringify(JSON.stringify(JSON.parse(\"$Result\").outputs[0])); op.substring(1, op.length-1) DYNAMIK_INST_END",
"VolumePlayed":"",
"Muted":false,
"NodeRedIP":"$MetaIP",
"Playing":"",
"Queues":[],
"QueueId":"",
"Duration":"",
"Progress":"",
"Search":"[\" \", \".\", \"?\", \",\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"-\", \"+\", \"=\", \"{\", \"}\", \"[\", \"]\", \"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"]",
"Token":"",
"Collection":"",
"AlbumCoverURI":"",
"ArtistCoverURI":"",
"BaseImageURL":"https://raw.githubusercontent.com/jac459/meta-roon/main/pics/",
"Level1Pic":"",
"Level2Pic":"",
"Level3Pic":"",
"Level4Pic":"",
"Level5Pic":"",
"Level6Pic":"",
"Level7Pic":"",
"LevelActionPic":"",
"MyListItem":"",
"MyState":"",
"MyStatus":""
},
"images": {
"AlbumCover": {
"label": "",
"size": "large",
"listen": "AlbumCoverURI"
}
},
"listeners": {
"roonStatus": {
"type": "mqtt",
"command": "meta/roon/status",
"queryresult": "",
"evalwrite": [
{
"variable": "MyStatus",
"value": "DYNAMIK let res = JSON.parse(\"$Result\"); if (res.Volume && (res.Volume.Output.output_id == $Output.output_id)) {let vol = $VolumePlayed; if (!$Muted) {'||'.repeat(vol) + '--'.repeat(Math.round((100-vol)/3))} else {'.'.repeat(vol) + '--'.repeat(Math.round((100-vol)/3))} };"
}
]
},
"roonQueue": {
"type": "mqtt",
"command": "meta/roon/queue",
"queryresult": "",
"evalwrite": [
{
"variable": "Queues",
"value": "$Result"
}
]
},
"roonState": {
"type": "mqtt",
"command": "meta/roon/state",
"queryresult": "$.zones.*",
"evalwrite": [
{
"variable": "MyZones",
"value": "$Result"
},
{
"variable": "MyCurrentZone",
"value": "DYNAMIK let cz = JSON.stringify(JSON.parse(\"$Result\").find((zn) => {return zn.zone_id == \"$ZoneId\"})); if (cz) { cz; } else { cz = JSON.stringify($MyCurrentZone); cz; }"
},
{
"variable": "Output",
"value": "DYNAMIK let outs = $MyCurrentZone.outputs; let out = JSON.stringify(outs.find((ot) => {return ot.output_id == $Output.output_id})); out;"
},
{
"variable": "MyState",
"value": "DYNAMIK if ($MyCurrentZone.now_playing) {let cz = $MyCurrentZone.state + \" - \" + $MyCurrentZone.now_playing.one_line.line1; cz;} else {\"Zone is not playing.\"}"
},
{
"variable": "Playing",
"value": "DYNAMIK let p = $MyCurrentZone.state; p == \"playing\";"
},
{
"variable": "VolumePlayed",
"value": "DYNAMIK let op = $Output; let vol = Math.round(100*(op.volume.value-op.volume.min)/(op.volume.max-op.volume.min));vol;"
},
{
"variable": "Muted",
"value": "DYNAMIK let op = $Output; let mut = op.volume.is_muted;mut;"
},
{
"variable": "Duration",
"value": "DYNAMIK let dur = $MyCurrentZone.now_playing.length; dur;"
},
{
"variable": "AlbumCoverURI",
"value": "DYNAMIK let uri = \"http://$NodeRedIP:1880/roon/image?image_key=\" + $MyCurrentZone.now_playing.image_key; uri;"
},
{
"variable": "Progress",
"value": "DYNAMIK let prog = $MyCurrentZone.now_playing.seek_position/$MyCurrentZone.now_playing.length; Math.round(prog*100);"
}
]
}
},
"labels":{
"CurrentStatus" : {"label":".", "actionlisten":"MyStatus", "listen":"MyState"}
},
"buttons":{
"VOLUME UP": {"label":"", "type":"static", "command":"", "evalwrite":[{"variable":"VolumePlayed","value":"DYNAMIK (Number($VolumePlayed)<95)?Number($VolumePlayed)+5:100"}], "evaldo":[{"test":true, "then":"__VOLUMESET", "or":""}]},
"VOLUME DOWN": {"label":"", "type":"static", "command":"", "evalwrite":[{"variable":"VolumePlayed","value":"DYNAMIK (Number($VolumePlayed)>5)?Number($VolumePlayed)-5:0"}], "evaldo":[{"test":true, "then":"__VOLUMESET", "or":""}]},
"MUTE TOGGLE": {"label":"", "type":"static", "command":"", "evaldo":[{"test":true, "then":"__MUTESET", "or":""}]},
"POWER ON": {"label":"", "type":"static", "command":"", "evaldo":[{"test":true,"then":"__INITIALISE", "or":""}]},
"POWER OFF": {"label":"", "type":"static", "command":"", "evaldo":[{"test":true,"then":"__CLEANUP", "or":""}]},
"CURSOR UP": {"label":"", "type":"static", "command":"", "evaldo":[{"test":true,"then":"PLAY", "or":""}]},
"CURSOR LEFT": {"label":"", "type":"static", "command":"", "evaldo":[{"test":true,"then":"PREVIOUS", "or":""}]},
"CURSOR RIGHT": {"label":"", "type":"static", "command":"", "evaldo":[{"test":true,"then":"NEXT", "or":""}]},
"CURSOR DOWN": {"label":"", "type":"static", "command":"", "evaldo":[{"test":true,"then":"STOP", "or":""}]},
"CURSOR ENTER": {"label":"", "type":"static", "command":"", "evaldo":[{"test":true,"then":"PLAY TOGGLE", "or":""}]},
"PLAY": {"label":"", "type":"mqtt", "command":"DYNAMIK let dz = JSON.stringify(JSON.stringify($MyCurrentZone));\"{\\\"topic\\\":\\\"meta/roon\\\", \\\"message\\\":\\\"{\\\\\\\"transport\\\\\\\":{\\\\\\\"zone\\\\\\\":\" + dz.substring(1, dz.length-1) + \", \\\\\\\"control\\\\\\\":\\\\\\\"play\\\\\\\"}}\\\"}\""},
"PLAY TOGGLE": {"label":"", "type":"mqtt", "command":"DYNAMIK let dz = JSON.stringify(JSON.stringify($MyCurrentZone));\"{\\\"topic\\\":\\\"meta/roon\\\", \\\"message\\\":\\\"{\\\\\\\"transport\\\\\\\":{\\\\\\\"zone\\\\\\\":\" + dz.substring(1, dz.length-1) + \", \\\\\\\"control\\\\\\\":\\\\\\\"playpause\\\\\\\"}}\\\"}\""},
"PAUSE": {"label":"", "type":"mqtt", "command":"DYNAMIK let dz = JSON.stringify(JSON.stringify($MyCurrentZone));\"{\\\"topic\\\":\\\"meta/roon\\\", \\\"message\\\":\\\"{\\\\\\\"transport\\\\\\\":{\\\\\\\"zone\\\\\\\":\" + dz.substring(1, dz.length-1) + \", \\\\\\\"control\\\\\\\":\\\\\\\"pause\\\\\\\"}}\\\"}\""},
"STOP": {"label":"", "type":"mqtt", "command":"DYNAMIK let dz = JSON.stringify(JSON.stringify($MyCurrentZone));\"{\\\"topic\\\":\\\"meta/roon\\\", \\\"message\\\":\\\"{\\\\\\\"transport\\\\\\\":{\\\\\\\"zone\\\\\\\":\" + dz.substring(1, dz.length-1) + \", \\\\\\\"control\\\\\\\":\\\\\\\"stop\\\\\\\"}}\\\"}\""},
"PREVIOUS": {"label":"", "type":"mqtt", "command":"DYNAMIK let dz = JSON.stringify(JSON.stringify($MyCurrentZone));\"{\\\"topic\\\":\\\"meta/roon\\\", \\\"message\\\":\\\"{\\\\\\\"transport\\\\\\\":{\\\\\\\"zone\\\\\\\":\" + dz.substring(1, dz.length-1) + \", \\\\\\\"control\\\\\\\":\\\\\\\"previous\\\\\\\"}}\\\"}\""},
"NEXT": {"label":"", "type":"mqtt", "command":"DYNAMIK let dz = JSON.stringify(JSON.stringify($MyCurrentZone));\"{\\\"topic\\\":\\\"meta/roon\\\", \\\"message\\\":\\\"{\\\\\\\"transport\\\\\\\":{\\\\\\\"zone\\\\\\\":\" + dz.substring(1, dz.length-1) + \", \\\\\\\"control\\\\\\\":\\\\\\\"next\\\\\\\"}}\\\"}\""},
"__FETCHCOLLECTION": {"type":"http-get", "command":"http://$NodeRedIP:1880/roon/browse?browse={\"hierarchy\":\"browse\",\"multi_session_key\":\"$ZoneId\", \"count\":10000, \"level\":2,\"item_key\":\"$MyListItem\"}", "queryresult":"", "evalwrite":[{"variable":"Collection","value":"$Result"}]},
"__PING_STATE": {"label":"", "type":"mqtt", "command":"{\"topic\":\"meta/roon\", \"message\":\"{\\\"state\\\":true}\"}"},
"__VOLUMESET": {"label":"", "type":"mqtt", "command":"DYNAMIK let op = $Output; let vol = Math.round($VolumePlayed/100*(op.volume.max-op.volume.min) + op.volume.min); let mess ={\"transport\":{\"output\":op, \"volume\":{\"value\":vol}}}; let toSend = {\"topic\":\"meta/roon\", \"message\":\"\"}; toSend.message = mess; toSend;"},
"__MUTESET": {"label":"", "type":"mqtt", "command":"DYNAMIK let op = $Output; let mess ={\"transport\":{\"output\":op, \"volume\":{\"is_muted\":$Muted}}}; let toSend = {\"topic\":\"meta/roon\", \"message\":\"\"}; toSend.message = mess; toSend;"},
"__PROGRESSSET": {"label":"", "type":"mqtt", "command":"DYNAMIK let prog = Math.round($MyCurrentZone.now_playing.length/100*$Progress);let cz = $MyCurrentZone; let mes = {\"transport\":{\"zone\":\"\", \"seek\":prog}}; mes.transport.zone = cz; let fullMess = {\"topic\":\"meta/roon\", \"message\":\"\"};fullMess.message = mes; fullMess"}
},
"sliders":{
"PROGRESS": {"label":"", "unit" : "%", "listen" : "Progress", "evaldo":[{"test":true, "then":"__PROGRESSSET", "or":""}]},
"VOLUME": {"label":"", "unit" : "db", "listen" : "VolumePlayed", "evaldo":[{"test":true, "then":"__VOLUMESET", "or":""}]}
},
"directories":{
"Outputs": {"label":"",
"feeders": {
"Outputs":{"label":"", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"", "itemUI":"","itemimage":"$BaseImageURLoutput.jpg"},
{"type":"static", "command":[{"name":"Outputs"}], "itemtype":"button", "itemUI":false, "queryresult":"$.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").name"},
{"type":"static", "command":"$MyCurrentZone", "queryresult":"$.outputs.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").display_name", "itemlabel":"Zone Output", "itemUI":"reload", "itemaction":"", "itemimage":"DYNAMIK if (JSON.parse(\"$Result\").output_id == $Output.output_id) {\"$BaseImageURLselected.jpg\";} else {\"$BaseImageURLunselected.jpg\";}", "evalwrite":[{"variable":"Output","value":"$Result"}, {"variable":"VolumePlayed","value":"DYNAMIK let op = $Output; let vol = Math.round(100*(op.volume.value-op.volume.min)/(op.volume.max-op.volume.min));vol;"}, {"variable":"Muted","value":"DYNAMIK let op = $Output; let mut = op.volume.is_muted;mut;"}]},
{"type":"static", "command":[{"name":"Zones"}], "itemtype":"button", "itemUI":false, "queryresult":"$.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").name"},
{"type":"static", "command":"$MyZones", "queryresult":"$.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").display_name", "itemlabel":"Zone", "itemUI":"reload", "itemaction":"ZoneSet", "itemimage":"DYNAMIK if (JSON.parse(\"$Result\").zone_id == $MyCurrentZone.zone_id) {\"$BaseImageURLselected.jpg\";} else {\"$BaseImageURLunselected.jpg\";}", "evalwrite":[{"variable":"MyPreviousZone","value":"$MyCurrentZone"}, {"variable":"MyCurrentZone","value":"$Result"}]}
]},
"ZoneSet":{"label":"", "commandset": [{"type":"mqtt", "command":"DYNAMIK let cz = $MyPreviousZone; let nz = $MyCurrentZone; let mess ={\"transport\":{\"sourceZone\":cz, \"destinationZone\":nz}}; let toSend = {\"topic\":\"meta/roon\", \"message\":\"\"}; toSend.message = mess; toSend;", "evalwrite":[{"variable":"ZoneId","value":"DYNAMIK let zi = $MyCurrentZone.zone_id; zi"}, {"variable":"Output","value":"DYNAMIK JSON.stringify($MyCurrentZone.outputs[0])"}]}]}
}
},
"Queue": {"label":"",
"feeders": {
"Queue": {"label":"Queue list", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"", "itemUI":"","itemimage":"$BaseImageURLqueues.jpg"},
{"type":"http-get", "command":"http://$NodeRedIP:1880/roon/queue?queue={\"zoneId\":\"$ZoneId\"}", "queryresult":"$.queue.changes[1].items.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").two_line.line1", "itemlabel":"DYNAMIK JSON.parse(\"$Result\").two_line.line2", "itemimage":"DYNAMIK \"http://$NodeRedIP:1880/roon/image?image_key=\" + JSON.parse(\"$Result\").image_key", "itemaction": "Action", "evalwrite":[{"variable":"QueueId","value":"DYNAMIK JSON.parse(\"$Result\").queue_item_id"}]}
]},
"Action":{"label":"Action", "commandset": [
{"type":"mqtt", "command":"DYNAMIK let cz = $MyCurrentZone; let mes = {\"transport\":{\"playQueue\":true, \"queueId\":$QueueId}}; mes.transport.zone = cz; let fullMess = {\"topic\":\"meta/roon\", \"message\":\"\"};fullMess.message = mes; fullMess"}
]}
}
},
"Browse": {"label":"",
"feeders": {
"Browse1":{"label":"Browse", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"", "itemUI":"","itemimage":"$BaseImageURLROON.jpg"},
{"type":"http-get", "command":"http://$NodeRedIP:1880/roon/browse?browse={\"hierarchy\":\"browse\",\"multi_session_key\":\"$ZoneId\", \"count\":10000, \"level\":0,\"item_key\":\"$MyListItem\"}", "queryresult":"$.items.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").title", "itemlabel":"DYNAMIK JSON.parse(\"$Result\").subtitle", "itemimage":"DYNAMIK let title = JSON.parse(\"$Result\").title; let url; if (title == \"Library\") {url = \"library.jpg\"};if (title == \"Settings\") {url = \"settings.jpg\"};if (title == \"TIDAL\") {url = \"myTidal.jpg\"};if (title == \"Genres\") {url = \"genres.jpg\"};if (title == \"My Live Radio\") {url = \"radio.jpg\"};if (title == \"Playlists\") {url = \"fav.png\"}; \"$BaseImageURL\" + url;", "itemaction": "DYNAMIK (JSON.parse(\"$Result\").hint == \"action\")?\"Action\":undefined", "evalnext":[{"test":true, "then":"Browse2", "or":""}], "evalwrite":[{"variable":"MyListItem","value":"DYNAMIK JSON.parse(\"$Result\").item_key"}, {"variable":"Level1Pic","value":"DYNAMIK let title = JSON.parse(\"$Result\").title; let url; if (title == \"Library\") {url = \"library.jpg\"};if (title == \"Settings\") {url = \"settings.jpg\"};if (title == \"TIDAL\") {url = \"myTidal.jpg\"};if (title == \"Genres\") {url = \"genres.jpg\"};if (title == \"My Live Radio\") {url = \"radio.jpg\"};if (title == \"Playlists\") {url = \"fav.png\"}; \"$BaseImageURL\" + url;"}]}
]},
"Browse2":{"label":"Browse", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"", "itemUI":"","itemimage":"$Level1Pic"},
{"type":"http-get", "command":"http://$NodeRedIP:1880/roon/browse?browse={\"hierarchy\":\"browse\",\"multi_session_key\":\"$ZoneId\", \"count\":10000, \"level\":1,\"item_key\":\"$MyListItem\"}", "queryresult":"$.items[?(@.title!='Search'&&@.title!='Tags'&&@.title!='Search TIDAL')]", "itemname":"DYNAMIK JSON.parse(\"$Result\").title", "itemlabel":"DYNAMIK JSON.parse(\"$Result\").subtitle", "itemimage":"DYNAMIK let title = JSON.parse(\"$Result\").title; let url; if (title == \"Artists\") {url = \"artist.jpg\"};if (title == \"Albums\") {url = \"record.jpg\"};if (title == \"Tracks\") {url = \"wave.jpg\"};if (title == \"Composers\") {url = \"compose.jpg\"}; if (url) {\"$BaseImageURL\" + url} else {\"$Level1Pic\"};", "itemaction": "DYNAMIK (JSON.parse(\"$Result\").hint == \"action\")?\"Action\":undefined", "evalnext":[{"test":"DYNAMIK JSON.parse(\"$Result\").hint == \"list\"", "then":"Browse3", "or":"Actions"}], "evalwrite":[{"variable":"MyListItem","value":"DYNAMIK JSON.parse(\"$Result\").item_key"},{"variable":"Level2Pic","value":"DYNAMIK let title = JSON.parse(\"$Result\").title; let url; if (title == \"Artists\") {url = \"artist.jpg\"};if (title == \"Albums\") {url = \"record.jpg\"};if (title == \"Tracks\") {url = \"wave.jpg\"};if (title == \"Composers\") {url = \"compose.jpg\"}; if (url) {\"$BaseImageURL\" + url} else {\"$Level1Pic\"};"}], "evaldo":[{"test":true, "then":"__FETCHCOLLECTION", "or":""}]}
]},
"Browse3":{"label":"Browse", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"", "itemUI":"","itemimage":"$Level2Pic"},
{"type":"static", "command":".", "itemname":"Search","itemlabel":"Search Collection", "itemaction":"", "itemUI":"","itemimage":"$BaseImageURLsearch.jpg", "evalwrite":[{"variable":"Token","value":""}], "evalnext":[{"test":true, "then":"BrowseSearch"}]},
{"type":"http-get", "command":"http://$NodeRedIP:1880/roon/browse?browse={\"hierarchy\":\"browse\",\"multi_session_key\":\"$ZoneId\", \"count\":10000, \"level\":2,\"item_key\":\"$MyListItem\"}", "queryresult":"$.items.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").title", "itemlabel":"DYNAMIK JSON.parse(\"$Result\").subtitle", "itemimage":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level2Pic\"}", "itemaction": "DYNAMIK (JSON.parse(\"$Result\").hint == \"action\")?\"Action\":undefined", "evalnext":[{"test":"DYNAMIK JSON.parse(\"$Result\").hint == \"list\"", "then":"Browse4", "or":"Actions"}], "evalwrite":[{"variable":"MyListItem","value":"DYNAMIK JSON.parse(\"$Result\").item_key"},{"variable":"Level3Pic","value":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level2Pic\"}"}, {"variable":"LevelActionPic","value":"$Level3Pic"}]}
]},
"Browse3filtered":{"label":"Browse", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"", "itemUI":"","itemimage":"$Level2Pic"},
{"type":"static", "command":".", "itemname":"Search","itemlabel":"Search Collection", "itemaction":"", "itemUI":"","itemimage":"$BaseImageURLsearch.jpg", "evalnext":[{"test":true, "then":"BrowseSearch"}]},
{"type":"static", "command":"DYNAMIK let col = $Collection.items; if (\"$Token\".length>0) {col = col.filter((colI) => {return colI.title.toUpperCase().startsWith(\"$Token\")})};col;", "queryresult":"$.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").title", "itemlabel":"DYNAMIK JSON.parse(\"$Result\").subtitle", "itemimage":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level2Pic\"}", "itemaction": "DYNAMIK (JSON.parse(\"$Result\").hint == \"action\")?\"Action\":undefined", "evalnext":[{"test":"DYNAMIK JSON.parse(\"$Result\").hint == \"list\"", "then":"Browse4", "or":"Actions"}], "evalwrite":[{"variable":"MyListItem","value":"DYNAMIK JSON.parse(\"$Result\").item_key"},{"variable":"Level3Pic","value":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level2Pic\"}"}, {"variable":"LevelActionPic","value":"$Level3Pic"}]}
]},
"BrowseSearch":{"label":"Browse", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"", "itemUI":"","itemimage":"$BaseImageURLsearch.jpg"},
{"type":"static", "command":"DYNAMIK let col = $Collection.items; if (\"$Token\".length>0) {col = col.filter((colI) => {return colI.title.toUpperCase().startsWith(\"$Token\")})}; let srh = $Search; let res = []; let tuple; srh.forEach((seI)=>{let filtok = \"$Token\" + seI;let interRes = col.filter((colI) => {return colI.title.toUpperCase().startsWith(filtok)}); if (interRes.length>0) {tuple = {\"title\":\"\"}; tuple.token = filtok; tuple.title = filtok + \" - \" + interRes.length + \" items.\"; tuple.subtitle = interRes[0].title + \" - \" + interRes[interRes.length -1].title; res.push(tuple)}});res;", "queryresult":"$.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").title", "itemlabel":"DYNAMIK JSON.parse(\"$Result\").subtitle", "itemimage":"$BaseImageURLsearch.jpg", "evalnext":[{"test":true, "then":"Browse3filtered", "or":""}], "evalwrite":[{"variable":"Token","value":"DYNAMIK JSON.parse(\"$Result\").token"}]}
]},
"Browse4":{"label":"Browse", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"", "itemUI":"","itemimage":"$Level3Pic"},
{"type":"http-get", "command":"http://$NodeRedIP:1880/roon/browse?browse={\"hierarchy\":\"browse\",\"multi_session_key\":\"$ZoneId\", \"count\":10000, \"level\":3,\"item_key\":\"$MyListItem\"}", "queryresult":"$.items.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").title", "itemlabel":"DYNAMIK JSON.parse(\"$Result\").subtitle", "itemimage":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level3Pic\"}", "itemaction": "DYNAMIK (JSON.parse(\"$Result\").hint == \"action\")?\"Action\":undefined", "evalnext":[{"test":"DYNAMIK JSON.parse(\"$Result\").hint == \"list\"", "then":"Browse5", "or":"Actions"}], "evalwrite":[{"variable":"MyListItem","value":"DYNAMIK JSON.parse(\"$Result\").item_key"},{"variable":"Level4Pic","value":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level3Pic\"}"}, {"variable":"LevelActionPic","value":"$Level4Pic"}]}
]},
"Browse5":{"label":"Browse", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"", "itemUI":"","itemimage":"$Level4Pic"},
{"type":"http-get", "command":"http://$NodeRedIP:1880/roon/browse?browse={\"hierarchy\":\"browse\",\"multi_session_key\":\"$ZoneId\", \"count\":10000, \"level\":4,\"item_key\":\"$MyListItem\"}", "queryresult":"$.items.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").title", "itemlabel":"DYNAMIK JSON.parse(\"$Result\").subtitle", "itemimage":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level4Pic\"}", "itemaction": "DYNAMIK (JSON.parse(\"$Result\").hint == \"action\")?\"Action\":undefined", "evalnext":[{"test":"DYNAMIK JSON.parse(\"$Result\").hint == \"list\"", "then":"Browse6", "or":"Actions"}], "evalwrite":[{"variable":"MyListItem","value":"DYNAMIK JSON.parse(\"$Result\").item_key"},{"variable":"Level5Pic","value":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level4Pic\"}"}, {"variable":"LevelActionPic","value":"$Level5Pic"}]}
]},
"Browse6":{"label":"Browse", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"", "itemUI":"","itemimage":"$Level5Pic"},
{"type":"http-get", "command":"http://$NodeRedIP:1880/roon/browse?browse={\"hierarchy\":\"browse\",\"multi_session_key\":\"$ZoneId\", \"count\":10000, \"level\":5,\"item_key\":\"$MyListItem\"}", "queryresult":"$.items.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").title", "itemlabel":"DYNAMIK JSON.parse(\"$Result\").subtitle", "itemimage":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level5Pic\"}", "itemaction": "DYNAMIK (JSON.parse(\"$Result\").hint == \"action\")?\"Action\":undefined", "evalnext":[{"test":"DYNAMIK JSON.parse(\"$Result\").hint == \"list\"", "then":"Browse7", "or":"Actions"}], "evalwrite":[{"variable":"MyListItem","value":"DYNAMIK JSON.parse(\"$Result\").item_key"},{"variable":"Level6Pic","value":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level5Pic\"}"}, {"variable":"LevelActionPic","value":"$Level6Pic"}]}
]},
"Browse7":{"label":"Browse", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"", "itemUI":"","itemimage":"$Level6Pic"},
{"type":"http-get", "command":"http://$NodeRedIP:1880/roon/browse?browse={\"hierarchy\":\"browse\",\"multi_session_key\":\"$ZoneId\", \"count\":10000, \"level\":6,\"item_key\":\"$MyListItem\"}", "queryresult":"$.items.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").title", "itemlabel":"DYNAMIK JSON.parse(\"$Result\").subtitle", "itemimage":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level6Pic\"}", "itemaction": "DYNAMIK (JSON.parse(\"$Result\").hint == \"action\")?\"Action\":undefined", "evalnext":[{"test":"DYNAMIK JSON.parse(\"$Result\").hint == \"list\"", "then":"Browse8", "or":"Actions"}], "evalwrite":[{"variable":"MyListItem","value":"DYNAMIK JSON.parse(\"$Result\").item_key"},{"variable":"Level7Pic","value":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level6Pic\"}"}, {"variable":"LevelActionPic","value":"$Level7Pic"}]}
]},
"Browse8":{"label":"Browse", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"", "itemUI":"","itemimage":"$Level7Pic"},
{"type":"http-get", "command":"http://$NodeRedIP:1880/roon/browse?browse={\"hierarchy\":\"browse\",\"multi_session_key\":\"$ZoneId\", \"count\":10000, \"level\":7,\"item_key\":\"$MyListItem\"}", "queryresult":"$.items.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").title", "itemlabel":"DYNAMIK JSON.parse(\"$Result\").subtitle", "itemimage":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level7Pic\"}", "itemaction": "DYNAMIK (JSON.parse(\"$Result\").hint == \"action\")?\"Action\":undefined", "evalnext":[{"test":"DYNAMIK JSON.parse(\"$Result\").hint == \"list\"", "then":"", "or":"Actions"}], "evalwrite":[{"variable":"MyListItem","value":"DYNAMIK JSON.parse(\"$Result\").item_key"},{"variable":"Level4Pic","value":"DYNAMIK let ik = JSON.parse(\"$Result\").image_key; if (ik) {\"http://$NodeRedIP:1880/roon/image?image_key=\" + ik} else {\"$Level7Pic\"}"}]}
]},
"Actions":{"label":"Actions list", "commandset": [
{"type":"static", "command":".", "itemtype":"tile", "itemaction":"","itemimage":"$LevelActionPic"},
{"type":"http-get", "command":"http://$NodeRedIP:1880/roon/browse?browse={\"hierarchy\":\"browse\",\"multi_session_key\":\"$ZoneId\",\"item_key\":\"$MyListItem\"}", "queryresult":"$.items.*", "itemname":"DYNAMIK JSON.parse(\"$Result\").title", "itemlabel":"DYNAMIK JSON.parse(\"$Result\").subtitle", "itemimage":"$LevelActionPic", "itemUI":"DYNAMIK (JSON.parse(\"$Result\").hint == \"action\")?\"close\":\"\"", "itemaction": "DYNAMIK (JSON.parse(\"$Result\").hint == \"action\")?\"Action\":undefined", "evalwrite":[{"variable":"MyListItem","value":"DYNAMIK JSON.parse(\"$Result\").item_key"}]}
]},
"Action":{"label":"Action", "commandset": [
{"type":"http-get", "command":"http://$NodeRedIP:1880/roon/browse?browse={\"hierarchy\":\"browse\",\"multi_session_key\":\"$ZoneId\",\"item_key\":\"$MyListItem\",\"zone_or_output_id\":\"$ZoneId\"}"}
]
}
}
}
}
}
}