question

dune7 avatar image
dune7 asked

Octopus Agile API Support by Victron For Controlling Charging Off Peak Times

Thank you so much for the very informative webinar on 23/11/22.

Octopus Energy in the UK is disrupting the energy industry for good and their Kraken platform is in many countries bought by suppliers and growing.

Will Victron please look at integration with Octopus Kraken API to allow us to auto set charging times when energy prices are low and export when high?

“Works with Octopus” is a standard attained by many ESS systems and it would be great if Victron would look at putting this on their roadmap.

NodeRed and some technical challenges aren’t for all of us and I believe it would help in adoption of Victron into many domestic installations where people just aren’t getting the quality and support from certain other brands.

Standards to help home storage and EV take-up are so very crucial to environmental gains and the rapid change needed to combat climate change.

Many thanks for your great work. New Solar ESS Victron User in the UK, Installed by Callidus, another great cutting edge supplier and supporter of Victron.

battery chargingapioctopus
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

7 Answers
Jason - UK avatar image
Jason - UK answered ·

@Dune7 There is a simplistic solution to this. In short, use a IFTTT enabled time clock (like a Heatmiser Neostat 2 HW with hub), wire it into one of the relays on the Multiplus with an assistant for charge current controller, and set up an applet on IFTTT with Octopus Agile IFTTT service for charge when below £x, or charge 8 lowest cost half hour periods.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jameshoare1964 avatar image jameshoare1964 commented ·
@Jason - UK Thank you very helpful. Always great to unfreeze a way of thinking, and look for a simple solution instead. Presumably if one sets another applet on IFTT for charge negatively ie discharge for 8 highest half hour periods - that is job done.
2 Likes 2 ·
Richard Weir avatar image
Richard Weir answered ·
  1. @Jason - UK thanks for the tips, that sounds great. I’m just wondering how the heating controller is physically wired into the Multiplus 2 and how it’s configured with the ESS, some more detail would be helpful. I’m also a mechanical engineer and a heating engineer and doing some similar stuff as you. I’ve installed a Viessmann 150a heat pump and running it of 20kwh of PylonTech batteries, connected to Octopus Go.
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Jason - UK avatar image Jason - UK commented ·

@Richard Weir I use Heatmiser Neostats V2 for a lot of things. Even if you buy one of their thermostats, you can change the thermostat to time clock mode only which is actually cheaper than buying the Neostat V2 HW time clock. Set up an assistant for the current charge control to the relevant wired connection. It takes at bit of playing around to use a 3rd party controller with ESS & scheduled charge. In short, the assistant only throttles charging so inherently you set up your scheduled charge during periods of no potential solar generation, then use the time clock to allow or 'stop' the charge depending on when the cheap rate electric is.

My advise is use a cheap time clock to test your set up and see if it works for you as its not 100% perfect solution. Im working on a node red solution currently that Im aiming to be 100% perfect solution to charging on the Octopus Agile tariff.

1669625100557.png


1 Like 1 ·
1669625100557.png (161.2 KiB)
Richard Weir avatar image
Richard Weir answered ·

Hi @Jason - UK , Thanks for the tips most helpful. I have ordered a controller and see where it links in and have programed the assistant to take the other input. Like you say, i'll test it with another device first. What has been your experience of Octopus lowering the tariff? Cheers, Richard.

www.boilerbee.com


1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Jason - UK avatar image Jason - UK commented ·

@Richard Weir I've been following the Agile tariff for a while now and its defo a winner in the summer but the winter its difficult to tell because of the instability Truss brought to the energy markets. Things have been very stable since that woman left office.


My opinion is if you have battery storage to cover your daily usage, then the Octopus Go is the better tariff as you can charge on the 12p off-peak rate but you only get the SEG 4.1p/kWh for export. If not enough battery storage or no batteries at all, then then the Octopus Agile is best as the average rate on the Agile has been around the 20p mark other than between 3pm and 7pm providing you can shift your energy usage outside 3-7pm but the Agile then pays retail rates for export which last summer went well in excess of £1/kWh at times. If you have a PV array that as a year generates double your annual demand, then the Agile is a winner based on this winter and summer as the increased cost of energy on the Agile is noting compaired to how much you will earn on the Agile Export tariff.


