This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Script with Dutch power prices
#1
Hi. I want to read out the current hourly power prices (Dutch EPEX spot market). With this info I want to switch on heavy power users (car charging, airco etc) and switch off my solar panels when the market prices are below -/-0,06729 per kWh (since then the energy taxes don't compensate the negative market price, taxes are 0,03679 per kWh + 0,0305 per kWh). I found a website where I can read out these prices, but how can I let a script return the hourly values in a way I can make decisions with it?

With this simple script (where I've put in the time range of 1 day), I get the following output;

--/--

local https = require('ssl.https')
local ltn12 = require('ltn12')
local json = require('json')
local cBody = 'TariffReturn'
local cReq = {}

result1 = https.request({
  url = 'https://mijn.easyenergy.com/nl/api/tariff/getapxtariffs?startTimestamp=2022-05-29T22%3A00%3A00.000Z&endTimestamp=2022-05-30T22%3A00%3A00.000Z&grouping=',
  method = 'GET',
  headers = {
    ['content-length'] = #cBody,
    ['content-type'] = 'application/json'
  },
  source = ltn12.source.string(cBody),
  sink = ltn12.sink.table(cReq)
})

if (cReq) then
  mydata =  json.pdecode(table.concat(cReq))
  log(mydata)

end


--/--

In the output I refer to this part:

--/
....
[4]
  * table:
  ["Timestamp"]
    * string: 2022-05-30T01:00:00+00:00
  ["TariffReturn"]
    * number: 0.1845
  ["TariffUsage"]
    * number: 0.223245
  ["SupplierId"]
    * number: 0


/--
where '  ["TariffReturn"]
    * number: 0.1845
the price per kWh is for every kWh consumed (or delivered) between 2022-05-30, 04.00 - 05.00u

The notation is a little bit confusion, since the table states it is at 01.00.

I check the output of easyenergy with one of the other EPEX spot market parties: https://prijzen.powerhouse.net/forecast/

Any help is welcome.

Jeroen
Reply


Messages In This Thread
Script with Dutch power prices - by jeroen@stevens.biz - 29.05.2022, 22:04
RE: Script with Dutch power prices - by admin - 30.05.2022, 10:34
RE: Script with Dutch power prices - by admin - 31.05.2022, 08:52
RE: Script with Dutch power prices - by JASK - 15.03.2023, 21:20
RE: Script with Dutch power prices - by admin - 16.03.2023, 06:25

Forum Jump: