It seems the directlease.nl guys are blocking all the api requests now . I guess the only option is to run the API on your own (see my earlier post). And even then it could be the case that they are actively blocking IP addresses with x requests a day or something…
Running the API locally seems to work fine, I update the sensors twice a day. Just follow the instructions on the github page. It is pretty straight forward.
The Dutch Gas prices API got me inspired, and I wanted to integrate it as addon within Home Assistant. The topic regarding that addon can be found here
If you are interested and want to share feedback, or join the development of that addon, please do so. Any help is welcome!
I was looking for sensor for Diesel prices and ended within this topic.
Based on some examples listed above, I made my own to scrape diesel prices for specific local gas station. By navigating to the site and selecting any other city, it can easily be adapted. Just need to get the id of the span html element with the desired station price. I would expect this may work for stations in Belgium, France & Luxembourg.
- platform: scrape
name: Diesel prijzen
resource: "https://carbu.com/belgie/liste-stations-service/GO/Alsemberg/1652/BE_bf_223"
select: "#price_1533"
value_template: "{{ value.replace('Diesel (B7)', '').replace(',','.').split(' ')[0]|float}}"
device_class: monetary
state_class: measurement
unit_of_measurement: "€/l"
scan_interval: 3600 # once per hour only
Btw, for anyone interested in gas prices in BE/FR/LU: In the meantime I don’t use the custom sensor any longer as I’ve build a new custom integration (HACS) called carbu_com and which can retrieve the lowest prices for diesel, super95,super98, mazout heating oil.
How do you ad fuekas fro the optgroup “Brandstof”, like Diesel (B10)?
And is there also a way to only get the max prices shown on the website instead of the lowest prices of a selected station nearby?