Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instantaneous power cost #155

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

bwduncan
Copy link
Contributor

I have just switched to Octopus, looking forward to a smart meter and switching to agile. This means I've been spending a lot more time staring at the agile app 😄 I noticed that a couple of things weren't quite right: The graph never updates unless you press a button, and the "Import now" display showed power even if you clicked the "Cost" button. I think this was the intention, from looking at the code. This PR fixes both of these things, and removes some cruft.

I've tested this on my emonpi and it works well. More testing would be welcome, though.

I have solar PV but I'm not signing up to the Octopus export tariff. This means that the app will show nonsense when I am exporting. This could be fixed for myself by adding a fixed export price config option, and I think it would be trivial to make it work for Octopus export, too. If I get the time later I may add to this PR. Any feedback on whether allowing the flexibility in the app to do solar but without Octopus's FIT would be welcome.

Please pull!

- Nothing updated the graph. Call graph_draw from updater which is
called every 5s.
- Remove legacy viewcostenergy.
- Add a currency symbol setting, defaults to £.
- Update the power_now value with agile and consumption data for cost,
if we have it.
@bwduncan
Copy link
Contributor Author

I've been running this for a few days and I've noticed that it puts an immense load on the browser, and probably the server too.

Reloading the agile, outgoing and carbonintensity feeds every 5s is excessive, the first two only change once a day! I've now moved those out into a separate function and I'm testing it.

@TrystanLea
Copy link
Member

Thanks @bwduncan this is a good option to include.

It looks like the currency is only being applied to the end result, I wonder if actually modifying the outgoing data array to be a fixed amount would be a better approach? Here's part of a suggestion:

https://github.com/emoncms/app/compare/fixed_export?expand=1

  • The original section that fetched the outgoing section is now inside an if statement checking if fixed_export is false.
  • Above that within the agile import section the outgoing data array is now created using the timestamps from the import data but with a fixed value given by fixed_export.
  • It just needs the fixed export value defined in the config I think to complete?

@bwduncan
Copy link
Contributor Author

bwduncan commented Mar 11, 2021

Hi Trystan,

Thanks for replying, I really appreciate your feedback 😄

That looks like exactly the sort of thing I had in mind. I've patched my local copy and I will run with it for a few days to see if it does the job. The first thing I noticed is that it adds VAT 😆 but apart from that it works exactly as I expected.

I actually made another minor change here to do with showing the currency. Because a cost per hour is almost always less than a pound, I didn't like looking at £0.0015/hr, much nicer to read 0.15p/hr instead. I'll push that commit in a bit. Since this app is only really useful with Octopus, therefore probably only in the UK, I'm not sure if it makes sense to allow users to change the units. I left it in anyway, since Octopus is in the US at least it's probably only a matter of time...

Bruce

@bwduncan
Copy link
Contributor Author

I've realised that what I get is a generation tariff, not export. Is a fixed export tariff useful to anyone?

@TrystanLea
Copy link
Member

Thanks @bwduncan, do Octopus provide a fixed export tariff or is it just Outgoing or a generation tariff?

@bwduncan
Copy link
Contributor Author

Hi @TrystanLea ,

I looked into this a bit and realised the I'm getting a bum deal off British Gas. Who is surprised?

I should not have been surprised that generation and export tariffs are treated separately. I had assumed that you have to get both from the same FIT licensee. Tomorrow I will phone BG and ask if I can opt out of the export part, but keep the reasonably generous generation tariff. I'm getting 3.9p/kWh on 50% deemed export. I think I can do better on octopus.

As for the export tariff, it looks like Octopus offer a fixed (5.5p/kWh) and an agile tariff, which this app already supports. I think those two are sufficient for the scope of this app. While it might be cute to also have a generation tariff, it's not really necessary.

https://octopus.energy/blog/outgoing/

I've been a bit busy lately but I'll see if I can conjure another commit this week.

Thanks 😄
Bruce

@TrystanLea
Copy link
Member

Good to hear thanks @bwduncan !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants