National Weather Service (NWS)


The nws platform uses the National Weather Service web API as a source for meteorological data for your location.

Configuration

Adding National Weather Service (NWS) to your Home Assistant instance can be done via the user interface, by taking the following steps:

  • Browse to your Home Assistant instance.

  • In the sidebar click on Configuration.

  • From the configuration menu select: Integrations.

  • In the bottom right, click on the Add Integration button.

  • From the list, search and select “National Weather Service (NWS)”.

  • Follow the instruction on screen to complete the set up.

After completing, the National Weather Service (NWS) integration will be immediately available for use.

According to the API documentation, a string is required for the API key, and an email address is suggested to be included within the string.

Providing a METAR station code is optional, and if not supplied, the closest station to the latitude and longitude will be chosen. A list of nearby stations is printed to the log with level DEBUG if no station is supplied. Stations can also be found on the NOAA website. Codes with only three characters, for example, ADW should be prefixed with the letter K, KADW.

Two weather entities are created for each entry in the configuration: one for day and night forecasts and one for hourly forecasts. The hourly forecast entity is disabled after configuration but can be enabled by the user. The time supplied for each forecast is the start time for the forecast.

Details about the API are available in the NWS API documentation. The pynws library is used to retrieve data.