Trying to make a snapshot, play an MP3 and revert (restore) the snapshot to revert previously playing. All works, but not restoring of playing… what am I missing here?
Tried with and without {"with_group":false}
The flow:
[{"id":"ba70d2316481e933","type":"api-call-service","z":"6f59380a.4fad78","name":"Snap Sonos Woonkamer","server":"c6b350c5.b8b3c","version":5,"debugenabled":false,"domain":"sonos","service":"snapshot","areaId":[],"deviceId":[],"entityId":["media_player.woonkamer"],"data":"{\"with_group\":false}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":3740,"wires":[["95de9f3a0d4a42a0"]]},{"id":"2afaad96ebeebafa","type":"api-call-service","z":"6f59380a.4fad78","name":"Snap Sonos Woonkamer","server":"c6b350c5.b8b3c","version":5,"debugenabled":false,"domain":"sonos","service":"restore","areaId":[],"deviceId":[],"entityId":["media_player.woonkamer"],"data":"{\"with_group\":false}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2710,"y":3740,"wires":[[]]},{"id":"326c09d7e00e905c","type":"api-call-service","z":"6f59380a.4fad78","name":"Play Jingle Bells Sonos Woonkamer","server":"c6b350c5.b8b3c","version":5,"debugenabled":false,"domain":"media_player","service":"play_media","areaId":[],"deviceId":[],"entityId":["media_player.woonkamer"],"data":"{\"media_content_id\":\"https://foo8evrs3az5lcpwzr9q98blrzat3a1o.sanderlelieveld.com/local/Jingle-bells-short-intro.mp3\",\"media_content_type\":\"music\",\"announce\":\"false\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1670,"y":3740,"wires":[["fceb7eace1b17989"]]},{"id":"6667e35da9fb0563","type":"api-call-service","z":"6f59380a.4fad78","name":"","server":"c6b350c5.b8b3c","version":5,"debugenabled":false,"domain":"media_player","service":"volume_set","areaId":[],"deviceId":[],"entityId":["media_player.woonkamer"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2290,"y":3740,"wires":[["4c5171ba09f53140"]]},{"id":"95de9f3a0d4a42a0","type":"delay","z":"6f59380a.4fad78","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":1010,"y":3740,"wires":[["fe22f7ec60e38a2c"]]},{"id":"fceb7eace1b17989","type":"delay","z":"6f59380a.4fad78","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1900,"y":3740,"wires":[["854b833069932348"]]},{"id":"0d2101a8bb370871","type":"api-call-service","z":"6f59380a.4fad78","name":"","server":"c6b350c5.b8b3c","version":5,"debugenabled":false,"domain":"media_player","service":"volume_set","areaId":[],"deviceId":[],"entityId":["media_player.woonkamer"],"data":"{\"volume_level\":0.2}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1390,"y":3740,"wires":[["326c09d7e00e905c"]]},{"id":"fe22f7ec60e38a2c","type":"function","z":"6f59380a.4fad78","name":"Save Settings","func":"msg.volume = msg.data.attributes.volume_level\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1177,"y":3740,"wires":[["0d2101a8bb370871"]]},{"id":"854b833069932348","type":"function","z":"6f59380a.4fad78","name":"Previous Volume","func":"let newmsg = {}\n\nnewmsg.payload = { data: { \"volume_level\":msg.volume} }\n\nreturn newmsg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":2070,"y":3740,"wires":[["6667e35da9fb0563"]]},{"id":"4c5171ba09f53140","type":"change","z":"6f59380a.4fad78","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2500,"y":3740,"wires":[["2afaad96ebeebafa"]]},{"id":"95a725283654ab0b","type":"switch","z":"6f59380a.4fad78","name":"Playing or Paused","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"playing","vt":"str"},{"t":"eq","v":"paused","vt":"str"},{"t":"eq","v":"standby","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":540,"y":3840,"wires":[["ba70d2316481e933"],["c7f5772416c97f3f"],["c7f5772416c97f3f"]]},{"id":"376c15bfdaa16a4b","type":"api-current-state","z":"6f59380a.4fad78","name":"","server":"c6b350c5.b8b3c","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"media_player.woonkamer","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":238,"y":3840,"wires":[["95a725283654ab0b"]]},{"id":"65ddcbe601aa6c3c","type":"inject","z":"6f59380a.4fad78","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":3980,"wires":[["376c15bfdaa16a4b"]]},{"id":"c6b350c5.b8b3c","type":"server","name":"Home Assistant","version":5,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]