I have an energy meter which I would like to accumulate a cost per unit of electric. Does anybody have a flow I can copy and paste or guid me hoe I can accumulate my Kwh and put that into a cost per Kwh per Hour and then over a 24 hour period and then save that at midnight so it will say you used £xx.xx in Kwh yesterday?
This is my current flow.
Thanks for any advice
Paul.
[{"id":"ff4ea44f.0119c","type":"tab","label":"OR-WE-514 ORNO","disabled":false,"info":""},{"id":"1871b2a2.91984d","type":"modbus-read","z":"ff4ea44f.0119c","name":"Voltage 0x0131","topic":"Voltage","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"001","dataType":"HoldingRegister","adr":"0x0131","quantity":"1","rate":"5","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"ad952d25.37b4","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":120,"y":40,"wires":[["8efb0f77.aecbf8"],[]]},{"id":"8efb0f77.aecbf8","type":"range","z":"ff4ea44f.0119c","minin":"0","maxin":"10000","minout":"0","maxout":"100","action":"scale","round":true,"property":"payload","name":"","x":360,"y":20,"wires":[["7812d783.a5fa8"]]},{"id":"dfcd44d2.a235b","type":"modbus-read","z":"ff4ea44f.0119c","name":"Frequency 0x0130","topic":"Frequency","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"001","dataType":"HoldingRegister","adr":"0x130","quantity":"1","rate":"5","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"ad952d25.37b4","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":130,"y":100,"wires":[["b6849155.ac06d"],[]]},{"id":"b6849155.ac06d","type":"range","z":"ff4ea44f.0119c","minin":"0","maxin":"10000","minout":"0","maxout":"100","action":"scale","round":true,"property":"payload","name":"","x":360,"y":80,"wires":[["c5fb8aca.38f2a"]]},{"id":"1fa4c271.a3aaa6","type":"modbus-read","z":"ff4ea44f.0119c","name":"Power Factor 0x0158","topic":"PowerFactor","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"001","dataType":"HoldingRegister","adr":"0x158","quantity":"1","rate":"5","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"ad952d25.37b4","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":140,"y":160,"wires":[["64249f3f.55a16"],[]]},{"id":"64249f3f.55a16","type":"range","z":"ff4ea44f.0119c","minin":"0","maxin":"1000","minout":"0","maxout":"100","action":"scale","round":false,"property":"payload","name":"","x":360,"y":140,"wires":[["23c54e0d.6617c2"]]},{"id":"be7e1db7.046e88","type":"modbus-read","z":"ff4ea44f.0119c","name":"0x0150 - Apparent Power","topic":"Apparent Power","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"001","dataType":"HoldingRegister","adr":"0x0150","quantity":"2","rate":"5","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"ad952d25.37b4","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":150,"y":400,"wires":[["be65e0aa.a3bb98"],[]]},{"id":"3aa5f8e9.413158","type":"split","z":"ff4ea44f.0119c","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":350,"y":200,"wires":[["1fb070a5.64a88f"]]},{"id":"1fb070a5.64a88f","type":"switch","z":"ff4ea44f.0119c","name":"","property":"parts.index","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":490,"y":200,"wires":[["31e529fc.b4acf6"],["31e529fc.b4acf6"]]},{"id":"31e529fc.b4acf6","type":"join","z":"ff4ea44f.0119c","name":"Amps","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"1","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":650,"y":200,"wires":[["631716ec.763cd8"]]},{"id":"631716ec.763cd8","type":"change","z":"ff4ea44f.0119c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"Amps","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":200,"wires":[["3b7899f6.f90756"]]},{"id":"3b7899f6.f90756","type":"function","z":"ff4ea44f.0119c","name":"32bit register coversion /100","func":"var low = msg.payload[1];\nvar high = msg.payload[0];\n\nvar lowhex = low.toString(16);\nvar highhex = high.toString(16);\n\nvar total = ((high << 16) + low) / 100;\n\nmsg.payload = total;\n//msg.measurement = \"W\";\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1140,"y":300,"wires":[["4d17f2f4.ca24e4"]]},{"id":"4d17f2f4.ca24e4","type":"switch","z":"ff4ea44f.0119c","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Amps","vt":"str"},{"t":"eq","v":"ActivePower","vt":"str"},{"t":"eq","v":"ReActivePower","vt":"str"},{"t":"eq","v":"ApparentPower","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":490,"y":600,"wires":[["7837a53c.c21a5c"],["922022df.a495"],["bed9452e.0ad7d"],["db99d604.b9efe"]]},{"id":"7837a53c.c21a5c","type":"range","z":"ff4ea44f.0119c","minin":"0","maxin":"1000","minout":"0","maxout":"100","action":"scale","round":false,"property":"payload","name":"","x":640,"y":560,"wires":[["921b3e6d.04fc48","c5b11e7.79146e","6d70ed49.a78664"]]},{"id":"f1b7c9e3.8b9328","type":"split","z":"ff4ea44f.0119c","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":350,"y":260,"wires":[["66bbb2c3.9673ec"]]},{"id":"66bbb2c3.9673ec","type":"switch","z":"ff4ea44f.0119c","name":"","property":"parts.index","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":490,"y":260,"wires":[["69238cc4.e41f64"],["69238cc4.e41f64"]]},{"id":"69238cc4.e41f64","type":"join","z":"ff4ea44f.0119c","name":"ActivePower","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"1","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":670,"y":260,"wires":[["9efdce11.8b45"]]},{"id":"9efdce11.8b45","type":"change","z":"ff4ea44f.0119c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"ActivePower","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":260,"wires":[["3b7899f6.f90756"]]},{"id":"922022df.a495","type":"range","z":"ff4ea44f.0119c","minin":"0","maxin":"1000","minout":"0","maxout":"100","action":"scale","round":false,"property":"payload","name":"","x":640,"y":600,"wires":[["a4e14454.9845f8"]]},{"id":"c58848b7.d50ac8","type":"split","z":"ff4ea44f.0119c","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":350,"y":340,"wires":[["d8bea899.b762c"]]},{"id":"d8bea899.b762c","type":"switch","z":"ff4ea44f.0119c","name":"","property":"parts.index","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":490,"y":340,"wires":[["f7d477c8.62ff78"],["f7d477c8.62ff78"]]},{"id":"f7d477c8.62ff78","type":"join","z":"ff4ea44f.0119c","name":"ReActivePower","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"1","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":680,"y":340,"wires":[["ea35c814.cee85"]]},{"id":"ea35c814.cee85","type":"change","z":"ff4ea44f.0119c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"ReActivePower","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":340,"wires":[["3b7899f6.f90756"]]},{"id":"bed9452e.0ad7d","type":"range","z":"ff4ea44f.0119c","minin":"0","maxin":"1000","minout":"0","maxout":"100","action":"scale","round":false,"property":"payload","name":"","x":640,"y":640,"wires":[["8f63947a.847dc8"]]},{"id":"d5fdc007.9142e","type":"modbus-read","z":"ff4ea44f.0119c","name":"0x0148 - Reactive Power","topic":"Reactive Power","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"001","dataType":"HoldingRegister","adr":"0x0148","quantity":"2","rate":"5","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"ad952d25.37b4","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":150,"y":340,"wires":[["c58848b7.d50ac8"],[]]},{"id":"5535c8f6.485f08","type":"modbus-read","z":"ff4ea44f.0119c","name":"0x0140 - Active Power","topic":"Active Power","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"001","dataType":"HoldingRegister","adr":"0x0140","quantity":"2","rate":"5","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"ad952d25.37b4","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":140,"y":280,"wires":[["f1b7c9e3.8b9328"],[]]},{"id":"841ac646.b59d8","type":"modbus-read","z":"ff4ea44f.0119c","name":"0x0139 - Amps","topic":"Amps","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"001","dataType":"HoldingRegister","adr":"0x0139","quantity":"2","rate":"1","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"ad952d25.37b4","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":120,"y":220,"wires":[["3aa5f8e9.413158"],[]]},{"id":"be65e0aa.a3bb98","type":"split","z":"ff4ea44f.0119c","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":350,"y":400,"wires":[["1c71a45e.ae44d4"]]},{"id":"1c71a45e.ae44d4","type":"switch","z":"ff4ea44f.0119c","name":"","property":"parts.index","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":490,"y":400,"wires":[["91178ddf.686fc"],["91178ddf.686fc"]]},{"id":"91178ddf.686fc","type":"join","z":"ff4ea44f.0119c","name":"ApparentPower","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"1","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":680,"y":400,"wires":[["914db8ab.86291"]]},{"id":"914db8ab.86291","type":"change","z":"ff4ea44f.0119c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"ApparentPower","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":400,"wires":[["3b7899f6.f90756"]]},{"id":"db99d604.b9efe","type":"range","z":"ff4ea44f.0119c","minin":"0","maxin":"1000","minout":"0","maxout":"100","action":"scale","round":false,"property":"payload","name":"","x":640,"y":680,"wires":[["94cd589f.95fcd8"]]},{"id":"7812d783.a5fa8","type":"influxdb out","z":"ff4ea44f.0119c","influxdb":"ef6b85bb.96471","name":"","measurement":"Voltage","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":570,"y":20,"wires":[]},{"id":"921b3e6d.04fc48","type":"influxdb out","z":"ff4ea44f.0119c","influxdb":"ef6b85bb.96471","name":"","measurement":"Amps","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":850,"y":560,"wires":[]},{"id":"a4e14454.9845f8","type":"influxdb out","z":"ff4ea44f.0119c","influxdb":"ef6b85bb.96471","name":"","measurement":"ActivePower","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":870,"y":600,"wires":[]},{"id":"8f63947a.847dc8","type":"influxdb out","z":"ff4ea44f.0119c","influxdb":"ef6b85bb.96471","name":"","measurement":"ReActivePower","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":880,"y":640,"wires":[]},{"id":"c5fb8aca.38f2a","type":"influxdb out","z":"ff4ea44f.0119c","influxdb":"ef6b85bb.96471","name":"","measurement":"Frequency","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":580,"y":80,"wires":[]},{"id":"23c54e0d.6617c2","type":"influxdb out","z":"ff4ea44f.0119c","influxdb":"ef6b85bb.96471","name":"","measurement":"PowerFactor","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":590,"y":140,"wires":[]},{"id":"94cd589f.95fcd8","type":"influxdb out","z":"ff4ea44f.0119c","influxdb":"ef6b85bb.96471","name":"","measurement":"ApparentPower","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":880,"y":680,"wires":[]},{"id":"c5b11e7.79146e","type":"ui_text","z":"ff4ea44f.0119c","group":"cf7e1722.e9c28","order":12,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":1020,"y":520,"wires":[]},{"id":"6d70ed49.a78664","type":"ui_chart","z":"ff4ea44f.0119c","name":"","group":"cf7e1722.e9c28","order":13,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1120,"y":580,"wires":[[]]},{"id":"ad952d25.37b4","type":"modbus-client","z":"","name":"Serial","clienttype":"serial","bufferCommands":true,"stateLogEnabled":true,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"even","serialConnectionDelay":"100","unit_id":1,"commandDelay":1,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":false},{"id":"ef6b85bb.96471","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"home","name":"Influx","usetls":false,"tls":"","influxdbVersion":"1.x","url":"http://localhost:8086","rejectUnauthorized":true},{"id":"cf7e1722.e9c28","type":"ui_group","z":"","name":"Spa Charts","tab":"c1c558a3.75e47","order":2,"disp":true,"width":"20","collapse":false},{"id":"c1c558a3.75e47","type":"ui_tab","z":"","name":"Spa","icon":"dashboard","disabled":false,"hidden":false}]