Melbourne Pollen Forecast Scrape Sensor and Lovelace "Card"

that’s a little bit un-wife friendly in my house - we don’t have anything IOT in the bedroom aside from phones charging…

I’ve noticed that the REST call doesn’t always work reliably - aside from restarting HA, any other suggestions? Or is it that the service is exceeding number of polls maybe?

Getting an Error -3 from the call

Error fetching data: https://api.pollenforecast.com.au/app/json/app_data.php?app=1&version=4 failed with [Errno -3] Try again

1 Like

Yeah not sure what’s up there.

How often often are you hitting it?

I just used your example and dropped it into my config, so every 600 seconds

1 Like

I quickly checked my logs and I seem to get the same too sometimes.

Are you able to share how you did the automations? I’m not sure how I trigger something from the API data as it’s not stored in discrete sensors. Unfortunately beyond my knowledge but keen to learn.

Here’s some automation examples.

I ran out of characters in the main solution post so I’ll maintain these here.
These are excerpts from my more complex config so let me know if they don’t work) :slight_smile:


Make some binary sensors in your config. You can use these as triggers in your automations.

binary_sensor:
 #Create some binary sensors from the forecasts
  - platform: template
    sensors:
      climate_alert_pollen_hayfever:
        friendly_name: Pollen Alert Today
        device_class: "problem"
        icon_template: mdi:flower-pollen
        #Adjust to set your own tolerances/thresholds
        value_template: >-
          {{
          states['sensor.melbourne_pollen_forecast_api'].attributes.melbourne_6day_pollen_forecast.days[0].pollen_level == 'Moderate'
            or
          states['sensor.melbourne_pollen_forecast_api'].attributes.melbourne_6day_pollen_forecast.days[0].pollen_level == 'High'
            or
          states['sensor.melbourne_pollen_forecast_api'].attributes.melbourne_6day_pollen_forecast.days[0].pollen_level == 'Extreme'
          }}
      climate_alert_pollen_hayfever_tommorrow:
        friendly_name: Pollen Alert Tomorrow
        device_class: "problem"
        icon_template: mdi:flower-pollen
        value_template: >-
          {{
          states['sensor.melbourne_pollen_forecast_api'].attributes.melbourne_6day_pollen_forecast.days[1].pollen_level == 'Moderate'
            or
          states['sensor.melbourne_pollen_forecast_api'].attributes.melbourne_6day_pollen_forecast.days[1].pollen_level == 'High'
            or
          states['sensor.melbourne_pollen_forecast_api'].attributes.melbourne_6day_pollen_forecast.days[1].pollen_level == 'Extreme'
          }}

A script which triggers an announcment on my Google homes and posts to my homes Telegram thread. You can use something simlar with TTS etc.

pollen_report:
  sequence:
  #Announce Pollen today
  - service: rest_command.assistant_broadcast 
    data:
      command: "The pollen forecast today is {{states.sensor.melbourne_pollen_forecast_api.attributes.melbourne_6day_pollen_forecast.days[0].pollen_level}}"
  #Pollen 6 day outlook
  - service: rest_command.assistant_broadcast
    data:
      command: >-
        {{states.sensor.melbourne_pollen_forecast_api_6day_summary_stats.attributes.six_day_outlook_description}}
  - service: notify.mothershiptelegramannouncements
    data:
        title: "*Pollen Outlook*"
        message: {{states.sensor.melbourne_pollen_forecast_api_6day_summary_stats.attributes.six_day_outlook_description}}

In my bedtime/arrive home scripts, turn on purifiers if pollen is alerting.

sleepmode_routines:
  alias: Sleep Mode Routines
  sequence:
##Pollen: Turn on Bedroom air purifier if pollen is alerting
  - if:
      or:
        - "{{states.binary_sensor.climate_alert_pollen_hayfever.state == 'on'}}"
        - "{{states.binary_sensor.climate_alert_pollen_hayfever_tommorrow.state == 'on'}}" 
    then:
      - service: switch.turn_on
        entity_id: switch.kogan_air_purifier_sleep_mode_2
      - service: rest_command.assistant_broadcast 
        data:
          command: "Turning on the bedroom air purifier for pollen"

