Octopus Energy API

Get 30min meter date for a specified date from the Octopus Energy (UK) API

You will need to set your MPAN and Meter Serial Number and Octopus API Key in the Initial Inject Node along with the appropriate date period.

[{"id":"010402d423958e86","type":"http request","z":"588471cd.c1fe18","name":"GET Import","method":"GET","ret":"obj","paytoqs":"query","url":"","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"credentials":{},"x":430,"y":140,"wires":[["108fff787f41944e"]]},{"id":"f72551ba820dc87e","type":"inject","z":"588471cd.c1fe18","name":"","props":[{"p":"payload.period_from","v":"2022-01-01T00:00:00+0100","vt":"str"},{"p":"payload.period_to","v":"2022-01-01T23:59:00+0100","vt":"str"},{"p":"payload.page_size","v":"25000","vt":"str"},{"p":"mpan","v":"2200123456","vt":"str"},{"p":"meter","v":"19P987654","vt":"str"},{"p":"apikey","v":"sk_live_12345667980","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":140,"wires":[["5f637811b82bdf02"]]},{"id":"93203cac3d97bf12","type":"debug","z":"588471cd.c1fe18","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":910,"y":140,"wires":[]},{"id":"f0b71ef7a3aa5f4d","type":"split","z":"588471cd.c1fe18","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":770,"y":140,"wires":[["93203cac3d97bf12"]]},{"id":"108fff787f41944e","type":"change","z":"588471cd.c1fe18","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.results","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":140,"wires":[["f0b71ef7a3aa5f4d"]]},{"id":"5f637811b82bdf02","type":"template","z":"588471cd.c1fe18","name":"","field":"url","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"https://{{apikey}}:@api.octopus.energy/v1/electricity-meter-points/{{mpan}}/meters/{{meter}}/consumption","output":"str","x":280,"y":140,"wires":[["010402d423958e86"]]}]

Flow Info

Created 3 years, 6 months ago
Rating: 3.6666666666666665 3

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • debug (x1)
  • http request (x1)
  • inject (x1)
  • split (x1)
  • template (x1)

Tags

Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option