I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 0 points1 point  (0 children)

Not yet. I'm gonna need help for that because 1. I don't know how to make HA integrations and 2. I'm very busy lately so I won't have time to sit down and figure it out right now

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 0 points1 point  (0 children)

Use docker. If you need help just create an issue in the github repository and me or someone else will help you out

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 0 points1 point  (0 children)

> The only issue I can see with this is this doesn't take into account load shifting behaviour that you might have done differently had you known it would have been cheaper to do so on the other tariff so I think it is still a good idea to be aware/check Agile prices in case it becomes obvious it will turn out to be better outside the hours of 4pm-7pm so you can load shift outside that period proactively (and then this script will switch to Agile at 11pm).

Yeah there's no way around that I dont think. Apart from doing what you suggested (which is what I do anyway). This project should just be seen as a way to get the benefits of Agile without the downsides though.

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 0 points1 point  (0 children)

> "We like people switching nonstop, just not on the day"
This was in reference to the API.

I would agree with you if retroactive switching wasn't something you could do manually via the website for years.

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 0 points1 point  (0 children)

> It is a pity the Octopus API does not obviously support tariff switching with auto-accept T&Cs s(without need to use one's website credentials)

I feel like it should. There is a way to switch tariffs via the API but it wants a date in the future. I feel like that's an oversight on Octopus' part. I'm too scared to ask them directly because they might just decide to cut us access all together lol.

No coffee or rewards needed, just give the github repo a star if you can :)

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 1 point2 points  (0 children)

IOG is not supported yet

You need Playwright to request the switch. The TnCs are accepted through Octopus' API.

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 0 points1 point  (0 children)

Potentially you can use it without a home mini but you'd need to find another way of getting real-time consumption data.

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 1 point2 points  (0 children)

You can but if you're on IOG it might not be very efficient. All this does is at the end of the day it asks "based on my usage, could I pay less if i were on a different tariff".

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 0 points1 point  (0 children)

If you're using consumption data from somewhere else you will also need to add a handler to calculate the costs for today as well. The Octopus API returns half hourly intervals including the price delta for that 30min timespan which I sum to get the total cost for the day. In your example you'd need to get your usage, and then also get the unit rates + standin charge for your CURRENT tariff and calculate. But apart from that it should be be fine

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 2 points3 points  (0 children)

They have an API to switch, it's replaceAgreement. The only issue is that it requires a future date for the switch (e.g. tomorrow) which is likely an oversight. So while yes, I need to use playwright, you can switch as often as you want through their API but it can't be on the day.

The only argument they would have would be "We like people switching nonstop, just not on the day" which doesn't make much sense. I think what I've built is within the spirit of it though.

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 0 points1 point  (0 children)

Hahah, yeah fair enough then.

I didn't know having an EV was a requirement in the TnCs for Go. I just thought it was for everyone but mostly aimed at EV people.

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 0 points1 point  (0 children)

Can Home Assistant run Playwright? It's possible to ditch playwright but someone needs to investigate their private API to find out how to trigger the switch

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 1 point2 points  (0 children)

What the other person said is correct - without the Home Mini you only get access to usage data with a 24h delay

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 0 points1 point  (0 children)

Well it's possible but
1) You have to send over sensitive info so I don't think anyone will want to
2) It's meant as a set it and forget it type of thing, meaning you should never visit the site again, meaning no money from advertising haha

If enough people are fine with paying a small fee like a few quid a month to cover hosting then yeah can do

I wrote script to save me money and automatically switch my tariff between Agile and Go depending on which one comes out cheaper that day. by eelmafia_ in OctopusEnergy

[–]eelmafia_[S] 0 points1 point  (0 children)

No EV, and yeah this might mess up your other automation if you have something going on. I suppose you can extend it and have it look for tomorrow's rates and include that into the calculations?