day_time_routines:
  alias: Activate Daytime Routines
  sequence:
#Pollen
  - if:
     - "{{states.binary_sensor.climate_alert_pollen_hayfever.state == 'on'}}"           
    then:
      - service: fan.set_percentage
        target:
          entity_id: fan.mi_air_purifier_3_3h
        data:
          percentage: 33
      - service: rest_command.assistant_broadcast 
        data:
          command: "Turning on the air purifier for pollen"
  

In an automation, set purifier fan speed depending on pollen level

- id: '121124152535'
  alias: Turn on purifier for pollen
  trigger:
  - platform: state
    entity_id: sensor.melbourne_pollen_forecast_api_6day_summary_stats
  - platform: state
    entity_id: input_select.operating_mode
  condition:
    condition: template
    value_template: '{{not is_state("input_select.operating_mode", "Away")}}'
  action:
  - choose:
      - conditions: '{{is_state("input_select.operating_mode", "Sleep")}}'
        sequence:
          - service: fan.set_percentage
            target:
              entity_id: fan.mi_air_purifier_3_3h
            data_template:
              percentage: >
                {%- if is_state("sensor.melbourne_pollen_forecast_today", "Extreme") -%} 66
                {% elif is_state("sensor.melbourne_pollen_forecast_today", "Low") %} 0
                {%- else -%}
                33
                {%- endif -%}
    default:
      - service: fan.set_percentage
        target:
          entity_id: fan.mi_air_purifier_3_3h
        data_template:
          percentage: >
            {% if is_state("sensor.melbourne_pollen_forecast_today", "Moderate") %} 33
            {% elif is_state("sensor.melbourne_pollen_forecast_today", "High") %} 66
            {% elif is_state("sensor.melbourne_pollen_forecast_today", "Low") %} 0
            {% elif is_state("sensor.melbourne_pollen_forecast_today", "Extreme") %} 100
            {% endif %}
2 Likes

Added to post above;)

1 Like

Awesome thanks for sharing

New fix for API change (for Asthma forecast) implemented in main solution post:

  1. 2022-11-27 Asthma forecast randomly changed from div7 to div8, breaking the sensor. So that was adjusted in 2 places.

I tried setting this up today but noticed the values returned from the API were inconsistent with those on the direct webpage (melbournepollen.com.au). That’s a little troubling, maybe their API is unreliable? I assume the main webpage data is correct and their undocumented API is acting weird.

Using Home Assistant’s native scrape integration, I was able to fetch the default grass pollen value for “VIC: Melbourne” from the top of the main webpage, and also the first thunderstorm asthma entry (which corresponds with “Central”).

I’m sure this will break if they change their website design, and it doesn’t provide the 6-day forecast or support different regions in Victoria. But for anyone in Melbourne looking for some simple sensors to perform automations from (eg. turn on air purifiers, open/close windows and so on), this might do the trick as an interim solution until they sort out their API.

sensor:
  - platform: scrape
    name: "Pollen Forecast"
    resource: https://www.melbournepollen.com.au/
    scan_interval: 3600
    select: "#inseason .pollen-level" # Primary grass pollen value, assumes "VIC: Melbourne" is the default selection
    #select: "#district-pollen-div .forecast-value:first-child" # First regional pollen value, assumes "Central" is first entry
  - platform: scrape
    name: "Thunderstorm Asthma Forecast"
    resource: https://www.melbournepollen.com.au/
    scan_interval: 3600
    select: "#tae-div .forecast-value:first-child" # First regional thunderstorm asthma value, assumes "Central" is first entry

(The above is in the old config yaml format as I’m running an older HA install.)

The original solution in the OP scraped the webpage like you’re doing.

They used to offer a 5 day forecast on their webpage but they removed it when they started monetising via the app.

I’ve validated the API against the paid app and it seems consistent.

So I believe it’s the webpage which is inaccurate/lacking maintenance now and not the API. Therefore I don’t recommend your solution.

