From 3e28975971ad9014f08b62661ba4ad226071cd51 Mon Sep 17 00:00:00 2001 From: Martijn van der Pol Date: Thu, 15 Feb 2024 15:04:59 +0100 Subject: [PATCH] Add EasyEnergy and some additional notes on the template sensor --- documentation/1-source_sensor.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/documentation/1-source_sensor.md b/documentation/1-source_sensor.md index 6db62f9..573e931 100644 --- a/documentation/1-source_sensor.md +++ b/documentation/1-source_sensor.md @@ -47,6 +47,7 @@ If your provider is missing, you can create a Pull Request to add them, or creat |Data Provider|parameters|comment| |---|---|---| +|[EasyEnergy]()|`time_key='timestamp'`|Using the template sensor [below](#creating-a-forecast-sensor-using-the-service-call)| |[EnergyZero]()|`time_key='timestamp'`|Using the template sensor [below](#creating-a-forecast-sensor-using-the-service-call)| |[ENTSO-E]()|`attr_today='prices_today', attr_tomorrow='prices_tomorrow', time_key='time', value_key='price'`|| |[Nordpool]()||all set by default| @@ -55,7 +56,13 @@ If your provider is missing, you can create a Pull Request to add them, or creat ## CREATING A FORECAST SENSOR USING THE SERVICE CALL -Some integrations (like the core [EnergyZero]() integration) don't provice the forecast by default in an attribute. However they provide a service call to retrieve the prices. The example below shows how to setup a sensor to be used in the macro. The state of the sensor will be the current price, and the `price` attribute will contain the prices of yesterday, today and tomorrow (when available). Prices will be fetched every hour and on Home Assistant startup. +Some integrations (like the core [EnergyZero]( and [EasyEnergy]() integrations) don't provice the forecast by default in an attribute. However they provide a service call to retrieve the prices. The example below shows how to setup a sensor to be used in the macro. The state of the sensor will be the current price, and the `price` attribute will contain the prices of yesterday, today and tomorrow (when available). Prices will be fetched every hour and on Home Assistant startup. + +Notes: +* The example below is for EnergyZero, for EasyEnergy the service call is `easyenergy.get_energy_usage_prices` instead of `energyzero.get_energy_prices` +* The `config_entry` value in the service call will differ for each HA instance. The easiest way to get yours is to go to [Developer tools > Services]() and select the service call. The make sure you are in UI Mode, and select the right config entry. Switch to YAML mode to see the config entry. +* When `incl_vat` is set to `true`, the EnergyZero API will use a 2 decimal precision, when set to `false` it will be 5 decimal precision. If you want more precise prices, set `incl_vat` to `false` (like in the example below) + ```yaml template: - trigger: @@ -66,7 +73,7 @@ template: action: - service: energyzero.get_energy_prices data: - incl_vat: true + incl_vat: false config_entry: fe7bdc80dd3bc850138998d869f1f19d start: "{{ today_at() - timedelta(days=1) }}" end: "{{ today_at() + timedelta(days=2) }}"