diff --git a/config/zones/MN.yaml b/config/zones/MN.yaml index f2d53922ba..43610147d2 100644 --- a/config/zones/MN.yaml +++ b/config/zones/MN.yaml @@ -32,6 +32,9 @@ emissionFactors: datetime: '2020-01-01' source: IEA 2020; assumes 92.85% coal, 5.78%% oil, 1.37% hydro in unknown value: 729.1 + - datetime: '2024-11-25' + source: IEA 2020; assumes 94.14% coal, 5.86% oil in unknown + value: 739 lifecycle: battery discharge: - datetime: '2023-01-01' @@ -46,6 +49,9 @@ emissionFactors: datetime: '2020-01-01' source: IEA 2020; assumes 92.85% coal, 5.78%% oil, 1.37% hydro in unknown value: 799.2 + - datetime: '2024-11-25' + source: IEA 2020; assumes 94.14% coal, 5.86% oil in unknown + value: 810 fallbackZoneMixes: powerOriginRatios: - _source: Electricity Maps, 2023 average @@ -68,11 +74,15 @@ isLowCarbon: - _url: https://www.iea.org/fuels-and-technologies/electricity datetime: '2020-01-01' value: 0.0137 + - datetime: '2024-11-25' + value: 0 isRenewable: unknown: - _url: https://www.iea.org/fuels-and-technologies/electricity datetime: '2020-01-01' value: 0.0137 + - datetime: '2024-11-25' + value: 0 parsers: consumption: MN.fetch_consumption production: MN.fetch_production diff --git a/parsers/MN.py b/parsers/MN.py index d100f8065b..d792d32108 100644 --- a/parsers/MN.py +++ b/parsers/MN.py @@ -22,10 +22,12 @@ JSON_QUERY_TO_SRC = { "time": "date", "consumptionMW": "syssum", + "thermalMW": "dts", "solarMW": "sumnar", - "windMW": "sums", + "windMW": "sumsalhit", "importMW": "energyimport", # positive = import "temperatureC": "t", # current temperature + "batteryMW": "Songino" } @@ -33,7 +35,7 @@ def parse_json(web_json: dict, logger: Logger, zone_key: ZoneKey) -> dict[str, A """ Parse the fetched JSON data to our query format according to JSON_QUERY_TO_SRC. Example of expected JSON format present at URL: - {"date":"2023-06-27 18:00:00","syssum":"869.37","sumnar":42.34,"sums":119.79,"energyimport":"49.58"} + {"date":"2024-11-23 06:00:00","syssum":"1133.6","dts":987.4,"sumnar":-0.2,"sumsalhit":17.2,"energyimport":"129.4","t":"-14.5","Songino":"0.0"} """ # Validate first if keys in fetched dict match expected keys @@ -99,6 +101,7 @@ def fetch_production( # 'unknown' consists of 92.8% coal, 5.8% oil and 1.4% hydro as per 2020; sources: IEA and IRENA statistics. query_data["leftoverMW"] = round( query_data["consumptionMW"] + - query_data["thermalMW"] - query_data["importMW"] - query_data["solarMW"] - query_data["windMW"], @@ -108,16 +111,20 @@ def fetch_production( prod_mix = ProductionMix() prod_mix.add_value("solar", query_data["solarMW"]) prod_mix.add_value("wind", query_data["windMW"]) - prod_mix.add_value("unknown", query_data["leftoverMW"]) + prod_mix.add_value("unknown", query_data["thermalMW"]) # Coal + oil according to https://www.iea.org/countries/mongolia/electricity + prod_mix.add_value("hydro", query_data["leftoverMW"]) # Only generation type not accounted for https://www.iea.org/countries/mongolia/electricity + + storage_mix = StorageMix(battery=batteryMW * -1, hydro=None) # Based on how imports are displayed, I assume positive = providing to grid, negative = withdrawing from grid applies to battery as well. prod_breakdown_list = ProductionBreakdownList(logger) prod_breakdown_list.append( datetime=query_data["time"], zoneKey=zone_key, source="https://ndc.energy.mn/", + storage=storage_mix, production=prod_mix, ) - + return prod_breakdown_list.to_list()