As I’m trying to clean up the various HACS plugins I have installed, I decided I really didn’t like the use of button-card for this one, and ended up re-writing it in a Markdown card with heavy use of card-mod.
Mostly I didn’t like the look of the button-card as it was, then I got a bit fixated on this one.

Figured I’d share my work with others, I’ve done a few different options, but mostly I was working towards making it look more like the weather applet.
The first 2 (my favourite) make use of Collapsable cards and Tabbed Card, both from HACS.

Here’s a screenshot of all of them

And the YAML for that entire grid.

square: false
columns: 2
type: grid
cards:
  - type: custom:tabbed-card
    tabs:
      - attributes:
          label: Weather
          icon: mdi:weather-partly-cloudy
        card:
          type: custom:collapsable-cards
          style: |
            hui-weather-forecast-card {width: 100%!important;}
          title_card:
            type: weather-forecast
            entity: weather.home
            show_current: true
            show_forecast: false
            secondary_info_attribute: humidity
            card_mod:
              class: button-small
            style: >
              :host([veryverynarrow]) .content {flex-flow: nowrap !important;
              align: right !important; }

              :host([verynarrow]) .name, :host([verynarrow]) .attribute {
              display: block !important; }

              :host([veryverynarrow]) .icon-image { margin-right: 16px
              !important; }
          cards:
            - type: weather-forecast
              entity: weather.home
              show_forecast: true
              show_current: false
      - attributes:
          label: Pollen
          icon: mdi:flower-pollen-outline
        card:
          type: custom:collapsable-cards
          card_mod:
            style: 'button > :first-child {width: 100%!important;'
          title_card:
            type: markdown
            content: >
              {% set day = state_attr('sensor.melbourne_pollen_forecast_api',
              'melbourne_6day_pollen_forecast').days[0] %}

              {% set realdate = strptime(day.date, '%d %B %Y') %}

              {%   if day.pollen_level == 'Low' %}
                  {% set icon = 'mdi:thumb-up' %}
                  {% set advice = 'Get outside' %}
              {% elif day.pollen_level == 'Moderate' %}
                  {% set icon = 'mdi:flower' %}
                  {% set advice = 'Take a tablet' %}
              {% elif day.pollen_level == 'High' %}
                  {% set icon = 'mdi:flower-pollen' %}
                  {% set advice = 'Avoid grassy fields' %}
              {% elif day.pollen_level == 'Extreme' %}
                  {% set icon = 'mdi:alert-octagram' %}
                  {% set advice = 'Stay indoors' %}
              {% else %}
                  {% set icon = 'mdi:robot-confused' %}
                  {% set advice = 'Fix shit' %}
              {% endif %}

              <div>

              <ha-icon icon="{{icon}}"></ha-icon>

              <div>Pollen forecast<div>{{realdate.strftime('%A')}}</div></div>

              <div>{{day.pollen_level}}<div>{{advice}}</div></div>

              </div>
            card_mod:
              style:
                ha-markdown$: |
                  /* NOTE: markdown card doesn't keep class, title, or name */
                  ha-markdown-element > div:first-child {margin-top: 0.4em;}
                  ha-markdown-element > div:last-child {margin-bottom: 0.4em;}
                  ha-markdown-element > div {
                    display: flex;
                    align-items: center;
                    flex-direction: row;
                    margin-top: 8px;
                    margin-bottom: 8px;

                    font-size: 1.2em;
                    line-height: 2ex;
                  }
                  ha-markdown-element > div > :nth-child(1) {
                    /* state-badge */
                    --mdc-icon-size: 48px;

                    flex: 0 0 40px;

                    position: relative;
                    display: inline-block;
                    width: 48px;
                    color: var(--paper-item-icon-color);
                    border-radius: 50%;
                    height: 48px;
                    text-align: center;
                    background-size: cover;
                    line-height: 48px;
                    vertical-align: middle;
                    box-sizing: border-box;
                  }
                  ha-markdown-element > div > div:nth-child(2) {
                    /* info */
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;

                    margin-left: 16px;
                    margin-right: 8px;
                    flex: 1 1 30%;
                  }
                  ha-markdown-element > div > div > div {
                    /* secondary */
                    color: var(--secondary-text-color);
                  }
                  ha-markdown-element > div > div:nth-child(3) {
                    /* text-content value */
                  }
          cards:
            - type: markdown
              content: >
                {% for day in state_attr('sensor.melbourne_pollen_forecast_api',
                'melbourne_6day_pollen_forecast').days[1:] %}
                  {% set realdate = strptime(day.date, '%d %B %Y') %}
                  {%   if day.pollen_level == 'Low' %}
                    {% set icon = 'mdi:thumb-up' %}
                  {% elif day.pollen_level == 'Moderate' %}
                    {% set icon = 'mdi:flower' %}
                  {% elif day.pollen_level == 'High' %}
                    {% set icon = 'mdi:flower-pollen' %}
                  {% elif day.pollen_level == 'Extreme' %}
                    {% set icon = 'mdi:alert-octagram' %}
                  {% else %}
                    {% set icon = 'mdi:robot-confused' %}
                  {% endif %}
                  <div>
                  <div>{{realdate.strftime('%a')}}</div>
                  <ha-icon icon="{{icon}}"></ha-icon>
                  <div>{{day.pollen_level}}</div>
                  </div>
                {% endfor %}
              card_mod:
                style:
                  ha-markdown$: |
                    /* NOTE: markdown card doesn't keep class, title, or name */
                    ha-markdown-element {
                      display: flex;
                      flex-direction: row;
                      justify-content: space-around
                    }
                    ha-markdown-element > div {
                      display: flex;
                      align-items: center;
                      flex-direction: column;
                    }
                    ha-markdown-element > div > :nth-child(1) {
                      /* info */
                      font-weight: bold;
                    }
                    ha-markdown-element > div > :nth-child(2) {
                      /* state-badge */
                      color: var(--paper-item-icon-color);
                      margin-top: 0.5em;
                      margin-bottom: 0.5em;
                    }
  - type: markdown
    content: >-
      {% for day in state_attr('sensor.melbourne_pollen_forecast_api',
      'melbourne_6day_pollen_forecast').days[1:] %}
        {% set realdate = strptime(day.date, '%d %B %Y') %}
        {%   if day.pollen_level == 'Low' %}
          {% set icon = 'mdi:thumb-up' %}
        {% elif day.pollen_level == 'Moderate' %}
          {% set icon = 'mdi:flower' %}
        {% elif day.pollen_level == 'High' %}
          {% set icon = 'mdi:flower-pollen' %}
        {% elif day.pollen_level == 'Extreme' %}
          {% set icon = 'mdi:alert-octagram' %}
        {% else %}
          {% set icon = 'mdi:robot-confused' %}
        {% endif %}
        <div>
        <div>{{realdate.strftime('%a')}}</div>
        <ha-icon icon="{{icon}}"></ha-icon>
        <div>{{day.pollen_level}}</div>
        </div>
      {% endfor %}
    title: All except today, button style
    card_mod:
      style:
        ha-markdown$: |
          /* NOTE: markdown card doesn't keep class, title, or name */
          ha-markdown-element {
            display: flex;
            flex-direction: row;
            justify-content: space-around
          }
          ha-markdown-element > div {
            display: flex;
            align-items: center;
            flex-direction: column;
          }
          ha-markdown-element > div > :nth-child(1) {
            /* info */
            font-weight: bold;
          }
          ha-markdown-element > div > :nth-child(2) {
            /* state-badge */
            color: var(--paper-item-icon-color);
            margin-top: 0.5em;
            margin-bottom: 0.5em;
          }
  - type: custom:collapsable-cards
    card_mod:
      style: 'button > :first-child {width: 100%!important;'
    title_card:
      type: markdown
      content: >-
        {% set day = state_attr('sensor.melbourne_pollen_forecast_api',
        'melbourne_6day_pollen_forecast').days[0] %}

        {% set realdate = strptime(day.date, '%d %B %Y') %}

        {%   if day.pollen_level == 'Low' %}
            {% set icon = 'mdi:thumb-up' %}
            {% set advice = 'Get outside' %}
        {% elif day.pollen_level == 'Moderate' %}
            {% set icon = 'mdi:flower' %}
            {% set advice = 'Take a tablet' %}
        {% elif day.pollen_level == 'High' %}
            {% set icon = 'mdi:flower-pollen' %}
            {% set advice = 'Avoid grassy fields' %}
        {% elif day.pollen_level == 'Extreme' %}
            {% set icon = 'mdi:alert-octagram' %}
            {% set advice = 'Stay indoors' %}
        {% else %}
            {% set icon = 'mdi:robot-confused' %}
            {% set advice = 'Fix shit' %}
        {% endif %}

        <div>

        <ha-icon icon="{{icon}}"></ha-icon>

        <div>Pollen forecast<div>{{realdate.strftime('%A')}}</div></div>

        <div>{{day.pollen_level}}<div>{{advice}}</div></div>

        </div>
      card_mod:
        style:
          ha-markdown$: |
            /* NOTE: markdown card doesn't keep class, title, or name */
            ha-markdown-element > div:first-child {margin-top: 0px;}
            ha-markdown-element > div:last-child {margin-bottom: 0px;}
            ha-markdown-element > div {
              display: flex;
              align-items: center;
              flex-direction: row;
              margin-top: 8px;
              margin-bottom: 8px;
            }
            ha-markdown-element > div > :nth-child(1) {
              /* state-badge */
              flex: 0 0 40px;

              position: relative;
              display: inline-block;
              width: 40px;
              color: var(--paper-item-icon-color);
              border-radius: 50%;
              height: 40px;
              text-align: center;
              background-size: cover;
              line-height: 40px;
              vertical-align: middle;
              box-sizing: border-box;
            }
            ha-markdown-element > div > div:nth-child(2) {
              /* info */
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;

              margin-left: 16px;
              margin-right: 8px;
              flex: 1 1 30%;
            }
            ha-markdown-element > div > div > div {
              /* secondary */
              color: var(--secondary-text-color);
            }
            ha-markdown-element > div > div:nth-child(3) {
              /* text-content value */
            }
    cards:
      - type: markdown
        content: >-
          {% for day in state_attr('sensor.melbourne_pollen_forecast_api',
          'melbourne_6day_pollen_forecast').days[1:] %}
            {% set realdate = strptime(day.date, '%d %B %Y') %}
            {%   if day.pollen_level == 'Low' %}
              {% set icon = 'mdi:thumb-up' %}
            {% elif day.pollen_level == 'Moderate' %}
              {% set icon = 'mdi:flower' %}
            {% elif day.pollen_level == 'High' %}
              {% set icon = 'mdi:flower-pollen' %}
            {% elif day.pollen_level == 'Extreme' %}
              {% set icon = 'mdi:alert-octagram' %}
            {% else %}
              {% set icon = 'mdi:robot-confused' %}
            {% endif %}
            <div>
            <div>{{realdate.strftime('%a')}}</div>
            <ha-icon icon="{{icon}}"></ha-icon>
            <div>{{day.pollen_level}}</div>
            </div>
          {% endfor %}
        card_mod:
          style:
            ha-markdown$: |
              /* NOTE: markdown card doesn't keep class, title, or name */
              ha-markdown-element {
                display: flex;
                flex-direction: row;
                justify-content: space-around
              }
              ha-markdown-element > div {
                display: flex;
                align-items: center;
                flex-direction: column;
              }
              ha-markdown-element > div > :nth-child(1) {
                /* info */
                font-weight: bold;
              }
              ha-markdown-element > div > :nth-child(2) {
                /* state-badge */
                color: var(--paper-item-icon-color);
                margin-top: 0.5em;
                margin-bottom: 0.5em;
              }
  - type: markdown
    content: >-
      {% for day in state_attr('sensor.melbourne_pollen_forecast_api',
      'melbourne_6day_pollen_forecast').days %}
        {% set realdate = strptime(day.date, '%d %B %Y') %}
        {%   if day.pollen_level == 'Low' %}
          {% set icon = 'mdi:thumb-up' %}
        {% elif day.pollen_level == 'Moderate' %}
          {% set icon = 'mdi:flower' %}
        {% elif day.pollen_level == 'High' %}
          {% set icon = 'mdi:flower-pollen' %}
        {% elif day.pollen_level == 'Extreme' %}
          {% set icon = 'mdi:alert-octagram' %}
        {% else %}
          {% set icon = 'mdi:robot-confused' %}
        {% endif %}
        <div>
        <div>{{realdate.strftime('%a')}}</div>
        <ha-icon icon="{{icon}}"></ha-icon>
        <div>{{day.pollen_level}}</div>
        </div>
      {% endfor %}
    title: All days, button style
    card_mod:
      style:
        ha-markdown$: |
          /* NOTE: markdown card doesn't keep class, title, or name */
          ha-markdown-element {
            display: flex;
            flex-direction: row;
            justify-content: space-around
          }
          ha-markdown-element > div {
            display: flex;
            align-items: center;
            flex-direction: column;
          }
          ha-markdown-element > div > :nth-child(1) {
            /* info */
            font-weight: bold;
          }
          ha-markdown-element > div > :nth-child(2) {
            /* state-badge */
            color: var(--paper-item-icon-color);
            margin-top: 0.5em;
            margin-bottom: 0.5em;
          }
  - type: markdown
    content: >-
      {% set day = state_attr('sensor.melbourne_pollen_forecast_api',
      'melbourne_6day_pollen_forecast').days[0] %}

      {% set realdate = strptime(day.date, '%d %B %Y') %}

      {%   if day.pollen_level == 'Low' %}
          {% set icon = 'mdi:thumb-up' %}
          {% set advice = 'Get outside' %}
      {% elif day.pollen_level == 'Moderate' %}
          {% set icon = 'mdi:flower' %}
          {% set advice = 'Take a tablet' %}
      {% elif day.pollen_level == 'High' %}
          {% set icon = 'mdi:flower-pollen' %}
          {% set advice = 'Avoid grassy fields' %}
      {% elif day.pollen_level == 'Extreme' %}
          {% set icon = 'mdi:alert-octagram' %}
          {% set advice = 'Stay indoors' %}
      {% else %}
          {% set icon = 'mdi:robot-confused' %}
          {% set advice = 'Fix shit' %}
      {% endif %}

      <div>

      <ha-icon icon="{{icon}}"></ha-icon>

      <div>Pollen forecast<div>{{realdate.strftime('%A')}}</div></div>

      <div>{{day.pollen_level}}<div>{{advice}}</div></div>

      </div>
    title: Today only, alternative entity info
    card_mod:
      style:
        ha-markdown$: |
          /* NOTE: markdown card doesn't keep class, title, or name */
          ha-markdown-element > div:first-child {margin-top: 0px;}
          ha-markdown-element > div:last-child {margin-bottom: 0px;}
          ha-markdown-element > div {
            display: flex;
            align-items: center;
            flex-direction: row;
            margin-top: 8px;
            margin-bottom: 8px;
          }
          ha-markdown-element > div > :nth-child(1) {
            /* state-badge */
            flex: 0 0 40px;

            position: relative;
            display: inline-block;
            width: 40px;
            color: var(--paper-item-icon-color);
            border-radius: 50%;
            height: 40px;
            text-align: center;
            background-size: cover;
            line-height: 40px;
            vertical-align: middle;
            box-sizing: border-box;
          }
          ha-markdown-element > div > div:nth-child(2) {
            /* info */
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;

            margin-left: 16px;
            margin-right: 8px;
            flex: 1 1 30%;
          }
          ha-markdown-element > div > div > div {
            /* secondary */
            color: var(--secondary-text-color);
          }
          ha-markdown-element > div > div:nth-child(3) {
            /* text-content value */
          }
  - type: markdown
    content: >-
      {% for day in state_attr('sensor.melbourne_pollen_forecast_api',
      'melbourne_6day_pollen_forecast').days %}
        {% set realdate = strptime(day.date, '%d %B %Y') %}
        {%   if day.pollen_level == 'Low' %}
          {% set icon = 'mdi:thumb-up' %}
          {% set color = 'lime' %}
          {% set advice = 'Get outside' %}
        {% elif day.pollen_level == 'Moderate' %}
          {% set icon = 'mdi:flower' %}
          {% set color = 'yellow' %}
          {% set advice = 'Take a tablet' %}
        {% elif day.pollen_level == 'High' %}
          {% set icon = 'mdi:flower-pollen' %}
          {% set color = 'orange' %}
          {% set advice = 'Avoid grassy fields' %}
        {% elif day.pollen_level == 'Extreme' %}
          {% set icon = 'mdi:alert-octagram' %}
          {% set color = 'red' %}
          {% set advice = 'Stay indoors' %}
        {% else %}
          {% set icon = 'mdi:robot-confused' %}
          {% set color = 'grey' %}
          {% set advice = 'Fix shit' %}
        {% endif %}
        <div>
        <ha-icon icon="{{icon}}"></ha-icon>
        <div>{{realdate.strftime('%A')}}<div>{{realdate.date()}}</div></div>
        <div>{{day.pollen_level}}<div>{{advice}}</div></div>
        </div>
      {% endfor %}
    title: All days, entity style
    card_mod:
      style:
        ha-markdown$: |
          /* NOTE: markdown card doesn't keep class, title, or name */
          ha-markdown-element > div:first-child {margin-top: 0px;}
          ha-markdown-element > div:last-child {margin-bottom: 0px;}
          ha-markdown-element > div {
            display: flex;
            align-items: center;
            flex-direction: row;
            margin-top: 8px;
            margin-bottom: 8px;
          }
          ha-markdown-element > div > :nth-child(1) {
            /* state-badge */
            flex: 0 0 40px;

            position: relative;
            display: inline-block;
            width: 40px;
            color: var(--paper-item-icon-color);
            border-radius: 50%;
            height: 40px;
            text-align: center;
            background-size: cover;
            line-height: 40px;
            vertical-align: middle;
            box-sizing: border-box;
          }
          ha-markdown-element > div > div:nth-child(2) {
            /* info */
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;

            margin-left: 16px;
            margin-right: 8px;
            flex: 1 1 30%;
          }
          ha-markdown-element > div > div > div {
            /* secondary */
            color: var(--secondary-text-color);
          }
          ha-markdown-element > div > div:nth-child(3) {
            /* text-content value */
          }
