EnergyZero market prices with new integration in Home Assistant

Recently we made the switch from a variable energy contract to a dynamic energy contract (ANWB Energie) with a different energy price every hour. In this blog, we’re going to talk about a new integration I’ve been working on for the past month that will be available with the Home Assistant 2023.2 release.

That new integration is EnergyZero, a company where other parties can purchase their electricity/gas according to day-ahead market prices. Well-known partners who work with EnergyZero are, for example:

All the companies mentioned above are also available as a virtual integration in Home Assistant.

The idea of dynamic prices is that you can benefit more quickly from changes in the energy market. If you adjust your own energy consumption to consumption in the cheap hours, you could save quite a bit of money. However, there is always a risk because the price can also suddenly become more expensive on average, but in general you would be cheaper than a variable energy contract*.

*at least applicable to our situation

The integration

The integration consists of 2 services, one for gas and one for electricity.

Electricity market prices

The price can be different every hour and the new prices for the next day are published every afternoon around 14:00 UTC time. The following different types of entities are created:

Gas market prices

For gas service, only the current and next hour entity are created, because the prices only change once every 24 hours, so it would not really be necessary to show the min and max, for example. The new price will be published every morning around 05:00 UTC time.

More concrete information about this new integration can also be found in the documentation.

All-in price sensor template

The prices shown in the entities are raw prices that only include the 21% VAT. To determine the current all-in price you can use the template sensor below, which add the energy tax and storage costs. The templates below are based on added prices that ANWB Energie communicates, you may still have to adjust them for your own situation.

Templates were last updated on: 7-1-2024

- sensor:
    - name: EnergyZero all-in current energy price
      unique_id: allin_energy_current_price
      icon: mdi:cash
      unit_of_measurement: "€/kWh"
      state_class: measurement
      state: >
        {% set energy_tax = 0.1312 %}
        {% set purch_costs = 0.0484 %}
        {% set current_price = states('sensor.energyzero_today_energy_current_hour_price') | float | default(None) %}
        {{ (current_price + energy_tax + purch_costs) | round(2) }}

Personally, I use this entity in the Energy Dashboard to see if the calculated price in Home Assistant corresponds to what is stated in the ANWB Energie app.

You can make a similar template sensor for gas, but the added costs will be slightly different:

- sensor:
    - name: EnergyZero all-in current gas price
      unique_id: allin_gas_current_price
      icon: mdi:cash
      unit_of_measurement: "€/m³"
      state_class: measurement
      state: >
        {% set energy_tax = 0.7065 %}
        {% set purch_costs = 0.05911 %}
        {% set current_price = states('sensor.energyzero_today_gas_current_hour_price') | float | default(None) %}
        {{ (current_price + energy_tax + purch_costs) | round(4) }}

It may be possible that adjustments are still needed to these templates. So far a comparison between the ANWB Energie app and the Energy Dashboard in Home Assistant, shows a small difference.

Hourly price service calls

From Home Assistant version 2024.1, the EnergyZero integration has a number of service calls, with which you can request an array of hourly prices from EnergyZero and use them in an Apexchart.

The documentation of these service calls can be found here and to make it a bit easier for you, I’ve created a GitHub gist with code to create a trigger template sensor. This allows you to create template sensors for today and tomorrow. where the hourly price data is stored as an attribute in the template sensor. You will also find code to create a simple version of the above Apexcharts in your dashboard.

Package on PyPi

Do you want to collect the EnergyZero data in your own way and process it in another project? Then take a look at the repository of the python package, that is also on PyPi. The integration in Home Assistant also uses this package.

Exit mobile version