Spot Price Optimizer

The Spot Price Optimizer function block is used to activate a load in hours when the energy price is the lowest.

After a trigger the block will pick a number of hours, defined by 'Demand', within the next hours, defined by 'Period' and activate the output 'O'.

Alternatively the Outputs Very High, High, Low and Very Low can be used to activate/deactivate a load. For this usecase you can for example connect the day pulse to the trigger.

If the data on the Inputs +0 to +23 is provided by a virtual http input, the price is only used if it was updated within the current hour, therefore preventing the use of outdated prices.

By changing the Mode setting, it can be defined how the inputs work Relative: +0 - +23 or Absolute an input for each hour for the current day.

The Spot Price Optimizer can be used as a source for the export and import price in the Energy Flow Monitor. Both function blocks must be on the same Miniserver.

Table of Contents


Inputs

Abbreviation Summary Description Value Range
Off Off Pulse: Outputs are reset / switched off.
On: Block is locked.
Dominating input.
0/1
Tr Trigger Starts the automatic. The output O will be activated as often as defined by 'demand' within 'period'. 0/1
+0 to +23 Relative Mode: Price in the hour now +0 to +23 Price forecast for the hour now + offset. This inputs are not available when using the Spot market mode.
Absolute Mode: Price in the hour 00:00 to 23:00 Price forecast for a specific hour of the current day. This inputs are not available when using the Spot market mode.




Outputs

Abbreviation Summary Description Value Range
O Active Output Output will be activated at the hours with the lowest price after a trigger. 0/1
Cv Current Price
vHigh Very High The current price is Very High compared to the other hours. Limits will be recalculated after a trigger out of the forecast values available at that moment.
Is also activated when the current price is above the value set in parameter Max.
0/1
High The current price is High compared to the other hours. Limits will be recalculated after a trigger out of the forecast values available at that moment. 0/1
Low The current price is Low compared to the other hours. Limits will be recalculated after a trigger out of the forecast values available at that moment. 0/1
vLow Very Low The current price is Very Low compared to the other hours. Limits will be recalculated after a trigger out of the forecast values available at that moment. 0/1
Max Highest Price The maximum price is recalculated after the trigger, using all available forecast values that are in the future.
Min Lowest Price The minimum price is recalculated after the trigger, using all available forecast values that are in the future.
Avg Average Price The average price is recalculated after the trigger, using all available forecast values that are in the future.
AC API Connector Intelligent API based connector.
API Commands
-




Parameters

Abbreviation Summary Description Unit Value Range Default Value
Demand How often the output O should activate within the period after a Trigger. h 0...∞ 4
Period Time period after a trigger from which the block picks the hours with the lowest price where the output O will be activated. h 0...∞ 24
Max Fixed very high price If the current price is above this value the very High output will always activate. - 1
I2 Variable Input 2 Value which can be used in the formula with I2. - 0
I3 Variable Input 3 Value which can be used in the formula with I3. - 0




Properties

Summary Description Default Value
Mode Relative: Inputs provide the price relative to the current hour.
Absolute: Inputs provide the price for each hour of the day (00:00 to 23:00).
Spot market: Data is obtained from european energy spot markets, Inputs for hourly prices are hidden.
-
Price Calculation Use a formula to calculate the actual price you are paying. Ask your energy supplier for the formula. I1 = price from the inputs or the spot market price (without tax). I2 = I2 parameter. I3 = I3 parameter. I4 = Minutes since midnight for which the price is calculated. -




Spot market mode

In Spot market mode, energy prices for Europe are obtained directly from energy spot markets like EPEX SPOT or similar, and do not need to be added via virtual inputs. The Miniserver must be registered for this.

Select Spot market mode in the settings and choose the relevant market area to receive the energy prices. The inputs for the hourly prices are hidden.
The energy prices are provided excl. taxes, and are obtained daily at 13:00 - 14:00 (UTC) for the next day.

Due to legal restrictions of the spot market data providers, we cannot provide access to the data. The statistics are only displayed in the user interface.


Programming example

In the properties window, the mode, the formula for price calculation, the number of active hours, as well as the period in which the cheapest times are determined, can be set.
Also, an individual very high energy price can be defined and the unit adjusted.

With http input or commands the hourly energy prices are transferred to the function block.

From the Loxone Library a suitable template can be imported.

In this example, a trigger pulse is used to determine the 4 cheapest hours of the next 12 hours and the heat pump is switched on in these hours.
If the energy price is above the calculated or set very high value, then the pump is blocked.


Price Calculation

In addition to the spot price, additional costs and taxes are charged by the electricity provider and grid operator.
Therefore, a formula for calculating the final price can be defined in the properties window.
Check a recent electricity bill to find out the various costs per kWh or ask the energy supplier. Then create a formula based on this data.

In the example, a formula was formed using prices from the provider aWATTar, adding 3% and a fixed price of 1.5ct per hour.
Additionally, grid costs of 6.7ct were calculated, along with 20% VAT.


Calculation of outputs

The range between the lowest and highest price is divided into 4 equal parts, according to which the outputs are switched.

Diff = (Max - Min) / 4
Limit1 = Min + Diff
Limit2 = Limit1 + Diff
Limit3 = Limit2 + Diff