Ideally the best thing is for you to assess yourself which is best for yourself using the data available. I use a app call 'OctopusCompair' which costs about £1 per month and then also the data on the below link. OctopusCompair can work out which is cheapest for you based on your usage as it takes your meter data and compares t against what ever tariff you select.

https://dashboards.energy-stats.uk/d/y9iWNjZMz/user-dashboard?orgId=1&var-area_name=Southern_England

0 Likes 0 ·
nw24 avatar image
nw24 answered ·

Since Victron have now introduced 1/2 time slots for DESS, I have developed a Node-Red solution to integrating Octopus Agile tariff prices.


Which gives me the following for yesterday and today.

1719516490091.png1719516540443.png

The Node-Red flow looksl like:

1719516647039.png

The Trigger takes the data from the great work on this link https://community.home-assistant.io/t/octopus-agile-display-tariff-in-graphs-tables-best-import-export-periods-all-done-using-node-red-and-jsonata/518762 and adding an addional Build and Save Tariff array to return it as £ rather than pence ready to send using VRM API. It reads a global array.

1719517299861.png

This is then split and the times are converted to local time and rejoined and then sorted into time order and then times from 23:00 - 22:59 and sorted by time order or 17:00 - 16:59. Its then converted to a JSON and appended to other data to inject into VRM API for the prices. Note this uses the Fixed price model and changes it twice a day.

My Node Red code for my additional flow if its useful (you will neeed to replace nnnn) with your VRM site id )

Most recent flow posted further down the thread.


(This is my first post with anything technical but I'm a real novice at this stuff, but learning fast!)


1719516490091.png (35.8 KiB)
1719516540443.png (40.9 KiB)
1719516647039.png (65.4 KiB)
1719517299861.png (86.8 KiB)
5 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

nw24 avatar image nw24 commented ·

See this thread for more updates

https://community.victronenergy.com/questions/171056/octopus-agile-api-support-by-victron-for-controlli.html

0 Likes 0 ·
flailingfox avatar image flailingfox commented ·

Thanks for this node :-) I've tried using it but its not working as yet - pretty sure I need to add a global variable called OctAgileTariff1 with a payload in that somehow, but not certain - if you look at your node red and look at your Global's what does it have there? It may be related but I also don't see where it calls octopus for the latest tariff information...

0 Likes 0 ·
nw24 avatar image nw24 flailingfox commented ·

Flailingfox

I used the work of https://community.home-assistant.io/t/octopus-agile-display-tariff-in-graphs-tables-best-import-export-periods-all-done-using-node-red-and-jsonata/518762 to get the tarriff array and then added an addtional node called build and save tariff array to convert from pence to GBP and create the global variable OctAgileTariff1. This then feeds the flow posted above.

The node is a duplicate of the orgional node with a modification to the code and looks like

1722428204769.png

and the code with the modified line is highlighted.

1722428277358.png


0 Likes 0 ·
1722428204769.png (52.1 KiB)
1722428353309.png (15.0 KiB)
flailingfox avatar image flailingfox nw24 commented ·

Thank you - yes, with a bit of trial and error I managed to work out I needed to run this all on the top of my home assistant stack rather than the "large" installation on my Venus install. One other thing to bear in mind with those looking at this thread is Victron now requires an API key to access the API, this is in preferences/Integrations (goto VRM, click back in the menu to 1 level above the site list, I always forget that level) and then you can generate the API key to add to node-red there! Thank you NW24 the node is working well and has imported today's rates straight in so going to run it through for a day or two before I switch Dynamic ESS on

0 Likes 0 ·
nw24 avatar image nw24 flailingfox commented ·

Glad that worked. I have modified my flow further since the above post to run my flow twice per day so that Dess always has a few hours ahead of accurate pricing. I will repost the revised node red flow.

0 Likes 0 ·
nw24 avatar image
nw24 answered ·

To add to my above post my Build and Save node export is:

[{"id":"50216fa86db98793","type":"change","z":"03e5198e519f6178","g":"e42010beae8f7fa5","name":"Build & Save Tariff Array","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.import#$i.{\t \"fullfrom\": valid_from,\t \"fullupto\": valid_to,\t \"date\": $substring(valid_from,0,10),\t \"from\": $substring(valid_from,11,5),\t \"to\": $substring(valid_to,11,5),\t \"price\": value_inc_vat /100\t}^(from)","tot":"jsonata"},{"t":"set","p":"OctAgileTariff1","pt":"global","to":"payload","tot":"msg","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":160,"wires":[[]]}]

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