1 Like

Cool! Thanks for sharing!

still using this and it works well but I don’t live in ‘Central’ is there a way to scrape Melboure from the header section?:

central is showing Low but its Moderate in melbourne.

Thanks!

I’ll have to take a closer look at this. I think I looked at it at some point but can’t recall the details. Affects me too;)

Thanks! Keep me updated :wink:

just confirming this is still the best method:

  scan_interval: 3600 #3600 sec = hr
  name: Pollen Forecast
  sensor:
    - unique_id: melbourne_pollen_count
      name: Pollen Count
      select: '#district-pollen-div > div > div > div > div > div > div.uk-grid-match.uk-child-width-1-2\@s.uk-text-center.uk-grid-collapse.uk-grid > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div'
      value_template: '{{ value| trim}}'
      attributes:
        - name: Website Last Updated
          select: '#district-pollen-div > div > div > div > div > div > div.uk-grid-match.uk-child-width-1-2\@s.uk-text-center.uk-grid-collapse.uk-grid > div:nth-child(1) > div.ta-notice'
          value_template: "{{ value| replace('Last updated:', '')}}"
      icon: >-
        {% if value == 'Low' %}
          mdi:emoticon-happy
        {% elif value == 'Moderate' %}
          mdi:emoticon-neutral
        {% elif value == 'High' %}
          mdi:emoticon-sad
        {% elif value == 'Extreme' %}
          mdi:emoticon-angry
        {% else %}
          mdi:help-circle
        {% endif %}```

Should just be as per this post.

But I haven’t yet had a chance to sit down properly this season and look over it all.

Please report any issues.

Is Canberra included in the API ??

I couldn’t see it in the main one being used.

But I guess there must be something similar feeding the Canberra pollen app too?

Can’t say I’m very knowledgeable at sniffing/discovery app APIs.

@Triple.two discovered the current one being used.