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.

API
#1
I want to download the data of the solar production of the site from elia and based on the estimated PV production load the battery during the night. In order to minimise or electricty consumption during peak hours. For that, elia provides an api. But, my script in the LM used to work, but since a couples of month it isnot working anymore.

The script is as follows:
Code:
--
--------------------------------------------------------------------
-- BEGIN SCRIPT --
--------------------------------------------------------------------
--
require('socket.http')
require('ltn12')
require('json')

vraag = 'https://opendata.elia.be/api/explore/v2.1/catalog/datasets/ods087/records?where=datetime%20%3E%3D%20%222025-3-25%22&group_by=date_format(datetime%2C%20%27dd%2FMM%2FYYYY%27)%20AS%20Datum%2C%20date_format(datetime%2C%20%27HH%3Amm%27)%20AS%20Tijdstip%2C%20monitoredcapacity%20As%20Totaalvermogen%2C%20mostrecentforecast%20As%20Voorspelling&limit=96&refine=region%3A%22East-Flanders%22&refine=datetime%3A%222025%22&refine=resolutioncode%3A%22PT15M%22'
log(vraag)

res, code = socket.http.request({
  url = vraag,
    method = "GET",
})

log(res,code)
 The result I get is:

Code:
Elia verbeterd copy 25.03.2025 14:23:33
* string: https://opendata.elia.be/api/explore/v2.1/catalog/datasets/ods087/records?where=datetime%20%3E%3D%20%222025-3-25%22&group_by=date_format(datetime%2C%20%27dd%2FMM%2FYYYY%27)%20AS%20Datum%2C%20date_format(datetime%2C%20%27HH%3Amm%27)%20AS%20Tijdstip%2C%20monitoredcapacity%20As%20Totaalvermogen%2C%20mostrecentforecast%20As%20Voorspelling&limit=96&refine=region%3A%22East-Flanders%22&refine=datetime%3A%222025%22&refine=resolutioncode%3A%22PT15M%22
Elia verbeterd copy 25.03.2025 14:23:38
* arg: 1
  * nil
* arg: 2
  * string: Try again


What am I doing wrong. When I paste the string directly in to a brower, I get the data. So, the error is not caused by the string.
Reply
#2
Check DNS and gateway settings in System config > Network > Interfaces.
Reply
#3
Thank you, it resolved the issue.
Reply


Forum Jump: