node-red-contrib-sonos-plus
Version:
A set of Node-RED nodes to control SONOS player in your local network.
205 lines • 4.58 kB
JSON
[
{
"id": "51b597a0.230198",
"type": "comment",
"z": "25081f9e.f5f34",
"name": "group all players into single group",
"info": "# group all players into single group\n\n## Use case\n- to play a notification on all players\n\n## Customizing\n - edit `household.get.groups`, `household.create.group` and select your configuration node.\n\n## Result\nAll household players are in single group.\n\n## Limitation\n - The coordinator is not set in this flow. \n - It may take some seconds to complete this.",
"x": 170,
"y": 2227,
"wires": [],
"icon": "node-red/subflow.svg"
},
{
"id": "7fa8fa96.d0af54",
"type": "link in",
"z": "25081f9e.f5f34",
"name": "group all players in single group: start",
"links": [],
"x": 55,
"y": 2260,
"wires": [
[
"f06d6fa3.d8349"
]
]
},
{
"id": "5e21d4e1.1b3c1c",
"type": "inject",
"z": "25081f9e.f5f34",
"name": "trigger",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payloadType": "date",
"x": 115,
"y": 2325,
"wires": [
[
"f06d6fa3.d8349"
]
]
},
{
"id": "f06d6fa3.d8349",
"type": "sonos-universal",
"z": "25081f9e.f5f34",
"confignode": "88e9fa70.4a53e8",
"command": "household.get.groups",
"state": "",
"stateType": "str",
"avoidCheckPlayerAvailability": false,
"name": "",
"x": 235,
"y": 2260,
"wires": [
[
"1882a0ef.94a6af"
]
]
},
{
"id": "bc712824.bf17c8",
"type": "change",
"z": "25081f9e.f5f34",
"name": "create csv",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$join(payload.playerName,',')\t",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 609,
"y": 2260,
"wires": [
[
"80b0b8f.59ed948"
]
]
},
{
"id": "80b0b8f.59ed948",
"type": "sonos-universal",
"z": "25081f9e.f5f34",
"confignode": "88e9fa70.4a53e8",
"command": "household.create.group",
"state": "",
"stateType": "str",
"avoidCheckPlayerAvailability": false,
"name": "",
"x": 821,
"y": 2260,
"wires": [
[
"c11ad469.112368"
]
]
},
{
"id": "6d411e2c.93dfd",
"type": "comment",
"z": "25081f9e.f5f34",
"name": "↑just for testing",
"info": "\n ",
"x": 120,
"y": 2357,
"wires": []
},
{
"id": "c11ad469.112368",
"type": "link out",
"z": "25081f9e.f5f34",
"name": "group all players in single group: end",
"links": [],
"x": 1018,
"y": 2260,
"wires": []
},
{
"id": "1882a0ef.94a6af",
"type": "change",
"z": "25081f9e.f5f34",
"name": "biggest first",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$sort(payload, function($l, $r) {\t $count($r) > $count($l)\t})\t\t",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 437,
"y": 2260,
"wires": [
[
"bc712824.bf17c8"
]
]
},
{
"id": "ba13e419.057c88",
"type": "comment",
"z": "25081f9e.f5f34",
"name": "↑modify",
"info": "Select your config-node or modify it and use your ip address.",
"x": 286,
"y": 2287,
"wires": [],
"icon": "font-awesome/fa-edit"
},
{
"id": "607cd186.7b0b5",
"type": "comment",
"z": "25081f9e.f5f34",
"name": "↓modify",
"info": "Select your config-node or modify it and use your ip address.",
"x": 852,
"y": 2237,
"wires": [],
"icon": "font-awesome/fa-edit"
},
{
"id": "a04b8409.5ae458",
"type": "comment",
"z": "25081f9e.f5f34",
"name": "Example 10 Create one single group with all players",
"info": "",
"x": 195,
"y": 2194,
"wires": [],
"icon": "node-red-contrib-sonos-plus/sonos.png"
},
{
"id": "88e9fa70.4a53e8",
"type": "sonos-config",
"name": "your_player_dns",
"serialnum": "",
"ipaddress": "sonoskitchen.fritz.box"
}
]