Hi, I also now have a Drayton Wiser boiler controller. I've not had much time to do anything smart using Node-RED though. I can certainly get the data from the controller.
I can see from first code you posted that you will need to understand the correct URL path in order to control anything. So the first thing you need to do is work out a command to use as a test. You can use msg.url in the form http://<controlleripaddr>/<command path>
You need to send a msg to the HTTP request node that contains msg.method = "PATCH"
and a msg.headers
property containing the "SECRET" and "HOST" headers as JSON.
After some quick experimentation, I was able to manually set the temperature override for room zero using the following code:
[{"id":"9d700a39.ebbaa8","type":"http request","z":"fb0c842.c87fc78","name":"","method":"use","ret":"obj","url":"","tls":"","x":770,"y":560,"wires":[["58845d6d.bf2a24"]]},{"id":"32c33bee.cf6c24","type":"inject","z":"fb0c842.c87fc78","name":"Wiser SET","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":560,"wires":[["855deb47.8df6f8"]]},{"id":"58845d6d.bf2a24","type":"debug","z":"fb0c842.c87fc78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":930,"y":560,"wires":[]},{"id":"6ec2a88e.839598","type":"change","z":"fb0c842.c87fc78","name":"","rules":[{"t":"set","p":"method","pt":"msg","to":"PATCH","tot":"str"},{"t":"set","p":"url","pt":"msg","to":"\"http://\" & $flowContext('wiserHost') & $.path","tot":"jsonata"},{"t":"set","p":"headers","pt":"msg","to":"{\t \"SECRET\": $flowContext('wiserSecret'),\t \"HOST\": $flowContext('wiserHost') & \":80\"\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":560,"wires":[["9d700a39.ebbaa8"]]},{"id":"3822a01a.859ea","type":"inject","z":"fb0c842.c87fc78","name":"","topic":"Wiser QUERY","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":620,"wires":[["2dfd4a60.601b06"]]},{"id":"fcb37ac1.cb36f8","type":"http request","z":"fb0c842.c87fc78","name":"","method":"use","ret":"obj","url":"","tls":"","x":770,"y":620,"wires":[["c21166d6.4784c8"]]},{"id":"c21166d6.4784c8","type":"debug","z":"fb0c842.c87fc78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":930,"y":620,"wires":[]},{"id":"a9652fa4.60f24","type":"change","z":"fb0c842.c87fc78","name":"","rules":[{"t":"set","p":"method","pt":"msg","to":"GET","tot":"str"},{"t":"set","p":"url","pt":"msg","to":"\"http://\" & $flowContext('wiserHost') & $.path","tot":"jsonata"},{"t":"set","p":"headers","pt":"msg","to":"{\t \"SECRET\": $flowContext('wiserSecret'),\t \"HOST\": $flowContext('wiserHost') & \":80\"\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":620,"wires":[["fcb37ac1.cb36f8"]]},{"id":"855deb47.8df6f8","type":"change","z":"fb0c842.c87fc78","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"RequestOverride\":{\"Type\":\"Manual\",\"SetPoint\":-200}}","tot":"json"},{"t":"set","p":"path","pt":"msg","to":"/data/domain/Room/1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":560,"wires":[["6ec2a88e.839598"]]},{"id":"2dfd4a60.601b06","type":"change","z":"fb0c842.c87fc78","name":"","rules":[{"t":"set","p":"path","pt":"msg","to":"/data/domain/","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":620,"wires":[["a9652fa4.60f24"]]}]
Note that the flow also includes the query. The IP address of the controller & the secret for control are both set as flow variables (flow.wiserHost
and flow.wiserSecret
) so you will need to set those up yourself.
I don't know all of the control types by any means but I will try to document some as I go along.