Dutch Gas Priceses

@sanderdw Thanks!
I’m testing it now.
Seems to work so far :slight_smile:

More people with issues loading the sensors for the gas prices?

Error fetching data: https://brandstof-api.sanwil.net/api/v1/brandstof_prijzen/2011.png failed with HTTPSConnectionPool(host=‘brandstof-api.sanwil.net’, port=443): Read timed out. (read timeout=10)

It seems the directlease.nl guys are blocking all the api requests now :face_with_raised_eyebrow:. 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…

Well it was nice when it works. But for now I will remove this sensors. Will check this later for hosting this. Thanks.

Looks like its not working anymore!
It was a nice thing for looking at the stations near house.
I dont understand how to do it now?

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.

@sanderdw thanks for sharing!

Hi Wesley,

The only option is to run the API server on your own. So you will need a Docker server somewhere to run the code in https://github.com/sanderdw/Dutch-Gas-prices-API or the fork Wim created (https://github.com/wbaars/Dutch-Gas-prices-API).

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!

1 Like

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

Was also looking for some easy scraper. Managed to make it work with the full selector:

  - platform: scrape
    resource: "http://lukoil.nl/go/lukoil_station.cfm?id=XXX"
    name: Lukoil
    select: "div#fullPage:nth-child(7) > div#content.contentStyle02:nth-child(2) > div.columnOne:nth-child(2) > div#stationBox:nth-child(1) > div.stationInfo:nth-child(2) > div#tabbedInfo:nth-child(2) > div#tabbedInfoContent:nth-child(2) > div.tab:nth-child(2) > div.priceBox2:nth-child(4) > span.price:nth-child(2)"
    scan_interval: 3600 

Used a Chrome extension to get the correct selector: CSS Selector Capture Pro - Chrome Web Store

Just use the extension on the page, copy the selector it outputs and put that in your sensor.

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.

1 Like

Btw, I’ve added support for fuel prices in Netherlands, see Carbu.com integration

Will euro95 also supported in future?

Isn’t that the same as Super95?
I have mapped:

  • “Euro 95” to “Super95 (E10)”
  • “Super Plus” to “Super98 (E5)”
  • “Diesel” to “Diesel (B7)”

Please let me know if this wouldn’t be correct. Not sure on the used namings in NL.

Not sure what ‘Spec. Benzine’ and ‘Spec. Diesel’ would be in the dropdown of brandstof-zoeker.nl?

Euro 96 is different then super95 :wink:

I’m confused, according to this site: euro 95 is the same as ‘Super 95’ Welke benzine je moet tanken, E5 of E10? | Vaartland.nl

It seems brandstof-zoeker doesn’t clearly indicate the E5 / E10 . not sure what the correct mapping would be…

I see that in Germany they called it super95. In Netherlands kost tankstations have Euro95 signs.

So it’s the same :)) sorry!!!

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?

development changes are required to add extra fuel types. B10 is not really used in Belgium afaik but I’ll check if I can add it in a future release.

Not sure what you mean with max prices.

With max prices I mean these prices: