signalk-nws-alerts
v0.1.0
Published
SignalK plugin for National Weather Service alerts from weather.gov API
Maintainers
Readme
signalk-nws-alerts
A SignalK plugin that provides National Weather Service (NWS) weather alerts for vessels in US waters.
Overview
This plugin fetches weather alerts from the NWS API based on your vessel's position and publishes them to SignalK. It supports the SignalK Weather API and provides notifications with severity-based states.
Note: This plugin only works for locations within the United States, as it uses the National Weather Service API.
Features
- Automatic polling for weather alerts based on vessel position
- Publishes alerts to SignalK data paths (
environment.outside.nws.alert.*) - Creates SignalK notifications with appropriate severity levels
- Registers as a SignalK Weather API provider for
getWarnings() - Configurable poll interval
- Position subscription for automatic updates when moving
Installation
Install via the SignalK Appstore or manually:
cd ~/.signalk
npm install signalk-nws-alertsRestart SignalK Server and enable the plugin in Server > Plugin Config.
Configuration
| Option | Description | Default | |--------|-------------|---------| | Poll Interval (minutes) | How often to check for new alerts | 5 | | Enable Position Subscription | Subscribe to position updates | true | | User Agent | Contact info for NWS API (email or URL) | signalk-nws-alerts/1.0 |
Note: The NWS API requests that you provide contact information in the User-Agent header. Consider setting this to your email address.
SignalK Data Paths
Alert Data
Each alert is published under environment.outside.nws.alert.<eventType>:
.id- Alert identifier.event- Event type (e.g., "Winter Weather Advisory").headline- Alert headline.description- Full description.instruction- Recommended actions.severity- Extreme, Severe, Moderate, Minor, or Unknown.certainty- Observed, Likely, Possible, or Unknown.urgency- Immediate, Expected, Future, or Unknown.effective- When the alert becomes effective.expires- When the alert expires.onset- Expected onset time.ends- Expected end time.areaDesc- Affected area description.senderName- Issuing NWS office
Metadata
environment.outside.nws.alertCount- Number of active alertsenvironment.outside.nws.lastUpdate- Last update timestamp
Notifications
Alerts are also published as notifications under notifications.weather.nws.<eventType> with states:
| NWS Severity | SignalK State | |--------------|---------------| | Extreme | emergency | | Severe | alarm | | Moderate | warn | | Minor | alert | | Unknown | normal |
Weather API Integration
This plugin registers as a Weather API provider. Other plugins can request warnings via:
const warnings = await app.getWeatherWarnings(position);Requirements
- SignalK Server >= 2.0.0
- Node.js >= 14.0.0
- Vessel position from GPS or other source
License
MIT
Author
Maurice Tamman
