Node-RED
[{"id":"ce3d3f8aa8573a8c","type":"http request","z":"f4e99ff4808f0b96","name":"toggle relay 1","method":"PUT","ret":" txt","paytoqs":"ignore","url":" 192.168.1.131:1880/toggle/relay/1","tls":"","persist":false,"proxy":""," authType":"","credentials":{},"x":980,"y":220,"wires":[["542d1ed806fd2726"]]},{"id":"0a40e56749790e1b","type" :"chatbot message","z" :"f4e99ff4808f0b96","name":"","message":[{"message":""}],"language":"none","x":1450,"y":220,"wires" :[["feb1be1f901608b8"]]},{"id":"20f6cff1783e35f2","type":"function","z":"f4e99ff4808f0b96","name":"catch reponse","func":"var state = msg.payload.state\nmsg.payload = \"Relay 1 set to: \" + state\nreturn msg;","outputs":1,"noerr":0, "initialize":"","finalize":"","libs":[],"x":1300,"y":220,"wires":[["0a40e56749790e1b"]]},{"id" :"5ae01a56e2c337c8","type":"function","z":"f4e99ff4808f0b96","name":"check command","func":"if ( msg.payload.content == \"/relay1\" ) {\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y": 220,"wires":[["ce3d3f8aa8573a8c"]]},{"id":"542d1ed806fd2726","type":"json","z":"f4e99ff4808f0b96","name":"","property" :"payload","action":"","pretty":false,"x":1130,"y":220,"wires":[["20f6cff1783e35f2","4b8b20e2f6f60cc2"]]}]