SYMFONISK deCONZ SONOS flow

Flow to be used with node-red-contrib-deconz and node-red-contrib-sonos-plus

This flow uses the SOMFONISK remote connected to deCONZ to control a SONOS speaker or group. It ignores common SYMFONISK remote glitches (right turn commands while the dial is turned left etc.) and prevents the remote from turning up the volume when your sonos speaker is not playing (prevents unpleasant loud volume surprises).

The inject node resets the volume to 10 every night at 4 am (without starting playback).

Here's what the flow looks like:

Single button deCONZ

The deCONZ input node (the orange one) should be configured as follows:

Single button deCONZ

In the SONOS universal nodes (the dark grey ones) simply add your own SONOS speaker.


Copy the subflow below to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option

[{"id":"71c590ea13e58487","type":"switch","z":"c92e0bd3.103cb8","name":"sort input","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1002","vt":"str"},{"t":"eq","v":"1004","vt":"str"},{"t":"eq","v":"1005","vt":"str"},{"t":"eq","v":"2003","vt":"str"},{"t":"eq","v":"3003","vt":"str"},{"t":"eq","v":"2001","vt":"str"},{"t":"eq","v":"3001","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":140,"y":2190,"wires":[["40ac2c7444424d3e"],["2076a35ca97b10be"],["e7063dad8e770ab1"],["86d59e324c8e511e","c6b70f0162557b62"],["86d59e324c8e511e","c6b70f0162557b62"],["77975c9da861f979","0d1e0cd0a12023f9"],["796fe5b766178009","0d1e0cd0a12023f9"]]},{"id":"59facb1f9d922890","type":"change","z":"c92e0bd3.103cb8","name":"delete topic, meta, payload_raw","rules":[{"t":"delete","p":"payload_raw","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"},{"t":"delete","p":"meta","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":180,"y":1960,"wires":[["71c590ea13e58487"]]},{"id":"86d59e324c8e511e","type":"change","z":"c92e0bd3.103cb8","name":"reset trigger and blocks","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"block_left","pt":"flow","to":"false","tot":"bool"},{"t":"set","p":"block_right","pt":"flow","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":2270,"wires":[["653827de976118b4","7b842e3fbf7d0ff1"]]},{"id":"796fe5b766178009","type":"switch","z":"c92e0bd3.103cb8","name":"left not blocked?","property":"block_left","propertyType":"flow","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":440,"y":2510,"wires":[["7b842e3fbf7d0ff1","3ab11645b5b0c386"]]},{"id":"e72b45fb06183537","type":"change","z":"c92e0bd3.103cb8","name":"block left turns","rules":[{"t":"set","p":"block_left","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":2310,"wires":[[]]},{"id":"77975c9da861f979","type":"switch","z":"c92e0bd3.103cb8","name":"right not blocked?","property":"block_right","propertyType":"flow","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":440,"y":2350,"wires":[["b06b9149eaa88623","e72b45fb06183537"]]},{"id":"3ab11645b5b0c386","type":"change","z":"c92e0bd3.103cb8","name":"block right turns","rules":[{"t":"set","p":"block_right","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":2470,"wires":[[]]},{"id":"0d1e0cd0a12023f9","type":"trigger","z":"c92e0bd3.103cb8","name":"fallback reset","op1":"","op2":"true","op1type":"nul","op2type":"bool","duration":"6","extend":false,"units":"s","reset":"","bytopic":"all","outputs":1,"x":420,"y":2230,"wires":[["86d59e324c8e511e"]]},{"id":"c6b70f0162557b62","type":"change","z":"c92e0bd3.103cb8","name":"reset trigger","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":2190,"wires":[["0d1e0cd0a12023f9"]]},{"id":"653827de976118b4","type":"trigger","z":"c92e0bd3.103cb8","name":"volume up","op1":"+2","op2":"+3","op1type":"str","op2type":"str","duration":"-300","extend":false,"units":"ms","reset":"","bytopic":"all","outputs":1,"x":680,"y":2430,"wires":[["cec7f9d73b27f58e"]]},{"id":"7b842e3fbf7d0ff1","type":"trigger","z":"c92e0bd3.103cb8","name":"volume down","op1":"-2","op2":"-3","op1type":"str","op2type":"str","duration":"-300","extend":false,"units":"ms","reset":"","bytopic":"all","outputs":1,"x":670,"y":2510,"wires":[["cec7f9d73b27f58e"]]},{"id":"b06b9149eaa88623","type":"sonos-universal","z":"c92e0bd3.103cb8","confignode":"","compatibilityMode":false,"command":"group.get.playbackstate","state":"","stateType":"str","name":"Get SONOS state","x":440,"y":2390,"wires":[["6d89233d00274775"]]},{"id":"6d89233d00274775","type":"switch","z":"c92e0bd3.103cb8","name":"playing?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"playing","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":2430,"wires":[["653827de976118b4"]]},{"id":"bbdfe792192d8200","type":"comment","z":"c92e0bd3.103cb8","name":"instructions + link to latest version of this flow","info":"Latest version of this flow can be found at \nhttps://flows.nodered.org/flow/8bcc31fa85c693db0e7b7e16d7a1bc5b#\n","x":590,"y":1890,"wires":[]},{"id":"354488ed5187986e","type":"deconz-input","z":"c92e0bd3.103cb8","name":"","topic":"","config_version":2,"server":"","statustext":"","statustext_type":"auto","search_type":"device","device_list":["sensors/uniqueid/68:0a:e2:ff:fe:3a:7c:e3-01-1000"],"device_name":"SYMFONISK remote : ZHASwitch","query":"{}","outputs":2,"output_rules":[{"type":"state","format":"single","output":"onupdate","onstart":false,"payload":["buttonevent"],"uniqueId":"ui-id-7"},{"type":"homekit","format":"single","onstart":true,"onerror":true,"payload":["__auto__"],"uniqueId":"ui-id-8"}],"x":170,"y":1890,"wires":[["59facb1f9d922890"],[]]},{"id":"3bacf73aad959a81","type":"sonos-universal","z":"c92e0bd3.103cb8","confignode":"","compatibilityMode":false,"command":"message","state":"","stateType":"str","name":"control SONOS","x":660,"y":2150,"wires":[[]]},{"id":"40ac2c7444424d3e","type":"change","z":"c92e0bd3.103cb8","name":"toggle.playback","rules":[{"t":"set","p":"topic","pt":"msg","to":"toggle.playback","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":2070,"wires":[["3bacf73aad959a81"]]},{"id":"2076a35ca97b10be","type":"change","z":"c92e0bd3.103cb8","name":"next.track","rules":[{"t":"set","p":"topic","pt":"msg","to":"next.track","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":2110,"wires":[["3bacf73aad959a81"]]},{"id":"e7063dad8e770ab1","type":"change","z":"c92e0bd3.103cb8","name":"previous.track","rules":[{"t":"set","p":"topic","pt":"msg","to":"previous.track","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":2150,"wires":[["3bacf73aad959a81"]]},{"id":"809ca173ef4eba8a","type":"inject","z":"c92e0bd3.103cb8","name":"auto-reset volume","props":[{"p":"topic","vt":"str"},{"p":"volume","v":"10","vt":"num"}],"repeat":"","crontab":"00 04 * * *","once":false,"onceDelay":0.1,"topic":"play","x":440,"y":2030,"wires":[["3bacf73aad959a81"]]},{"id":"cec7f9d73b27f58e","type":"change","z":"c92e0bd3.103cb8","name":"adjust.volume","rules":[{"t":"set","p":"topic","pt":"msg","to":"adjust.volume","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":2470,"wires":[["3bacf73aad959a81"]]}]

Flow Info

Created 3 years, 10 months ago
Updated 3 years, 6 months ago
Rating: 5 2

Owner

Actions

Rate:

Node Types

Core
  • change (x9)
  • comment (x1)
  • inject (x1)
  • switch (x4)
  • trigger (x3)
Other

Tags

  • SYMFONISK
  • SONOS
  • deCONZ
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option