OzPoll - Australian Pollen Forecast (Integration)

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.

Actually I think you may just need to switch from app=1 to app=2. You may need to try different version= too.

https://api.pollenforecast.com.au/app/json/app_data.php?app=2&version=4

Apparently I’d figured this out before but had forgotten!)

OK, thanks, I’ll have a play.

1 Like

I seem to be seeing differences between the api and the app/website.

Not sure if it is really working this season. Need to investigate. Would be good if others confirm too.

I changed up the code to match latest HA standards:

    - name: Melbourne Pollen Forecast via API
      state: ''
      attributes:
        melbourne_6day_pollen_forecast: >-
          {% set forecastpageHTML = states.sensor.melbourne_pollen_api_html.attributes.forecastpage %}
          {% set LowerForecastpageHTML = forecastpageHTML|lower  %}
          {{ 
          '{\n' +
          LowerForecastpageHTML
          |replace('monday', 'Mon')
          |replace('tuesday', 'Tue')
          |replace('wednesday', 'Wed')
          |replace('thursday', 'Thu')
          |replace('friday', 'Fri')
          |replace('saturday', 'Sat')
          |replace('sunday', 'Sun')
          |replace('melbourne pollen forecast', '"days": [')
          |replace('<h2 ', '*nl*{*nl*"day_short_name":"<h1 ')
          |replace('</h2>', '</h2>",*nl* ')
          |replace('<p', '"date":"<p')
          |replace('p>', '<\/p>",*nl* ')
          |replace('<div class="pollen-forecast-level', '"pollen_level":"<<div class="pollen-forecast-level')
          |replace('low', 'Low"},')
          |replace('moderate', 'Moderate"},')
          |replace('high', 'High"},')
          |replace('extreme', 'Extreme"},')
          |striptags
          |replace('*nl*', '\n') + ']\n}'
          }} 

The sensor is showing LOW for Wednesday even though its HIGH:

The only LOW reading is east gippsland:

Is there a way to make the state of the sensor TODAY’s forecast only

1 Like

Looks like it might be broken again.

Hopefully I’ll have some time on the weekend to work on a fix.

So the unoffcial API these sensors use no longer appears to be being updated.
So it’s an API issue beyond my control rather than a code issue.

I’m digging around for alternative data sources but haven’t been able to find anything yet.

For those that are keen you could try to resurrect the webpage scraper approach to get just today’s info from the webpage (code may need modifications).

Validating the API results against the app show that the api results appear to be incorrect (always showing “Low”.

FYI @oneseventhree

Ahh thats a shame. I did see there is a version 6 now:
https://api.pollenforecast.com.au/app/json/app_data.php?app=2&version=6

I was using this:

 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 %}

but its showing central and not:

Is there anyway to scrape that section instead?
I tried and couldn’t figure it out when trying to put it in the code above

Yeah I looked at version 6 too but same story.

I’ll probably look at getting the Melbourne scrape running for myself over the coming days, so I’ll keep you posted.

that would be great! thank you. The website hasn’t changed in a while so it should last :slight_smile:

Had to fiddle with the select but think I’ve got the following data fields.

multiscrape:
############################################################################
#Melbourne Pollen Forecast
###########################################################################
  - resource: https://www.melbournepollen.com.au/
    scan_interval: 3600 #3600 sec = 1 hr
    name: Pollen Forecast
    sensor:
      - unique_id: pollen_forecast_today_melbourne_grass
        name: Pollen Forecast Today Melbourne Grass 
        select: '#plevel'
        value_template: '{{ value| trim}}'
        attributes:
          - name: Forecast Date
            select: '#pdate.pollen-date'
            value_template: '{{ value| trim}}'
            # value_template: "{{ value| replace('Last updated:', '')}}"
          - 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 %}

Seems to work for me! Thanks for the quick response. Hopefully we can test it out soon when the warmer weather comes!

1 Like