API Call to convert into Sensor


I would like to use some data from this API call in HA. Ideally the various topics are copied into a sensor. This will be used to condition an automation later based on these values (detailed cloud coverage forecast for next 48hrs)

The data is fetched from this URL:

and looks like this:

  "current": {
    "time": "2022-01-01T15:00"
    "temperature_2m": 2.4,
    "wind_speed_10m": 11.9,
  "hourly": {
    "time": ["2022-07-01T00:00","2022-07-01T01:00", ...]
    "wind_speed_10m": [3.16,3.02,3.3,3.14,3.2,2.95, ...],
    "temperature_2m": [13.7,13.3,12.8,12.3,11.8, ...],
    "relative_humidity_2m": [82,83,86,85,88,88,84,76, ...],

how can I convert this API call into a sensor in HA?


value_template: "{{ now() }}"
  - current
  - hourly

Then use template sensors if you need to pull out individual values.

1 Like