Scrape web-api

Hi there!
I’m prettty new with HA and I’m trying to scrape weather-data from my woundrerground-account.
I wrote this code:

 scrape:
- resource: https://api.weather.com/v2/pws/observations/current?stationId=ILANDS105&format=json&units=m&apiKey=XXXX
  sensor:
      - name: "Aussen-Temperatur"
        select: "#\/observations\/0\/metric\/temp > td:nth-child(2) > span:nth-child(1) > span:nth-child(1)"
        value_template: "{{ value_json['observations'][0]['metric']['temp'] }}"

Of course, I changed the api-key.
When I put the code in the template, I get this error:

UndefinedError: ‘value_json’ is undefined
Has anyone experience with getting data from a wounderground-json?
Thank you :slight_smile:

Sorry I can’t help directly with your question, but wanted to mention that I use a custom integration that pulls all the data from my WUnderground PWS via api if that’s any help?

I’ve had this set up for a couple of months now and it seems perfect so far, and gives me all the info that my weather station creates. Let me know if you try that but have any questions.

Cheers,
Steve

+1 to @Hangar69Yarra … hopefully you don’t actually need to do this.

but your issue right now has nothing to do with weather underground i don’t believe.

i think the issue is just as the error says. value_json isn’t defined. i believe the value comes back in the variable value. and you need to parse it instead. you didn’t post the return payload, so can’t quite help you beyond that.