Yamaha Controll
Node-Red Flow to control Yamaha components via API. Tested with WX010 for Volume, Stationlist, On/Off and Mute
[{"id":"fb8b13cc.abd98","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"ed9173e2.fdb2c8","type":"http request","z":"fb8b13cc.abd98","name":"WX010 On","method":"GET","ret":"txt","url":"http://192.168.123.120/YamahaExtendedControl/v1/main/setPower?power=on","tls":"","x":830,"y":320,"wires":[["34f96614.446902"]]},{"id":"636c3cf8.308664","type":"ui_switch","z":"fb8b13cc.abd98","name":"On / Off","label":"WX010","tooltip":"","group":"dde2e2b0.77282","order":1,"width":0,"height":0,"passthru":false,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":320,"y":400,"wires":[["e771116a.c6232","525df6d9.eb542"]]},{"id":"ce61097b.a6bf48","type":"http request","z":"fb8b13cc.abd98","name":"WX010 Off","method":"GET","ret":"txt","url":"http://192.168.123.120/YamahaExtendedControl/v1/main/setPower?power=standby","tls":"","x":830,"y":360,"wires":[[]]},{"id":"e771116a.c6232","type":"switch","z":"fb8b13cc.abd98","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":3,"x":570,"y":360,"wires":[["ed9173e2.fdb2c8"],["ce61097b.a6bf48"],["386134d.a19c1cc"]],"outputLabels":["On","Off","Volume"]},{"id":"a8a7ebb3.16d68","type":"ui_slider","z":"fb8b13cc.abd98","name":"Volume","label":"Volume","tooltip":"","group":"dde2e2b0.77282","order":1,"width":0,"height":0,"passthru":false,"outs":"all","topic":"","min":"1","max":"100","step":1,"x":1160,"y":480,"wires":[["b7ae5bc3.d3ecd8"]]},{"id":"599bf841.6e8a6","type":"http request","z":"fb8b13cc.abd98","name":"WX010 Volume","method":"GET","ret":"txt","url":"http://192.168.123.120/YamahaExtendedControl/v1/main/setVolume?volume={{post}}","tls":"","x":1700,"y":480,"wires":[[]]},{"id":"b7ae5bc3.d3ecd8","type":"change","z":"fb8b13cc.abd98","name":"","rules":[{"t":"set","p":"post","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1450,"y":480,"wires":[["599bf841.6e8a6"]]},{"id":"386134d.a19c1cc","type":"trigger","z":"fb8b13cc.abd98","op1":"0","op2":"10","op1type":"str","op2type":"str","duration":"1","extend":false,"units":"s","reset":"","bytopic":"all","name":"delay Volume 0->10","x":860,"y":400,"wires":[["a8a7ebb3.16d68"]]},{"id":"525df6d9.eb542","type":"redmatic-homekit-switch","z":"fb8b13cc.abd98","bridgeConfig":"6b8e03f8.be1c74","name":"On /Off","x":320,"y":320,"wires":[["e771116a.c6232","636c3cf8.308664"]]},{"id":"a57345c7.dba568","type":"http request","z":"fb8b13cc.abd98","name":"WX010 Mute","method":"GET","ret":"txt","url":"http://192.168.123.120/YamahaExtendedControl/v1/main/setMute?enable={{payload}}","tls":"","x":1690,"y":540,"wires":[[]]},{"id":"4bb688c1.ff0ba8","type":"ui_switch","z":"fb8b13cc.abd98","name":"","label":"Mute","tooltip":"","group":"dde2e2b0.77282","order":2,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":1150,"y":540,"wires":[["a57345c7.dba568"]]},{"id":"f7ee194e.c0be9","type":"http request","z":"fb8b13cc.abd98","name":"Stationlist","method":"GET","ret":"obj","url":"http://192.168.123.120/YamahaExtendedControl/v1/netusb/getPresetInfo","tls":"","x":1160,"y":320,"wires":[["d699fb58.90115"]]},{"id":"ac59f44d.300d98","type":"ui_dropdown","z":"fb8b13cc.abd98","name":"","label":"","tooltip":"","place":"Sender auswählen","group":"dde2e2b0.77282","order":3,"width":0,"height":0,"passthru":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":1630,"y":320,"wires":[["e02fa4e5.25755"]]},{"id":"d699fb58.90115","type":"function","z":"fb8b13cc.abd98","name":"create Stationlist","func":"const options = [];\nmsg.payload.preset_info.forEach((info, index) => {\n const option = {};\n option[info.text] = String(index+1);\n options.push(option);\n});\nreturn {options};","outputs":1,"noerr":0,"x":1370,"y":320,"wires":[["ac59f44d.300d98"]]},{"id":"e02fa4e5.25755","type":"http request","z":"fb8b13cc.abd98","name":"Station change","method":"GET","ret":"txt","url":"http://192.168.123.120/YamahaExtendedControl/v1/netusb/recallPreset?zone=main&num={{payload}}","tls":"","x":1880,"y":320,"wires":[[]]},{"id":"34f96614.446902","type":"trigger","z":"fb8b13cc.abd98","op1":"","op2":"","op1type":"nul","op2type":"date","duration":"5","extend":false,"units":"s","reset":"","bytopic":"all","name":"5sek","x":1010,"y":320,"wires":[["f7ee194e.c0be9"]]},{"id":"dde2e2b0.77282","type":"ui_group","z":"","name":"Lautsprecher","tab":"6d7c5e1c.9838","disp":true,"width":"6","collapse":false},{"id":"6b8e03f8.be1c74","type":"redmatic-homekit-bridge","z":"","name":"Bridge RedMatic","username":"AA:BB:CC:DD:EE:FF","pincode":"123-45-678","port":"51826"},{"id":"6d7c5e1c.9838","type":"ui_tab","z":"","name":"Yamaha Controll","icon":"dashboard","order":4,"disabled":false,"hidden":false}]