Edit: 2023-11-05
The solution has changed over time due to the available data source changing in structure and content. So a lot of content in this thread may be obsolete.
There’s now a custom integration available for early adopters/testing - see here.
For a lighter weight solution using multiscrape you can follow the thread from around here.
And there’s a few automation examples here.
The rest of this first post is legacy, which I’ll leave for completeness.
Edit: 2023-10-14
It’s broken again with no fix in sight ATM for the 6 day forecast. The API doesn’t seem to contain updated data.
Edit: 2021-12-04
Got something hacky working again for 6 day forecast for Melbourne + Thunderstorm Asthma by district for “today”. See this post.
Edit: 2021-09-18
Have re-established something basic based on what is now available (1 day forecast on Melbourne website). Context below. Link to revised sensor is in this post.
Edit: 2021-09-05
Melbourne Pollen no longer offer this forecast data for free on their website (via app only, and subscription only) . Therefore this sensor is broken and cannot be fixed at this point. It might continue to work for some of the other sister sites (https://www.canberrapollen.com.au/). I have limited motivation to maintain/develop anything for these other locations;)
I made a start on a pollen forecast sensor/card in readiness for the season.
It scrapes the forecast from Melbourne Grass Pollen Forecast using the HACS MultiScrape custom component. I’ve enquired about an API too (edit 2021-07-23: they confirmed there is no public API yet but it is on their radar)
Then I’ve slapped together a bit of a lovelace “card” mostly using the custom button card, in a rough weather forecast layout.
Haven’t done much testing/polishing but welcome any thoughts/help in refining it.
In config:
multiscrape:
############################################################################
##Melbourne Pollen Forecast
############################################################################
#TODO
# - Icon templates aren't working properly
# - General testing
# - Make card look prettier
# - Get the thunderstorm athsma forecast.
- resource: https://www.melbournepollen.com.au/
scan_interval: 36000 #Hourly
sensor:
- unique_id: melbourne_pollen_forecast_fc1
name: Pollen fc1
select: "#fc1"
attributes:
- name: Forecast Day
select: "#dy1"
- name: Forecast Date
select: "#dt1"
value_template: '{{ value.strip() }}'
icon: >-
{% if is_state("sensor.melbourne_pollen_forecast_fc1", "Low") %}
mdi:emoticon-happy
{% elif is_state("sensor.melbourne_pollen_forecast_fc1", "Moderate") %}
mdi:emoticon-neutral
{% elif is_state("binary_sensor.melbourne_pollen_forecast_fc1", "High") %}
mdi:emoticon-sad
{% elif is_state("binary_sensor.melbourne_pollen_forecast_fc1", "Extreme") %}
mdi:emoticon-angry
{% else %}
mdi:help-circle
{% endif %}
- unique_id: melbourne_pollen_forecast_fc2
name: Pollen fc2
select: "#fc2"
attributes:
- name: Forecast Day
select: "#dy2"
- name: Forecast Date
select: "#dt2"
value_template: '{{ value.strip() }}'
icon: >-
{% if is_state("sensor.melbourne_pollen_forecast_fc2", "Low") %}
mdi:emoticon-happy
{% elif is_state("sensor.melbourne_pollen_forecast_fc2", "Moderate") %}
mdi:emoticon-neutral
{% elif is_state("binary_sensor.melbourne_pollen_forecast_fc2", "High") %}
mdi:emoticon-sad
{% elif is_state("binary_sensor.melbourne_pollen_forecast_fc2", "Extreme") %}
mdi:emoticon-angry
{% else %}
mdi:help-circle
{% endif %}
- unique_id: melbourne_pollen_forecast_fc3
name: Pollen fc3
select: "#fc3"
attributes:
- name: Forecast Day
select: "#dy3"
- name: Forecast Date
select: "#dt3"
value_template: '{{ value.strip() }}'
icon: >-
{% if is_state("sensor.melbourne_pollen_forecast_fc1", "Low") %}
mdi:emoticon-happy
{% elif is_state('sensor.melbourne_pollen_forecast_fc1', 'Moderate') %}
mdi:emoticon-neutral
{% elif is_state('binary_sensor.melbourne_pollen_forecast_fc1', 'High') %}
mdi:emoticon-sad
{% elif is_state('binary_sensor.melbourne_pollen_forecast_fc1', 'Extreme') %}
mdi:emoticon-angry
{% else %}
mdi:help-circle
{% endif %}
- unique_id: melbourne_pollen_forecast_fc4
name: Pollen fc4
select: "#fc4"
attributes:
- name: Forecast Day
select: "#dy4"
- name: Forecast Date
select: "#dt4"
value_template: '{{ value.strip() }}'
icon: >-
{% if is_state("sensor.melbourne_pollen_forecast_fc1", "Low") %}
mdi:emoticon-happy
{% elif is_state('sensor.melbourne_pollen_forecast_fc1', 'Moderate') %}
mdi:emoticon-neutral
{% elif is_state('binary_sensor.melbourne_pollen_forecast_fc1', 'High') %}
mdi:emoticon-sad
{% elif is_state('binary_sensor.melbourne_pollen_forecast_fc1', 'Extreme') %}
mdi:emoticon-angry
{% else %}
mdi:help-circle
{% endif %}
- unique_id: melbourne_pollen_forecast_fc5
name: Pollen fc5
select: "#fc5"
attributes:
- name: Forecast Day
select: "#dy5"
- name: Forecast Date
select: "#dt5"
value_template: '{{ value.strip() }}'
icon: >-
{% if is_state("sensor.melbourne_pollen_forecast_fc1", "Low") %}
mdi:emoticon-happy
{% elif is_state('sensor.melbourne_pollen_forecast_fc1', 'Moderate') %}
mdi:emoticon-neutral
{% elif is_state('binary_sensor.melbourne_pollen_forecast_fc1', 'High') %}
mdi:emoticon-sad
{% elif is_state('binary_sensor.melbourne_pollen_forecast_fc1', 'Extreme') %}
mdi:emoticon-angry
{% else %}
mdi:help-circle
{% endif %}
- unique_id: melbourne_pollen_forecast_fc6
name: Pollen fc6
select: "#fc6"
attributes:
- name: Forecast Day
select: "#dy6"
- name: Forecast Date
select: "#dt6"
value_template: '{{ value.strip() }}'
icon: >-
{% if is_state('sensor.melbourne_pollen_forecast_fc1', 'Low') %}
mdi:emoticon-happy
{% elif is_state('sensor.melbourne_pollen_forecast_fc1', 'Moderate') %}
mdi:emoticon-neutral
{% elif is_state('binary_sensor.melbourne_pollen_forecast_fc1', 'High') %}
mdi:emoticon-sad
{% elif is_state('binary_sensor.melbourne_pollen_forecast_fc1', 'Extreme') %}
mdi:emoticon-angry
{% else %}
mdi:help-circle
{% endif %}
In lovelace:
#### Melbourne Pollen Card ##############################################################################################################
- type: horizontal-stack
cards:
#mother Mode
- type: "custom:button-card"
entity: sensor.melbourne_pollen_forecast_fc1
label: >
[[[return (states['sensor.melbourne_pollen_forecast_fc1'].attributes.forecast_day);]]]
tap_action:
action: more-info
show_label: true
show_state: true
show_name: false
state:
- value: 'Low'
color: rgb(52, 235, 85)
- value: 'Moderate'
color: rgb(235, 235, 52)
- value: 'High'
color: rgb(235, 147, 52)
- value: 'Extreme'
color: rgb(235, 52, 52)
size: 50%
aspect_ratio: 1.8/1
layout: icon_state
styles:
name:
- font-weight: bold
- font-size: 0.5vw
- color: grey
icon:
- color: grey
label:
- font-weight: bold
- font-size: 0.6vw
- color: white
- type: "custom:button-card"
entity: sensor.melbourne_pollen_forecast_fc2
label: >
[[[return (states['sensor.melbourne_pollen_forecast_fc2'].attributes.forecast_day);]]]
tap_action:
action: more-info
show_label: true
show_state: true
show_name: false
state:
- value: 'Low'
color: rgb(52, 235, 85)
- value: 'Moderate'
color: rgb(235, 235, 52)
- value: 'High'
color: rgb(235, 147, 52)
- value: 'Extreme'
color: rgb(235, 52, 52)
size: 50%
aspect_ratio: 1.8/1
layout: icon_state
styles:
name:
- font-weight: bold
- font-size: 0.5vw
- color: grey
icon:
- color: grey
label:
- font-weight: bold
- font-size: 0.6vw
- color: white
- type: "custom:button-card"
entity: sensor.melbourne_pollen_forecast_fc3
label: >
[[[return (states['sensor.melbourne_pollen_forecast_fc3'].attributes.forecast_day);]]]
tap_action:
action: more-info
show_label: true
show_state: true
show_name: false
state:
- value: 'Low'
color: rgb(52, 235, 85)
- value: 'Moderate'
color: rgb(235, 235, 52)
- value: 'High'
color: rgb(235, 147, 52)
- value: 'Extreme'
color: rgb(235, 52, 52)
size: 50%
aspect_ratio: 1.8/1
layout: icon_state
styles:
name:
- font-weight: bold
- font-size: 0.5vw
- color: grey
icon:
- color: grey
label:
- font-weight: bold
- font-size: 0.6vw
- color: white
- type: "custom:button-card"
entity: sensor.melbourne_pollen_forecast_fc4
label: >
[[[return (states['sensor.melbourne_pollen_forecast_fc4'].attributes.forecast_day);]]]
tap_action:
action: more-info
show_label: true
show_state: true
show_name: false
state:
- value: 'Low'
color: rgb(52, 235, 85)
- value: 'Moderate'
color: rgb(235, 235, 52)
- value: 'High'
color: rgb(235, 147, 52)
- value: 'Extreme'
color: rgb(235, 52, 52)
size: 50%
aspect_ratio: 1.8/1
layout: icon_state
styles:
name:
- font-weight: bold
- font-size: 0.5vw
- color: grey
icon:
- color: grey
label:
- font-weight: bold
- font-size: 0.6vw
- color: white
- type: "custom:button-card"
entity: sensor.melbourne_pollen_forecast_fc5
label: >
[[[return (states['sensor.melbourne_pollen_forecast_fc5'].attributes.forecast_day);]]]
tap_action:
action: more-info
show_label: true
show_state: true
show_name: false
state:
- value: 'Low'
color: rgb(52, 235, 85)
- value: 'Moderate'
color: rgb(235, 235, 52)
- value: 'High'
color: rgb(235, 147, 52)
- value: 'Extreme'
color: rgb(235, 52, 52)
size: 50%
aspect_ratio: 1.8/1
layout: icon_state
styles:
name:
- font-weight: bold
- font-size: 0.5vw
- color: grey
icon:
- color: grey
label:
- font-weight: bold
- font-size: 0.6vw
- color: white
- type: "custom:button-card"
entity: sensor.melbourne_pollen_forecast_fc6
label: >
[[[return (states['sensor.melbourne_pollen_forecast_fc6'].attributes.forecast_day);]]]
tap_action:
action: more-info
show_label: true
show_state: true
show_name: false
state:
- value: 'Low'
color: rgb(52, 235, 85)
- value: 'Moderate'
color: rgb(235, 235, 52)
- value: 'High'
color: rgb(235, 147, 52)
- value: 'Extreme'
color: rgb(235, 52, 52)
size: 50%
aspect_ratio: 1.8/1
layout: icon_state
styles:
name:
- font-weight: bold
- font-size: 0.5vw
- color: grey
icon:
- color: grey
label:
- font-weight: bold
- font-size: 0.6vw
- color: white