Daily consumption and costs of energy

This flow calculates and visualizes the consumption and costs of the current day. Data input is a MQTT device, in this case the WLAN ACM-ESP gasmeter interface. In node "consumption to cost" you can adjust the parameters for the calculation of costs.

let Z = 0.93; // Zustandszahl
let H = 11.3; //Brennwert kWh / Nm³
let c = 14.32; // Cent / kWh
[{"id":"fc976a32.05c5d8","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"7774c3a.676dc3c","type":"mqtt in","z":"fc976a32.05c5d8","name":"","topic":"home/acm-esp/38941273","qos":"2","datatype":"json","broker":"cebc4daa.87b768","x":150,"y":160,"wires":[["6a25e30d.fe0734"]]},{"id":"6a25e30d.fe0734","type":"change","z":"fc976a32.05c5d8","name":"m³","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.values[0].value_scaled","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":160,"wires":[["2e405597.1f7372","7b3b8862.c2d13","17b0e0a0.b4055f"]]},{"id":"2e405597.1f7372","type":"change","z":"fc976a32.05c5d8","name":"set current","rules":[{"t":"set","p":"volume","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":100,"wires":[[]]},{"id":"ce991f81.aee358","type":"inject","z":"fc976a32.05c5d8","name":"newday","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 00 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":240,"wires":[["ea23b72c.4a8bb"]]},{"id":"ea23b72c.4a8bb","type":"change","z":"fc976a32.05c5d8","name":"set day start","rules":[{"t":"set","p":"day_start_volume","pt":"flow","to":"volume","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":240,"wires":[["7b3b8862.c2d13"]]},{"id":"7b3b8862.c2d13","type":"function","z":"fc976a32.05c5d8","name":"calc consumption of today","func":"if (!flow.get(\"day_start_volume\"))\n    flow.set(\"day_start_volume\", flow.get(\"volume\"));\n    \nmsg.payload = flow.get(\"volume\") - flow.get(\"day_start_volume\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":520,"y":240,"wires":[["2637601d.7bd238","1b43f673.cd5282"]]},{"id":"2637601d.7bd238","type":"ui_text","z":"fc976a32.05c5d8","group":"d15c50bb.6b0f38","order":0,"width":0,"height":0,"name":"day consumption","label":"Tagesverbrauch","format":"{{msg.payload | number:3}} m³","layout":"row-spread","x":790,"y":240,"wires":[]},{"id":"1b43f673.cd5282","type":"function","z":"fc976a32.05c5d8","name":"consumption to cost","func":"let Z = 0.93; // Zustandszahl\nlet H = 11.3; //Brennwert kWh / Nm³\nlet c = 14.32; // Cent / kWh\nmsg.payload = msg.payload * Z * H * c / 100;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":500,"y":320,"wires":[["e3bb58af.2e109"]]},{"id":"e3bb58af.2e109","type":"ui_text","z":"fc976a32.05c5d8","group":"d15c50bb.6b0f38","order":0,"width":0,"height":0,"name":"day costs","label":"Tageskosten","format":"{{msg.payload | number:2}} €","layout":"row-spread","x":700,"y":320,"wires":[]},{"id":"17b0e0a0.b4055f","type":"ui_text","z":"fc976a32.05c5d8","group":"d15c50bb.6b0f38","order":0,"width":0,"height":0,"name":"Meter","label":"Zählerstand","format":"{{msg.payload | number:3}} m³","layout":"row-spread","x":690,"y":160,"wires":[]},{"id":"cebc4daa.87b768","type":"mqtt-broker","name":"","broker":"koepi.fritz.box","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"d15c50bb.6b0f38","type":"ui_group","name":"Energie","tab":"3c9b4e17.5d49ea","order":7,"disp":true,"width":"6","collapse":false},{"id":"3c9b4e17.5d49ea","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Flow Info

Created 1 year, 5 months ago
Rating: 5 1

Owner

Actions

Rate:

Node Types

Core
  • change (x3)
  • function (x2)
  • inject (x1)
  • mqtt in (x1)
  • mqtt-broker (x1)
Other
  • tab (x1)
  • ui_group (x1)
  • ui_tab (x1)
  • ui_text (x3)

Tags

  • gas
  • elster
  • acm
  • acm-esp
  • honeywell
  • BK-G
  • Absolute-Encoder
  • AE2
  • AE3
  • AE5
  • energy
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option