Dutch Gas Priceses

With some trial and error, I managed to retrieve the Euro 95 price with the scrape component:

homeassistant:
  customize:
    sensor.diesel:
      friendly_name: "Diesel"
      unit_of_measurement: "€/l"
      icon: mdi:gas-station
    sensor.euro95:
      friendly_name: "Euro 95"
      unit_of_measurement: "€/l"
      icon: mdi:gas-station
    sensor.lpg:
      friendly_name: "LPG"
      unit_of_measurement: "€/l"
      icon: mdi:gas-station

sensor:
  - platform: scrape
    name: Euro95
    resource: "https://www.unitedconsumers.com/brandstofprijzen"
    select: ".table div:nth-of-type(8)"
    value_template: "{{ value.split(' ')[1].replace(',', '.') | float }}"
    scan_interval: 3600 # be nice; once per hour only

  - platform: scrape
    name: Diesel
    resource: "https://www.unitedconsumers.com/brandstofprijzen"
    select: ".table div:nth-of-type(14)"
    value_template: "{{ value.split(' ')[1].replace(',', '.') | float }}"
    scan_interval: 3600 # be nice; once per hour only

  - platform: scrape
    name: LPG
    resource: "https://www.unitedconsumers.com/brandstofprijzen"
    select: ".table div:nth-of-type(20)"
    value_template: "{{ value.split(' ')[1].replace(',', '.') | float }}"
    scan_interval: 3600 # be nice; once per hour only

That was fun, and useful.

Update: while I’m still at it, I added the diesel and LPG.

32

51

1 Like