Hey folks. Here in Nova Scotia, our gas price minimum gets set every Thursday around 4pm. I’m looking to use Home Assistant to notify me around that time whether or not I should go get gas (if going up) … or hold off getting gas (if going down). I’m new to scraping in Home Assistant. I tried scraping from [gaswizard.ca] using this code, but I’m not able to get a value in the sensor. Anybody have an suggestions?
Here is the code in my configuration.yaml:
sensor:
- platform: scrape
name: Gas Price Halifax
resource: https://gaswizard.ca/gas-prices/halifax/
select: "div.fuelprice"
value_template: "{{ value | regex_findall('([0-9]+\\.[0-9]+)') | first }}"
unit_of_measurement: "¢/L"
- platform: scrape
name: Gas Price Change
resource: https://gaswizard.ca/gas-prices/halifax/
select: "span.price-direction"
value_template: "{{ value | regex_findall('([-+]?[0-9]+\\.?[0-9]*¢)') | first }}"
Thanks for any help/suggestions!