nw24 avatar image
nw24 answered ·

As promised in an earlier comment - My latest flow following some refinements. A run at 16:10 to update between 23:00 today and 12:00 tomorrow and then re run at 18:30 incase the Agile data hadn't been published at 16:00. and then a run at 23:00 to load between 23:00 today and 23:00 tomorrow. Ensuring VRM DESS always has a few hours ahead accurate price data. (I dont know what will happen at Clock Change as I'm working in local time! might be out of sync for 2 days a year or not run). Need to replace NNNN below with your Victron Site ID.


[{"id":"f060f44fcacb9668","type":"group","z":"45f00bad4d9375ae","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["ad02a0a637157bf0","f602efd7caec1239","5480aa651015fe94","6b2b43e5b12afbea","5227185b1e8a081a","c0facf4b64b747dc","80f3c6b1f247af8b","a9a1fe36f995f974","4fef81d6bda35386","b6e543d7a0e1e214","d2fbcf1a96587afe","3f28e85712fab76c","24d8c08abd860a64","20dc892e06835175","f7db749c63690655","f956d69c8b47142a","75cf42b81a268321","04f5119009f4e7e5","bc77e28979176e07"],"x":14,"y":19,"w":1412,"h":342},{"id":"ad02a0a637157bf0","type":"vrm-api","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","vrm":"26857d65984e2624","name":"","api_type":"installations","idUser":"","users":"","idSite":"NNNN,"installations":"patch-dynamic-ess-settings","attribute":"","stats_interval":"","show_instance":false,"stats_start":"","stats_end":"","use_utc":false,"widgets":"","instance":"","vrm_id":"","country":"","b_max":"","tb_max":"","fb_max":"","tg_max":"","fg_max":"","b_cycle_cost":"","buy_price_formula":"","sell_price_formula":"","green_mode_on":"","feed_in_possible":"","feed_in_control_on":"","b_goal_hour":"","b_goal_SOC":"","store_in_global_context":false,"verbose":false,"x":1240,"y":200,"wires":[[]]},{"id":"f602efd7caec1239","type":"inject","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"Trigger 23:00","props":[{"p":"payload"}],"repeat":"","crontab":"*/15 23 * * *","once":false,"onceDelay":"30","topic":"","payload":"OctAgileTariff1","payloadType":"global","x":140,"y":120,"wires":[["c0facf4b64b747dc"]]},{"id":"5480aa651015fe94","type":"moment","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"Conv UTC to Local FromTime","topic":"","input":"payload.fullfrom","inputType":"msg","inTz":"ETC/utc","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm","locale":"C","output":"payload.from","outputType":"msg","outTz":"Europe/London","x":570,"y":120,"wires":[["a9a1fe36f995f974"]]},{"id":"6b2b43e5b12afbea","type":"change","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"Sort into time order","rules":[{"t":"set","p":"payload","pt":"msg","to":"/* look at latest prices, sorted by ascending date */\t\t\tpayload[[0..95]]^(fullfrom).{\t \"date\": date,\t \"from\": from,\t \"to\": to,\t \"price\": price\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":180,"wires":[["5227185b1e8a081a"]]},{"id":"5227185b1e8a081a","type":"change","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"take 23:00 to 23:00 @ 22:55","rules":[{"t":"set","p":"payload","pt":"msg","to":"/* look at latest prices, sorted by ascending time */\t/* pick the 24hr period 11pm to 11pm */\t\t\tpayload[[48..95]]^(from).{\t \"from\":from,\t \"to\":to,\t \"price\":price\t }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":180,"wires":[["4fef81d6bda35386"]]},{"id":"c0facf4b64b747dc","type":"split","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","property":"payload","x":350,"y":120,"wires":[["5480aa651015fe94"]]},{"id":"80f3c6b1f247af8b","type":"join","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"","mode":"auto","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"48","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":1090,"y":120,"wires":[["6b2b43e5b12afbea"]]},{"id":"a9a1fe36f995f974","type":"moment","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"Conv UTC to Local TOTime","topic":"","input":"payload.fullupto","inputType":"msg","inTz":"ETC/utc","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm","locale":"C","output":"payload.to","outputType":"msg","outTz":"Europe/London","x":860,"y":120,"wires":[["80f3c6b1f247af8b"]]},{"id":"4fef81d6bda35386","type":"json","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"","property":"payload","action":"str","pretty":false,"x":710,"y":200,"wires":[["b6e543d7a0e1e214"]]},{"id":"b6e543d7a0e1e214","type":"change","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"Apend input to VRM","rules":[{"t":"set","p":"payload","pt":"msg","to":"'{\t \"buyPriceSchedule\": [\t {\t \"days\":[0,1,2,3,4,5,6],\t \"schedule\":'\t & $.payload & '\t }\t ]\t}'","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":200,"wires":[["ad02a0a637157bf0"]]},{"id":"d2fbcf1a96587afe","type":"inject","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"Triger 16:10","props":[{"p":"payload"}],"repeat":"","crontab":"10 16 * * *","once":false,"onceDelay":"30","topic":"","payload":"OctAgileTariff1","payloadType":"global","x":130,"y":280,"wires":[["24d8c08abd860a64"]]},{"id":"3f28e85712fab76c","type":"moment","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"Conv UTC to Local FromTime","topic":"","input":"payload.fullfrom","inputType":"msg","inTz":"ETC/utc","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm","locale":"C","output":"payload.from","outputType":"msg","outTz":"Europe/London","x":590,"y":280,"wires":[["f7db749c63690655"]]},{"id":"24d8c08abd860a64","type":"split","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","property":"payload","x":370,"y":280,"wires":[["3f28e85712fab76c"]]},{"id":"20dc892e06835175","type":"join","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"","mode":"auto","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"48","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":1110,"y":280,"wires":[["f956d69c8b47142a"]]},{"id":"f7db749c63690655","type":"moment","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"Conv UTC to Local TOTime","topic":"","input":"payload.fullupto","inputType":"msg","inTz":"ETC/utc","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm","locale":"C","output":"payload.to","outputType":"msg","outTz":"Europe/London","x":880,"y":280,"wires":[["20dc892e06835175"]]},{"id":"f956d69c8b47142a","type":"change","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"Sort into time order","rules":[{"t":"set","p":"payload","pt":"msg","to":"/* look at latest prices, sorted by date */\t\tpayload[[0..95]]^(fullfrom).{\t \"date\": date,\t \"from\": from,\t \"to\": to,\t \"price\": price\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":220,"wires":[["75cf42b81a268321"]]},{"id":"75cf42b81a268321","type":"change","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"take 12:00 to 12:00 @16:55","rules":[{"t":"set","p":"payload","pt":"msg","to":"/* look at latest prices, sorted by ascending time */\t/* pick 24 hours from 12 PM (Midday) */\t\tpayload[[26..73]]^(from).{\t \"from\":from,\t \"to\":to,\t \"price\":price\t }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":220,"wires":[["4fef81d6bda35386"]]},{"id":"04f5119009f4e7e5","type":"comment","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"Send Agile Import Schedule to VRM","info":"","x":180,"y":60,"wires":[]},{"id":"bc77e28979176e07","type":"inject","z":"45f00bad4d9375ae","g":"f060f44fcacb9668","name":"Triger 18:30","props":[{"p":"payload"}],"repeat":"","crontab":"30 18 * * *","once":false,"onceDelay":"30","topic":"","payload":"OctAgileTariff1","payloadType":"global","x":130,"y":320,"wires":[["24d8c08abd860a64"]]},{"id":"26857d65984e2624","type":"config-vrm-api","name":"Home Integration"}]

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

fellside avatar image
fellside answered ·

Nw24
I dont know if anyone else has had a problem. When I try to inport the code above I get the following error
This is the same if I substitute my site ID for NNNN.


SyntaxError: JSON.parse: expected ',' or '}' after property value in object at line 1 column 793 of the JSON data.
ite":"NNNN,"installation


My Node red intall is up to date.

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

chrigu avatar image chrigu commented ·

The code above is not quite a valid JSON, it should be

"users":"",
"idSite":"NNNN",
"installations":"patch-dynamic-ess-settings",

NNNN is a variable, so it needs to be enclosed in a leading and a lagging "

So if you edit the code by adding your siteID, make sure that its got both quotation marks

0 Likes 0 ·
Show more comments

Related Resources

VictronConnect VE.Bus charging manual  

Additional resources still need to be added for this topic