electricitymaps / electricitymaps-contrib

The open source repository for Electricity Maps App and data parsers that enables a real-time visualisation of the CO2 emissions of electricity consumption
https://app.electricitymaps.com
GNU Affero General Public License v3.0
3.64k stars 954 forks source link

GB-NIR is down #3060

Open corradio opened 3 years ago

corradio commented 3 years ago

The GB-NIR parser is down:

Traceback (most recent call last):
  File "test_parser.py", line 132, in <module>
    print(test_parser())
  File "/Users/oliviercorradi/github/tmrowco/electricitymap/src/electricitymap/contrib/.venv/lib/python3.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/oliviercorradi/github/tmrowco/electricitymap/src/electricitymap/contrib/.venv/lib/python3.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/oliviercorradi/github/tmrowco/electricitymap/src/electricitymap/contrib/.venv/lib/python3.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/oliviercorradi/github/tmrowco/electricitymap/src/electricitymap/contrib/.venv/lib/python3.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "test_parser.py", line 65, in test_parser
    *args, target_datetime=target_datetime, logger=logging.getLogger(__name__)
  File "/Users/oliviercorradi/github/tmrowco/electricitymap/src/electricitymap/contrib/parsers/GB_NIR.py", line 214, in fetch_production
    production_data = get_data(production_url, target_datetime)
  File "/Users/oliviercorradi/github/tmrowco/electricitymap/src/electricitymap/contrib/parsers/GB_NIR.py", line 45, in get_data
    viewstategenerator = soup.find("input", attrs={'id': '__VIEWSTATEGENERATOR'})['value']
TypeError: 'NoneType' object is not subscriptable

It turns out the website has changed. I found out it uses the URL http://smartgriddashboard.eirgrid.com/DashboardService.svc/data?area=fuelmix&region=NI&datefrom=2020-01-01&dateto=2020-03-03, but changing the date has no effect. Unfortunately ENTSOE data is not good enough (there's a lot of missing data)

Here are suggested next steps:

FelixDQ commented 3 years ago

I have written an email to EIRGRID to see if we can get all the data needed. I will update when they respond

corradio commented 3 years ago

cc @Kongkille

FelixDQ commented 3 years ago

No response yet. We've tried reaching out to a couple more people to see if we can get the data.

The alternative would be to switch to ENTSOE. Unfortunately, the data from ENTSOE seems to be lagging a bit (~24 hours), so let's see if we can get real-time data before. I also reached out to ENTSOE to ask if they expect to be able to provide real-time data at some point.

lorrieq commented 3 years ago

Hey, I'm not familiar with the overall state of this issue or #2916 but a quick fix for the exchange would be to use _ELEXON.fetchexchange for the GB->GB-NIR flow. It should be as simple as changing the exchanges config.

VIKTORVAV99 commented 2 months ago

@corradio @FelixDQ can we close this issue or is it still relevant?

corradio commented 2 months ago

I'll let @FelixDQ comment as I don't have context anymore.