Example of using DS Audio to cast random music to a music player and turn on the amp using a Smartthings button. Doubletap to go to the next song.
code
[{"id":"d5542f72.ae62d","type":"change","z":"41d8ca49.8ee574","name":"","rules":[{"t":"set","p":"payload.songs","pt":"msg","to":"payload.songs.id","tot":"jsonata"},{"t":"set","p":"payload.id","pt":"msg","to":"uuid:f76642ae-27bc-945b-ffff-ffff81f74f04","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":360,"wires":[["7f559795.ef6888"]]},{"id":"786e29ee.1bdf58","type":"change","z":"41d8ca49.8ee574","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.limit","pt":"msg","to":"$count(payload.songs.id)","tot":"jsonata"},{"t":"set","p":"payload.songs","pt":"msg","to":"[]","tot":"json"},{"t":"set","p":"payload.offset","pt":"msg","to":"0","tot":"num"},{"t":"set","p":"payload.library","pt":"msg","to":"shared","tot":"str"},{"t":"set","p":"payload.id","pt":"msg","to":"uuid:f76642ae-27bc-945b-ffff-ffff81f74f04","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":960,"y":440,"wires":[["64d4440f.d5a51c"]]},{"id":"19f16f6a.7c8d71","type":"change","z":"41d8ca49.8ee574","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.action","pt":"msg","to":"play","tot":"str"},{"t":"set","p":"payload.id","pt":"msg","to":"uuid:f76642ae-27bc-945b-ffff-ffff81f74f04","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1260,"y":360,"wires":[["1c1cde8d.9c90f1"]]},{"id":"d34dd165.d2008","type":"change","z":"41d8ca49.8ee574","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.sort_by","pt":"msg","to":"random","tot":"str"},{"t":"set","p":"payload.limit","pt":"msg","to":"100","tot":"num"},{"t":"set","p":"payload.id","pt":"msg","to":"uuid:f76642ae-27bc-945b-ffff-ffff81f74f04","tot":"str"},{"t":"set","p":"payload.library","pt":"msg","to":"shared","tot":"str"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":360,"wires":[["251532ce.39b08e"]]},{"id":"90f7a0b5.06","type":"change","z":"41d8ca49.8ee574","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.id","pt":"msg","to":"uuid:f76642ae-27bc-945b-ffff-ffff81f74f04","tot":"str"},{"t":"set","p":"payload.action","pt":"msg","to":"stop","tot":"str"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":440,"wires":[["b4f97b98.aec148"]]},{"id":"251532ce.39b08e","type":"DS Audio","z":"41d8ca49.8ee574","dsm":"944d5151.862c6","name":"","topic":"listSongs","payload":"","x":780,"y":360,"wires":[["d5542f72.ae62d"]]},{"id":"7f559795.ef6888","type":"DS Audio","z":"41d8ca49.8ee574","dsm":"944d5151.862c6","name":"","topic":"updatePlayListRemotePlayer","payload":"","x":1100,"y":360,"wires":[["19f16f6a.7c8d71"]]},{"id":"1c1cde8d.9c90f1","type":"DS Audio","z":"41d8ca49.8ee574","dsm":"944d5151.862c6","name":"","topic":"controlRemotePlayer","payload":"","x":1440,"y":360,"wires":[[]]},{"id":"64d4440f.d5a51c","type":"DS Audio","z":"41d8ca49.8ee574","dsm":"944d5151.862c6","name":"","topic":"updatePlayListRemotePlayer","payload":"","x":1120,"y":440,"wires":[[]]},{"id":"b4f97b98.aec148","type":"DS Audio","z":"41d8ca49.8ee574","dsm":"944d5151.862c6","name":"","topic":"controlRemotePlayer","payload":"","x":800,"y":440,"wires":[["786e29ee.1bdf58"]]},{"id":"51f54ce8.9eb8e4","type":"hubitat device","z":"41d8ca49.8ee574","deviceLabel":"Audio: Craig","name":"","server":"b5eb352.57bc6c8","deviceId":"136","attribute":"switch","sendEvent":false,"x":310,"y":400,"wires":[["e20a6905.8ef968"]]},{"id":"e20a6905.8ef968","type":"switch","z":"41d8ca49.8ee574","name":"Off?","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"neq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":400,"wires":[["d34dd165.d2008","b66b24a6.f6eec8"],["90f7a0b5.06","6956695a.1832a8"]]},{"id":"b66b24a6.f6eec8","type":"hubitat command","z":"41d8ca49.8ee574","deviceLabel":"Audio: Craig","name":"","server":"b5eb352.57bc6c8","deviceId":"136","command":"on","commandArgs":"","x":570,"y":300,"wires":[[]]},{"id":"6956695a.1832a8","type":"hubitat command","z":"41d8ca49.8ee574","deviceLabel":"Audio: Craig","name":"","server":"b5eb352.57bc6c8","deviceId":"136","command":"off","commandArgs":"","x":550,"y":500,"wires":[[]]},{"id":"92909fe9.55e1b","type":"DS Audio","z":"41d8ca49.8ee574","dsm":"944d5151.862c6","name":"","topic":"controlRemotePlayer","payload":"","x":480,"y":200,"wires":[[]]},{"id":"63da3e79.05d71","type":"change","z":"41d8ca49.8ee574","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"controlRemotePlayer","tot":"str"},{"t":"set","p":"payload.id","pt":"msg","to":"uuid:f76642ae-27bc-945b-ffff-ffff81f74f04","tot":"str"},{"t":"set","p":"payload.action","pt":"msg","to":"next","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":200,"wires":[["92909fe9.55e1b"]]},{"id":"eefd01bb.ba5ba","type":"hubitat device","z":"41d8ca49.8ee574","deviceLabel":"Audio: Craig Button","name":"","server":"b5eb352.57bc6c8","deviceId":"192","attribute":"doubleTapped","sendEvent":true,"x":110,"y":200,"wires":[["63da3e79.05d71"]]},{"id":"4b269378.8a970c","type":"hubitat device","z":"41d8ca49.8ee574","deviceLabel":"Audio: Craig Button","name":"","server":"b5eb352.57bc6c8","deviceId":"192","attribute":"pushed","sendEvent":true,"x":110,"y":400,"wires":[["51f54ce8.9eb8e4"]]},{"id":"944d5151.862c6","type":"DS Config","name":"","protocol":"http","apiVersion":"6.0.2"},{"id":"b5eb352.57bc6c8","type":"hubitat config","name":"","usetls":false,"host":"192.168.1.52","port":"80","appId":"79","nodeRedServer":"http://192.168.1.53:1880","webhookPath":"/hubitat/webhook","autoRefresh":true,"useWebsocket":false}]