{"id":13599537,"url":"https://github.com/custom-components/nordpool","last_synced_at":"2025-05-15T09:04:19.642Z","repository":{"id":37965754,"uuid":"201805130","full_name":"custom-components/nordpool","owner":"custom-components","description":"This component allows you to pull in the energy prices into Home-Assistant.","archived":false,"fork":false,"pushed_at":"2025-05-01T20:06:05.000Z","size":434,"stargazers_count":509,"open_issues_count":43,"forks_count":121,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-05-15T09:03:37.790Z","etag":null,"topics":["custom-component","energy-prices","hacs","homeassistant","nordpool","sensor"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/custom-components.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-08-11T19:16:00.000Z","updated_at":"2025-05-10T19:25:09.000Z","dependencies_parsed_at":"2024-06-16T20:40:06.341Z","dependency_job_id":"0eb7996f-1827-4eea-9113-67896a237cc2","html_url":"https://github.com/custom-components/nordpool","commit_stats":{"total_commits":207,"total_committers":46,"mean_commits":4.5,"dds":"0.42028985507246375","last_synced_commit":"46e66ba4703aec93fb5b91c49e1459277c432d3a"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custom-components%2Fnordpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custom-components%2Fnordpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custom-components%2Fnordpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custom-components%2Fnordpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/custom-components","download_url":"https://codeload.github.com/custom-components/nordpool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310513,"owners_count":22049468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-component","energy-prices","hacs","homeassistant","nordpool","sensor"],"created_at":"2024-08-01T17:01:06.198Z","updated_at":"2025-05-15T09:04:19.635Z","avatar_url":"https://github.com/custom-components.png","language":"Python","readme":"# Nord Pool integration for Home Assistant\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=MAXZPYVPD8XS6)\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/2ys3cdCZk)\n\nNord Pool is a service provider that operates an electricity market and power system services, including the exchange of electricity on a spot market Nordics and Baltic countries.\n\nThis integration provides the spot market (hourly) electricity prices for the Nordic, Baltic and part of Western Europe.\n\nThe Nordpool sensor provides the current price with today's and tomorrow's prices as attributes. Prices become available around 13:00.\n\n[ApexCharts](https://github.com/RomRider/apexcharts-card) card is recommended for visualization of the data in Home Assistant.\u003cbr\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/5879533/210006998-d8ebd401-5a92-471d-9072-4e6b1c69b779.png\" width=\"500\"/\u003e\n\n### Table of Contents\n**[Installation](#installation)**\u003cbr\u003e\n**[Usage](#usage)**\u003cbr\u003e\n**[Other](#other)**\u003cbr\u003e\n**[Troubleshooting](#troubleshooting)**\u003cbr\u003e\n\n### Getting started\n- Video tutorial: [variable energy prices in HA](https://youtu.be/NFJ510uhswY) by Smart Home Junkie\n- Written guide: [Nordpool and ApexChart](https://www.creatingsmarthome.com/index.php/2022/09/17/home-assistant-nord-pool-spot-prices-and-how-to-automate-devices-for-cheapest-hours/) by Creating Smart Home\n- Community: [Nordpool integration](https://community.home-assistant.io/t/any-good-ideas-are-welcome-nordpool-energy-price-per-hour/) on Home Assistant Community\n- Cheapest hours sensor: [Cheapest Energy Hours](https://github.com/TheFes/cheapest-energy-hours) to create an sensor with the cheapest hours\n\n## Installation\n\n### Option 1: HACS\n\n- Follow [![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=custom-components\u0026repository=nordpool\u0026category=integration) and install it\n- Restart Home Assistant\n\n  *or*\n- Go to `HACS` -\u003e `Integrations`,\n- Select `+`,\n- Search for `nordpool` and install it,\n- Restart Home Assistant\n\n### Option 2: Manual\nDownload the [latest release](https://github.com/custom-components/nordpool/releases)\n\n```bash\ncd YOUR_HASS_CONFIG_DIRECTORY    # same place as configuration.yaml\nmkdir -p custom_components/nordpool\ncd custom_components/nordpool\nunzip nordpool-X.Y.Z.zip\nmv nordpool-X.Y.Z/custom_components/nordpool/* .\n```\n\n## Usage\n\n### Configuration Variables\n| Configuration        | Required | Description                   |\n|----------------------| -------- | ----------------------------- |\n| Region               | **yes**  | Country/region to get the energy prices for. See Country/region codes below for details.|\n| Currency             | no       | *Default: local currency* \u003cbr\u003e Currency used to fetch the prices from the API.|\n| Include VAT          | no       | *Default: true* \u003cbr\u003e Add Value Added Taxes (VAT) or not.|\n| Decimal precision    | no       | *Default: 3* \u003cbr\u003e Energy price rounding precision. |\n| Low price percentage | no       | *Default: 1* \u003cbr\u003e Percentage of average price to set the low price attribute. \u003cbr\u003e IF hour_price \u003c average * low_price_cutoff \u003cbr\u003e THEN low_price = True \u003cbr\u003e ELSE low_price = False|\n| Price in cents       | no       | *Default: false* \u003cbr\u003e Display price in cents in stead of (for example) Euros.|\n| Energy scale         | no       | *Default: kWh* \u003cbr\u003e Price displayed for MWh, kWh or Wh.|\n| Additional Cost      | no       |  *default `{{0.0\\|float}}`* \u003cbr\u003e Template to specify additional cost to be added. See [Additional Costs](#additional-costs) for more details.|\n\n### Option 1: UI\n- Go to `Settings` -\u003e `Devices \u0026 Services`\n- Select `+ Add Integration`\n- Search for `nordpool` and select it\n- Fill in the required values and press `Submit`\n\nTip: By default, the integration will create a device with the name `nordpool_\u003cenergy_scale\u003e_\u003cregion\u003e_\u003ccurrency\u003e_\u003csome-numbers\u003e`. It is recommended to rename the device and all its entities to `nordpool`. If you need to recreate your sensor (for example, to change the additional cost), all automations and dashboards keep working.\n\n### Option 2: YAML\nSet up the sensor using in `configuration.yaml`.\n\n#### Minimal configuration:\n```yaml\nsensor:\n  - platform: nordpool\n    region: \"NO1\"\n```\n\n#### Example configuration:\n```yaml\nsensor:\n  - platform: nordpool\n    # Country/region to get the energy prices for.\n    region: \"NO1\"\n\n    # Override HA local currency used to fetch the prices from the API.\n    currency: \"EUR\"\n\n    # Add Value Added Taxes (VAT)?\n    VAT: True\n\n    # Energy price rounding precision.\n    precision: 3\n\n    # Percentage of average price to set the low price attribute\n    # low_price = hour_price \u003c average * low_price_cutoff\n    low_price_cutoff: 0.95\n\n    # Display price in cents in stead of (for example) Euros.\n    price_in_cents: false\n\n    # Price displayed for MWh, kWh or Wh\n    price_type: kWh\n\n    # Template to specify additional cost to be added to the tariff.\n    # The template price is in EUR, DKK, NOK or SEK (not in cents).\n    # For example: \"{{ current_price * 0.19 + 0.023 | float}}\"\n    additional_costs: \"{{0.0|float}}\"\n```\n### Regions\nSee the [Nord Pool region map](https://data.nordpoolgroup.com/map) for details\n\n| Country   | Region code |\n| --------- | ----------- |\n| Austria   | AT |\n| Belgium   | BE |\n| Denmark   | DK1, \u003cbr\u003e DK2|\n| Estonia   | EE |\n| Finland   | FI |\n| France    | FR |\n| Germany   | DE-LU |\n| Great-Britain | Not yet available in this version |\n| Latvia    | LV |\n| Lithuania | LT |\n| Luxenburg | DE-LU |\n| Netherlands | NL |\n| Norway    | Oslo (NO1) \u003cbr\u003e Kr.sand (NO2) \u003cbr\u003e Tr.heim / Molde (NO3) \u003cbr\u003e Tromso (NO4) \u003cbr\u003e Bergen (NO5)  |\n| Poland    | Not yet available in this version |\n| Sweden    | SE1, \u003cbr\u003e SE2, \u003cbr\u003e SE3, \u003cbr\u003e SE4 |\n\n### Additional costs\nThe idea behind `additional_costs` is to allow the users to add costs related to the official price from Nordpool:\n- Add simple or complex tariffs\n- Calculate VAT\n\nThere are two special special arguments in that can be used in the template ([in addition to all default from Homeassistant](https://www.home-assistant.io/docs/configuration/templating/)):\n- ```now()```: this always refer to the current hour of the price\n- ```current_price```: price for the current hour. This can be used for example be used to calculate your own VAT or add overhead cost.\n\nNote: When configuring Nordpool using the UI, things like VAT and additional costs cannot be changed. If your energy supplier or region changes the additional costs or taxes on a semi-regular basis, the YAML configuration or a helper (example 4) work best.\n\n#### Example 1: Overhead per kWh\n\nAdd 1,3 cents per kWh overhead cost to the current hour's price\n\n```{{ 0.013 | float }}```\n\n#### Example 2: Percentage (VAT)\nAdd 19 % VAT of the current hour's price\n\n```{{ (current_price * 0.19) | float }}```\n\n#### Example 3: Overhead and VAT\n\nAdd 1,3 cents per kWh overhead cost, 0.002 flat tax and 19% VAT to the current hour's price\n\n```{{ (0.013 + 0.002 + (current_price * 0.19)) | float }}```\n\n#### Example 4: Helper\n\nAdd 21% tax and overhead cost stored in a helper\n\n'''{{ (current_price * 0.21) + states('input_number.additionele_kosten') | float(0) }}'''\n\n#### Example 5: Seasonal peek and off-peek overhead\n\n```jinja\n{% set s = {\n    \"hourly_fixed_cost\": 0.5352,\n    \"winter_night\": 0.265,\n    \"winter_day\": 0.465,\n    \"summer_day\": 0.284,\n    \"summer_night\": 0.246,\n    \"cert\": 0.01\n}\n%}\n{% if now().month \u003e= 5 and now().month \u003c 11 %}\n    {% if now().hour \u003e= 6 and now().hour \u003c 23 %}\n        {{ s.summer_day + s.hourly_fixed_cost + s.cert | float }}\n    {% else %}\n        {{ s.summer_night + s.hourly_fixed_cost + s.cert|float }}\n    {% endif %}\n{% else %}\n    {% if now().hour \u003e= 6 and now().hour \u003c 23 %}\n        {{ s.winter_day + s.hourly_fixed_cost + s.cert | float }}\n    {% else %}\n        {{ s.winter_night + s.hourly_fixed_cost + s.cert | float }}\n    {% endif %}\n{% endif %}\n```\n\n## Other\n\n### Extra state attributes\n\n- ```average```: An average of every today\n- ```off_peak_1```: Off peak 1 refers to the average price of the time period from midnight to 8am\n- ```off_peak_2```: Off peak 2 refers to the average price of the time period from 8pm to midnight\n- ```peak```: Peak refers to the average price of the period from 8am to 8pm\n- ```min```: Lowest value today\n- ```max```: Highest value today\n- ```mean```: Actually just median of all values\n- ```unit```: what that of Unit, eg: kWh\n- ```currency```: What type of Currency\n- ```country```: What Country data is fetched for\n- ```region```: The specific region of prices\n- ```low_price```: If price is below low_price_threshold\n- ```price_percent_to_average```:\n- ```today```: List of all values\n- ```tomorrow```: list of all values\n- ```tomorrow_valid```: If tomorrow's values are in yet\n- ```raw_today```: Array of all values\n- ```raw_tomorrow```: Array of values\n- ```current_price```: What the current price is\n- ```additional_costs_current_hour```: If there is any additional costs this hour\n- ```price_in_cents```: Boolean if prices is in cents\n\n## Actions\nActions has recently been added. The action will just forward the raw response from the Nordpool API so you can capture the value your are interested in.\n\nExample for an automation that get the last months averge price.\n```yaml\nalias: Example automation action call with storing with parsing and storing result\ntriggers: null\nactions:\n  - action: nordpool.yearly\n    data:\n      currency: NOK\n      area: NO2\n      year: \"2024\"\n    response_variable: np_result\n  - action: input_text.set_value\n    target:\n      entity_id: input_text.test\n    data:\n      value: \"{{np_result.prices[0].averagePerArea.NO2 | float}}\"\nmode: single\n```\n\n## Troubleshooting\n\n### Debug logging\nAdd this to your `configuration.yaml` and restart Home Assistant to debug the component.\n\n```yaml\nlogger:\n  logs:\n    nordpool: debug\n    custom_components.nordpool: debug\n    custom_components.nordpool.sensor: debug\n    custom_components.nordpool.aio_price: debug\n```\n","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=MAXZPYVPD8XS6","https://www.buymeacoffee.com/2ys3cdCZk"],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustom-components%2Fnordpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcustom-components%2Fnordpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustom-components%2Fnordpool/lists"}