It's triggered via an MQTT-in node and then does what I described. Here's an image of the sequence:
Sequence
[
{
"id": "b82e4b00.99bb4",
"type": "sonos-http-api-control",
"z": "8d29897f.b9b538",
"confignode": "bd37bdf5.2ce998",
"name": "Bedroom",
"mode": "",
"track": "",
"volume": "",
"clipall_value": "",
"volume_value": "",
"player": "Bedroom",
"x": 1160,
"y": 300,
"wires": [
[],
[]
]
},
{
"id": "1e176801.9afc58",
"type": "mqtt in",
"z": "8d29897f.b9b538",
"name": "Sonos/Sleep - in",
"topic": "Sonos/Sleep",
"qos": "2",
"datatype": "auto",
"broker": "40144fb8.a1c1e",
"x": 220,
"y": 340,
"wires": [
[
"4450430d.486994",
"26598745.cbebf",
"85a62614.123a98",
"ca2aaa61.21f7c8"
]
]
},
{
"id": "4450430d.486994",
"type": "delay",
"z": "8d29897f.b9b538",
"name": "2 hrs",
"pauseType": "delay",
"timeout": "2",
"timeoutUnits": "hours",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 470,
"y": 249,
"wires": [
[
"4f90786d.952d6"
]
]
},
{
"id": "26598745.cbebf",
"type": "change",
"z": "8d29897f.b9b538",
"name": "vol 20",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "20",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 470,
"y": 300,
"wires": [
[
"b82e4b00.99bb4"
]
]
},
{
"id": "85a62614.123a98",
"type": "delay",
"z": "8d29897f.b9b538",
"name": "5 mins",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "minutes",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 470,
"y": 349,
"wires": [
[
"fbba378d.383b28"
]
]
},
{
"id": "ca2aaa61.21f7c8",
"type": "delay",
"z": "8d29897f.b9b538",
"name": "5 secs",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 470,
"y": 400,
"wires": [
[
"1a4faf94.bb116"
]
]
},
{
"id": "4f90786d.952d6",
"type": "change",
"z": "8d29897f.b9b538",
"name": "vol 0",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 990,
"y": 249,
"wires": [
[
"b82e4b00.99bb4"
]
]
},
{
"id": "fbba378d.383b28",
"type": "change",
"z": "8d29897f.b9b538",
"name": "Vol 20-2 (30 mins)",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\t \"from\": 20,\t \"to\": 2,\t \"duration\": 1800000\t}",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 650,
"y": 349,
"wires": [
[
"ec8de7e4.7ec1a8"
]
]
},
{
"id": "1a4faf94.bb116",
"type": "change",
"z": "8d29897f.b9b538",
"name": "favourite:SoloPiano",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"favourite\":\"SoloPiano\"}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 670,
"y": 400,
"wires": [
[
"6616e576.9366fc"
]
]
},
{
"id": "f1da5755.fa3e4",
"type": "string",
"z": "8d29897f.b9b538",
"name": "to string",
"methods": [],
"prop": "payload",
"propout": "payload",
"object": "msg",
"objectout": "msg",
"x": 980,
"y": 349,
"wires": [
[
"b82e4b00.99bb4"
]
]
},
{
"id": "ec8de7e4.7ec1a8",
"type": "easing",
"z": "8d29897f.b9b538",
"name": "",
"easingType": "easeInQuad",
"outputType": "overTime",
"duration": 1000,
"interval": "5000",
"numberOfValues": 10,
"x": 830,
"y": 349,
"wires": [
[
"f1da5755.fa3e4"
]
]
},
{
"id": "6616e576.9366fc",
"type": "sonos-http-api-queue",
"z": "8d29897f.b9b538",
"confignode": "bd37bdf5.2ce998",
"songuri": "",
"position": "favourite",
"favourite": "",
"positioninqueue": "",
"name": "Sonos Queue",
"player": "Bedroom",
"x": 900,
"y": 400,
"wires": [
[]
]
},
{
"id": "bd37bdf5.2ce998",
"type": "sonos-http-api-config",
"z": "",
"name": "Sonos",
"ip": "http://192.168.1.4:5005",
"username": "",
"password": ""
},
{
"id": "40144fb8.a1c1e",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "127.0.0.1",
"port": "1883",
"tls": "",
"clientid": "",
"usetls": false,
"compatmode": false,
"keepalive": "15",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"closeTopic": "",
"closeRetain": "false",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": ""
}
]