How to prevent this automation from triggering

using this automation:

automation:

  - alias: Notify Rss feed updated
    trigger:
      platform: event
      event_type: feedreader
    mode: queued
    action:
      service: persistent_notification.create
      data:
        title: >
          {{trigger.event.data.title}}
#({{trigger.event.data.link}})
        message: >
          {% set url = trigger.event.data.feed_url.split('https://')[1] %}
          {% set source = {'www.home-assistant.io/atom.xml':'Home-assistant',
                           'hasspodcast.io/feed/podcast':'Hass podcast',
                           'www.gdacs.org/xml/rss.xml':'GDACS'} %}
          ![image](/local/various/rss_icon.png) {{as_timestamp(now())|timestamp_custom('%X %d-%b-%Y', true)}}: New Rss feed for [{{source[url]}}]({{trigger.event.data.link}})

#          Event.data: {{trigger.event.data}}
#https://www.gdacs.org/report.aspx?eventtype=TC&eventid=1000743
        notification_id: >
          {% set url = trigger.event.data.feed_url.split('https://')[1] %}
          {% set source = {'www.home-assistant.io/atom.xml':'Home-assistant',
                           'hasspodcast.io/feed/podcast':'Hass podcast',
                           'www.gdacs.org/xml/rss.xml':'GDACS'} %}
          {% set suffix = trigger.event.data.title[0:5] %}
          rss-feed-{{source[url] + '-' + suffix}}

give me a persistent notification upon a new RSS feed, and almost always works perfectly fine, with a sensible text and link in the notification.
However, every once in a while I see this:


which I obviously would like to not happen. the link it finds is correct in this case https://www.gdacs.org/report.aspx?eventtype=TC&eventid=1000756 and still it show the odd unknowns.

this is in the states:


What am I missing in the template, or, maybe, should I use as a condition for this not to happen?

thanks for having a look!

Use a template condition with something like {{"unknown" not in trigger.event.data.title}}. It’ll work fine unless they say that “The hurricane’s ___ is unknown”.

dont think unknown is in the title, this seems to be more of an issue with the full data coming from the gdacs integration, rendering the template to be unknown ( {{is none}} )

fior reference, this is what a correct notification looks like:

added Debugging Event data: {{trigger.event.data}} to the message to see what the exact returned data is when this happens again…

update

this is the full data as expected:

22:26:32 02-Jan-2021: New Rss feed for GDACS
Debugging Event data: {'title': 'Green alert for tropical cyclone DANILO-21. Population affected by Category 1 (120 km/h) wind speeds or higher is 0.', 'title_detail': {'type': 'text/plain', 'language': None, 'base': 'https://www.gdacs.org/xml/rss.xml', 'value': 'Green alert for tropical cyclone DANILO-21. Population affected by Category 1 (120 km/h) wind speeds or higher is 0.'}, 'summary': 'From 01/01/2021 to 02/01/2021, a Tropical Storm (maximum wind speed of 130 km/h) DANILO-21 was active in SWIndian. The cyclone affects these countries: [unknown] (vulnerability [unknown]). Estimated population affected by category 1 (120 km/h) wind speeds or higher is 0.', 'summary_detail': {'type': 'text/html', 'language': None, 'base': 'https://www.gdacs.org/xml/rss.xml', 'value': 'From 01/01/2021 to 02/01/2021, a Tropical Storm (maximum wind speed of 130 km/h) DANILO-21 was active in SWIndian. The cyclone affects these countries: [unknown] (vulnerability [unknown]). Estimated population affected by category 1 (120 km/h) wind speeds or higher is 0.'}, 'links': [{'type': 'image/png', 'length': '1', 'href': 'https://www.gdacs.org/saved/gdacs/tc/1000756/1000756_5_tn.png', 'rel': 'enclosure'}, {'rel': 'alternate', 'type': 'text/html', 'href': 'http://www.gdacs.org/report.aspx?eventtype=TC&eventid=1000756'}], 'gdacs_temporary': 'false', 'link': 'http://www.gdacs.org/report.aspx?eventtype=TC&eventid=1000756', 'published': 'Sat, 02 Jan 2021 18:00:00 GMT', 'published_parsed': time.struct_time(tm_year=2021, tm_mon=1, tm_mday=2, tm_hour=18, tm_min=0, tm_sec=0, tm_wday=5, tm_yday=2, tm_isdst=0), 'gdacs_iscurrent': 'true', 'gdacs_fromdate': 'Fri, 01 Jan 2021 18:00:00 GMT', 'gdacs_todate': 'Sat, 02 Jan 2021 18:00:00 GMT', 'gdacs_durationinweek': '0', 'gdacs_year': '2021', 'tags': [{'term': 'TC1', 'scheme': None, 'label': None}], 'id': 'TC1000756', 'guidislink': False, 'geo_lat': '-11.1', 'geo_long': '72.4', 'geo_point': '', 'gdacs_bbox': '58.4390182745312 84.4390182745312 -27.6993843710741 -1.69938437107415', 'where': {'type': 'Point', 'coordinates': (72.4, -11.1)}, 'gdacs_cap': 'https://www.gdacs.org/contentdata/resources/TC/1000756/cap_1000756.xml', 'gdacs_icon': 'http://www.gdacs.org/Images/gdacs_icons/alerts/Green/TC.png', 'gdacs_version': '5', 'gdacs_eventtype': 'TC', 'gdacs_alertlevel': 'Green', 'gdacs_alertscore': '1', 'gdacs_episodealertlevel': 'Green', 'gdacs_episodealertscore': '1', 'gdacs_eventname': 'DANILO-21', 'gdacs_eventid': '1000756', 'gdacs_episodeid': '5', 'gdacs_calculationtype': 'tropicalcyclonewithstormsurge', 'gdacs_severity': {'unit': 'km/h', 'value': '129.6288'}, 'gdacs_population': {'unit': 'Pop74', 'value': '0'}, 'gdacs_vulnerability': {'value': '0'}, 'gdacs_iso3': '', 'gdacs_country': '', 'gdacs_glide': '', 'gdacs_mapimage': '', 'gdacs_maplink': '', 'gdacs_gtsimage': '', 'gdacs_gtslink': '', 'gdacs_resource': {'id': 'event_rss', 'version': '0', 'source': 'JRC', 'url': 'http://www.gdacs.org//datareport/resources/TC/1000756/rss_1000756.xml', 'type': 'rss'}, 'gdacs_title': 'Event in rss format', 'gdacs_description': 'The event data in xml format', 'gdacs_acknowledgements': 'Copyright European Union. Syndication allowed, provided the source is acknowledged.', 'gdacs_accesslevel': 'Public', 'gdacs_resources': '', 'feed_url': 'https://www.gdacs.org/xml/rss.xml'}