finity69x2 / nws_alerts

An updated version of the nws_alerts custom integration for Home Assistant
86 stars 29 forks source link

Test Alerts not filtered out #13

Closed GlennGoddard closed 3 years ago

GlennGoddard commented 3 years ago

Duplicate from HA forum. A method to be able to filter out test alerts would be nice.

attribution: Data provided by Weather.gov
title: Tsunami Warning - Tsunami Warning
event_id: >-
  https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.71d7d0751a32f5aaaf1f8459b0400eed5df86808.001.1-https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.1fa001cb9ac3633f7dea41e5f4847966f7a7a14e.001.1
message_type: AlertAlert
display_desc: |-

  >
  Headline: Tsunami Warning
  Message Type: Alert
  Severity: Extreme
  Certainty: Likely
  Description: PZZ530-AKZ017>029-135-131-125-121-171-181-185-187-191-195-
  BCZ130-230-250-260-280-160-142-141-150-121-122-220-210-922-
  912-921-911-110-WAZ503-506>511-001-514>517-021-ORZ001-002-
  021-022-CAZ039>043-087-034-035-530-006-506-508-509-529-505-
  002-001-549-550-151717-
  /T.NEW.PAAQ.TS.W.9013.210715T1617Z-210715T1717Z/
  Alaska, British Columbia, Washington, Oregon and California
  coastal areas

  ...THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY...

  ...THIS IS A TEST TO DETERMINE TRANSMISSION TIMES INVOLVED IN THE
  DISSEMINATION OF TSUNAMI INFORMATION...

  RESPONSES ARE REQUIRED FROM
  ---------------------------
  * All Coastal Weather Forecast Offices in Alaska, Washington,
  Oregon and California

  * USAF 11th Rescue Coordination Center at Elmendorf AFB

  * California, Oregon, Washington and Alaska State Warning Points

  * Emergency Management British Columbia

  * The Pacific Storm Prediction Centre in British Columbia

  * Joint Typhoon Warning Center in Hawaii

  * U.S. Coast Guard 11th, 13th, 17th District Offices

  * U.S. Coast Guard Kodiak COMMSTA and CAMSPAC Point Reyes, CA

  * Canadian Coast Guard MCTS COMOX and/or Victoria

  * FAA Regional Operations Center in Seattle

  * All Pacific Coast Tsunamiready Community Warning Points.

  RESPONSES SHOULD INCLUDE
  ------------------------
  * Time-of-receipt
  * Agency name
  * Email address
  * Phone number

  Weather Service Offices should respond in accordance with local
  directives. All others should reply by one of the available methods
  below.

  SEND RESPONSE BY
  ----------------
  * Web - ntwc.arh.noaa.gov/commtest/index.html
  * Email address - ntwc@noaa.gov
  * AFTN address  - PAAQYQYX
  * AWIPS         - TMA
  * Fax           - 907-745-6071

  ...THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY...

  ...THIS IS A TEST TO DETERMINE TRANSMISSION TIMES INVOLVED IN THE
  DISSEMINATION OF TSUNAMI INFORMATION...
  Instruction: 

  -

  >
  Headline: Tsunami Warning
  Message Type: Alert
  Severity: Extreme
  Certainty: Likely
  Description: PZZ530-AKZ017>029-135-131-125-121-171-181-185-187-191-195-
  BCZ130-230-250-260-280-160-142-141-150-121-122-220-210-922-
  912-921-911-110-WAZ503-506>511-001-514>517-021-ORZ001-002-
  021-022-CAZ039>043-087-034-035-530-006-506-508-509-529-505-
  002-001-549-550-151717-
  /T.NEW.PAAQ.TS.W.9013.210715T1617Z-210715T1717Z/
  Alaska, British Columbia, Washington, Oregon and California
  coastal areas

  ...THIS_MESSAGE_IS_FOR_TEST_PURPOSES_ONLY...

  ...THIS IS A TEST TO DETERMINE TRANSMISSION TIMES INVOLVED IN THE
  DISSEMINATION OF TSUNAMI INFORMATION...

  RESPONSES ARE REQUIRED FROM
  ---------------------------
  * All Coastal Weather Forecast Offices in Alaska, Washington,
  Oregon and California

  * USAF 11th Rescue Coordination Center at Elmendorf AFB

  * California, Oregon, Washington and Alaska State Warning Points

  * Emergency Management British Columbia

  * The Pacific Storm Prediction Centre in British Columbia

  * Joint Typhoon Warning Center in Hawaii

  * U.S. Coast Guard 11th, 13th, 17th District Offices

  * U.S. Coast Guard Kodiak COMMSTA and CAMSPAC Point Reyes, CA

  * Canadian Coast Guard MCTS COMOX and/or Victoria

  * FAA Regional Operations Center in Seattle

  * All Pacific Coast Tsunamiready Community Warning Points.

  RESPONSES SHOULD INCLUDE
  ------------------------
  * Time-of-receipt
  * Agency name
  * Email address
  * Phone number

  Weather Service Offices should respond in accordance with local
  Instruction: 
spoken_desc: |-
  Tsunami Warning

  -

  Tsunami Warning
friendly_name: NWS Alerts
icon: mdi:alert
finity69x2 commented 3 years ago

I likely won't filter out any alerts in the integration but if you look in the raw alert notice on the NWS site there is a "status:" entry.

for that test alert of yours above it returned a value of - "status": "Test".

It looks like there are two possibilities for that entry - "Test" or "Actual".

If I add that to the integration could you more easily filter on that?

GlennGoddard commented 3 years ago

I think that would work better than what I am attempting now with the conditional template (which I don't know if it works yet)

finity69x2 commented 3 years ago

Ok, once firstof9 gets his PR completed then I'll add that change to the integration.

GlennGoddard commented 3 years ago

I never saw this get updated in HACS.

finity69x2 commented 3 years ago

It hasn't been done yet. Firstof9 is working on some changes to the config flow and update frequency code first. Then I'll get the change done for this.

finity69x2 commented 3 years ago

The update has been released. let me know if it works for your use.

I'll close this now but you can re-open it if there is any issues related to this.