Hello i have an Pioneer VSX 921 and i have a flow that i can control it.
But i want a button on ex dashboard to turn up or down volume 10 notches. but when i get value from receiver it wont work in function with if this. what to do?
[{"id":"6c0f88c4.2e46b8","type":"inject","z":"4e99ff3b.00121","name":"","topic":"Get Volume","payload":"?V","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":144.2857208251953,"y":304.2857313156128,"wires":[["a8ebbabd.1af658"]]},{"id":"c4ddf455.155238","type":"inject","z":"4e99ff3b.00121","name":"","topic":"Volume Up","payload":"VU","payloadType":"str","repeat":"","crontab":"","once":false,"x":129.71428680419922,"y":366.57142639160156,"wires":[["a8ebbabd.1af658"]]},{"id":"8ea0f05f.1b573","type":"inject","z":"4e99ff3b.00121","name":"","topic":"Volume Down","payload":"VD","payloadType":"str","repeat":"","crontab":"","once":false,"x":120.71428680419922,"y":411.57142639160156,"wires":[["a8ebbabd.1af658"]]},{"id":"a8ebbabd.1af658","type":"function","z":"4e99ff3b.00121","name":"Add <CR>","func":"msg.payload = msg.payload + '\\r';\n\nreturn msg;","outputs":1,"noerr":0,"x":364.8571357727051,"y":352.42857933044434,"wires":[["2a2a105c.47aa9"]]},{"id":"2a2a105c.47aa9","type":"tcp request","z":"4e99ff3b.00121","server":"192.168.1.7","port":"23","out":"time","splitc":"10","name":"Pioneer SCLX56 ","x":541.7143478393555,"y":353.42856311798096,"wires":[["d06c35dc.6b1e88"]]},{"id":"d06c35dc.6b1e88","type":"function","z":"4e99ff3b.00121","name":"Convert to String","func":"msg.payload = msg.payload.toString();\nreturn msg;","outputs":1,"noerr":0,"x":751.71435546875,"y":358.71427726745605,"wires":[["c7644439.6b3478","e77165d5.6e7348"]]},{"id":"c7644439.6b3478","type":"debug","z":"4e99ff3b.00121","name":"","active":true,"console":"false","complete":"payload","x":958.2857055664062,"y":314.00000762939453,"wires":[]},{"id":"e77165d5.6e7348","type":"function","z":"4e99ff3b.00121","name":"This doesn´t work","func":"if(msg.payload === \"VOL081\"){\n //then do this.\n //this is where it stops\n msg.payload = \"hh\";\n}\nreturn msg;","outputs":1,"noerr":0,"x":937.1428871154785,"y":424.2856864929199,"wires":[["c7644439.6b3478"]]},{"id":"a26b82a5.dd0e3","type":"comment","z":"4e99ff3b.00121","name":"Info about the flow","info":"When i press Get Volume it gets EX VOL081 in \ndebug, from Convert to string function.\nbut the if this function wont read it","x":506.4285774230957,"y":85.71429347991943,"wires":[]}]