Convert Query output to MQTT using NODEred

If you don’t mind I’d like to see your sequence for this.

This is quite exciting, especially the expansion board as I have 14 CTs on my main panel and would like at least a couple more.

I’ve recently delved into the ESP world and I love the critters.

WHat was it you wanted to see ?

Here is a sample flow that does a query using the API for IOTAWATT - i am using it to get a rolling 5 minute average of my solar, consumption and grid feed - i then use those values in a number of other flows and decisions

Let me know if you need any more

[{"id":"72cb34a0.98163c","type":"http request","z":"f8345d5a.acc34","name":"Get IOTAWATT 5 Min averages","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://172.16.101.200/query?select=[Solar,Consumption,Grid]&begin=s-300s&end=s&group=all&format=json&header=no","tls":"","persist":false,"proxy":"","authType":"","x":370,"y":80,"wires":[["376a717c.7da75e"]]},{"id":"f87b8853.7f5ca8","type":"inject","z":"f8345d5a.acc34","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":80,"wires":[["72cb34a0.98163c"]]},{"id":"376a717c.7da75e","type":"json","z":"f8345d5a.acc34","name":"","property":"payload","action":"","pretty":false,"x":660,"y":80,"wires":[["4dd71f06.3f2c3","1bc1bb36.c5e225","cce6356c.e9e678","dcedd617.b779d8"]]},{"id":"4dd71f06.3f2c3","type":"debug","z":"f8345d5a.acc34","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":820,"y":80,"wires":[]},{"id":"cce6356c.e9e678","type":"ui_gauge","z":"f8345d5a.acc34","name":"Total House Consumption","group":"d112f047.b0d51","order":4,"width":0,"height":0,"gtype":"gage","title":"House Consumption","label":"Watts","format":"{{payload[0][1]}}","min":"1000","max":"10000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"4000","seg2":"6000","x":890,"y":220,"wires":[]},{"id":"1bc1bb36.c5e225","type":"ui_gauge","z":"f8345d5a.acc34","name":"Solar Output","group":"d112f047.b0d51","order":3,"width":0,"height":0,"gtype":"gage","title":"Solar Output","label":"Watts","format":"{{payload[0][0]}}","min":0,"max":"11000","colors":["#b31b00","#e6e600","#60cb3a"],"seg1":"2000","seg2":"5000","x":850,"y":180,"wires":[]},{"id":"dcedd617.b779d8","type":"ui_gauge","z":"f8345d5a.acc34","name":"Power Useage","group":"d112f047.b0d51","order":5,"width":0,"height":0,"gtype":"gage","title":"Export/Import from Grid","label":"Watts","format":"{{payload[0][2]}}","min":"-9000","max":"10000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"0","seg2":"3000","x":860,"y":260,"wires":[]},{"id":"d112f047.b0d51","type":"ui_group","z":"","name":"House Energy","tab":"a30b3814.18c8b8","order":2,"disp":true,"width":"6","collapse":false},{"id":"a30b3814.18c8b8","type":"ui_tab","z":"","name":"Pool Control","icon":"dashboard","disabled":false,"hidden":false}]

Craig

1 Like

Thanks, Craig. I wanted to see how you are getting the info from iotawatt, although I can probably find examples. I also thought you were publishing the values to MQTT but I see that’s not the case.

So, the [Solar,Consumption,Grid] are Outputs you’ve configured?

Yes they are - sorry i am also publishing them to MQTT from within NR - i just did not post that up

Pretty straightforward if you are familiar with NR ?

Craig

1 Like

Yeah, I’ll have no problem if I go that way…other than learning the idiosyncrasies of another node.

Steve