electricitymaps / bloom-contrib

Making carbon footprint data available to everyone.
https://www.bloomclimate.com
MIT License
435 stars 104 forks source link

Octopus Energy #33

Open corradio opened 5 years ago

corradio commented 5 years ago

An api is available here: https://developer.octopus.energy/docs/api/

lacexd commented 4 years ago

I'd love to work on this!

AyrtonB commented 4 years ago

Can access live and historical prices without an API key through this endpoint: https://energy-db.energy-stats.uk/api/datasources/proxy/1/query

Queries are formed like this: https://energy-db.energy-stats.uk/api/datasources/proxy/1/query?db=octopus&q=SELECT%20distinct(%22unit_price%22)%20FROM%20%22agile%22%20WHERE%20time%20%3E%3D%201584316800000ms%20and%20time%20%3C%3D%201584403199999ms%20GROUP%20BY%20time(30m)%2C%20%22area_name%22%20fill(previous)&epoch=ms

Is the plan to get users to upload their API keys so that their consumption can be logged in real-time?

sorensvejstrup commented 4 years ago

Hi @AyrtonB We need to provide at token login for other upcoming integrations, so I believe we can use the same solution. What do you think?

corradio commented 4 years ago

There's a GraphQL endpoint (see https://developer.octopus.energy/docs/api/#graphql-api) which enables using an existing username/password. @lacexd @AyrtonB is that something you can help out with?

AyrtonB commented 4 years ago

Yeah should be able to help out with that. What format does northapp need the data to be in?

corradio commented 4 years ago

https://github.com/tmrowco/northapp-contrib#electricity-consumption-activity-formatting should cover it, but I suggest look at other existing implementations here: https://github.com/tmrowco/northapp-contrib/tree/master/integrations/electricity

AyrtonB commented 4 years ago

Ah hdan't realised that the NorthApp parsers are all JS unlike the Python ElectricityMap ones. Definitely not the best at JS so I'm probably not the person for this one unless there's a way to integrate a Python parser?