Really loving this integration. Thanks. Here is my latest.
Sonos music follows me around the house
Sonos follows me around the house. And then turns off 5 minutes after no motion. Can easily set it up, takes about 2 minutes with this flow. You need the SonosPlus nodes, from the Palette.
Instructions:
- You will probably want another restriction at the start. You dont want just a motion sensor triggering this off.
- Use the Setup flow, to determine your Sonos Master speaker name. First, configure the yellow box, selecting your Master speaker. Then deploy and inject. Determine the name of your Sonos Master Speaker, from debug logs. Use the name at point 4.
- Make sure in the second node (Active/Inactive) that the msg.payload.value is correct for your motion sensor(s).
- a) In "Active/Inactive?" node, set the name of the master speaker, from point 2. You need to set it in two locations, replacing "Office" b) Also, set the name of the Master in the "Client Leave group" node. It's the bottom of the four text boxes. Currently populated with Office).
- In the main flow, select the last node (colored pink), and configure it for your Client speaker.
- Deploy and fix your errors.
- Music maestro
Here is the flow (with the setup flow)
[{"id":"3658315a.a14f7e","type":"sonos-control-player","z":"bd95fd32.e7aa2","confignode":"2e14d17b.6706ee","name":"Client (Kitchen)","x":1320,"y":900,"wires":[[]]},{"id":"561ec303.87174c","type":"hubitat device","z":"bd95fd32.e7aa2","name":"MD - Kitchen 2","server":"53b6a3bd.05e6fc","deviceId":"12","attribute":"motion","sendEvent":true,"x":240,"y":900,"wires":[["12511617.551f6a"]]},{"id":"dd3dc4d4.397f48","type":"change","z":"bd95fd32.e7aa2","name":"Client leaves group","rules":[{"t":"set","p":"payload","pt":"msg","to":"leave_group","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"Office","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":920,"wires":[["221cc189.9c0d5e"]]},{"id":"3b7e6361.7ec3bc","type":"stoptimer","z":"bd95fd32.e7aa2","duration":"5","units":"Minute","payloadtype":"num","payloadval":"0","name":"","x":700,"y":920,"wires":[["dd3dc4d4.397f48"],[]]},{"id":"221cc189.9c0d5e","type":"rbe","z":"bd95fd32.e7aa2","name":"RBE","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1130,"y":900,"wires":[["3658315a.a14f7e"]]},{"id":"12511617.551f6a","type":"function","z":"bd95fd32.e7aa2","name":"Active/Inactive? ","func":"switch (msg.payload.value) {\n case \"active\":\n msg.topic = \"Office\";\n msg.payload = \"join_group\"\n var newMsg = {payload:\"stop\"};\n return [msg, newMsg]\n case \"inactive\":\n msg.topic = \"Office\";\n msg.payload = 'false'\n return [null, msg]\n}","outputs":2,"noerr":0,"x":460,"y":900,"wires":[["221cc189.9c0d5e"],["3b7e6361.7ec3bc"]]},{"id":"cb35f5f9.463df8","type":"sonos-get-status","z":"bd95fd32.e7aa2","confignode":"9fa1dde5.f2684","name":"Master (Office)","x":740,"y":980,"wires":[["460277b6.9ffa48"]]},{"id":"57c53246.43e5fc","type":"inject","z":"bd95fd32.e7aa2","name":"Determine Sonos Master Name","topic":"","payload":"get_basics","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":490,"y":980,"wires":[["cb35f5f9.463df8"]]},{"id":"460277b6.9ffa48","type":"debug","z":"bd95fd32.e7aa2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":910,"y":980,"wires":[]},{"id":"5eb0e89f.909a48","type":"comment","z":"bd95fd32.e7aa2","name":"Setup Flow ---------->","info":"","x":230,"y":980,"wires":[]},{"id":"2e14d17b.6706ee","type":"sonos-config","z":"","name":"Sonos - Kitchen","serialnum":"removed","ipaddress":"removed"},{"id":"53b6a3bd.05e6fc","type":"hubitat config","z":"","name":"Hubitat Coordinator","usetls":false,"host":"192.168.1.100","port":"80","token":"38c388e7-7b8c-436e-a6a0-6529f6b7980b","appId":"1731","nodeRedServer":"removed","webhookPath":"/hubitat/webhook"},{"id":"9fa1dde5.f2684","type":"sonos-config","z":"","name":"Sonos - Office","serialnum":"?","ipaddress":"?"}]