Pollen Count

Hi all,

Looking for some help trying to make a pollen count but the API i’m using requires square brackets in the config see below

sensor pollen:

and its reporting back blank, any ideas

Location changed

have you tried putting ‘single’ or “double” quotes around the URL?


Yeah i’ve tried single double and none but it always outputs a blank reply in home assistant


Have you tried putting a backslash () before both the open and close brackets (e.g. resource: https://socialpollencount.co.uk/api/forecast?location=[51.7556407,-1.25157468])?

You need to use {{ value_json.forecast[0].pollen_count}} (adjust the number based on the date). So your sensor would look like:

  - platform: rest
    resource: 'https://socialpollencount.co.uk/api/forecast?location=[51.7556407,-1.25157466]'
    name: Pollen Count
    value_template: '{{ value_json.forecast[0].pollen_count}}'
1 Like

Thanks ive tried the suggested / but no joy

Awesome, that looks to be returning the correct value :slight_smile:

Thanks @arsaboo

Excellent thank you

1 Like

Looks like this is busted again. Can someone confirm?

Log Details (ERROR)

Thu Sep 27 2018 15:28:03 GMT+0100 (British Summer Time)

Error parsing value: list object has no element 1 (value: {"status_code":"200 OK","date":"2018-09-27T14:29:03+00:00","forecast":[]}, template: {{ value_json.forecast[1].pollen_count}})

still broken chaps?

Just un-#'d mine and it seems to be working now again…

1 Like