RFC: A location property for notifications
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, json, openapi
- Domain
- api, backend-api-design
Research direction
Start by reading the Notification value schema and the Notifications API OpenAPI and AsyncAPI schemas named in the proposal. Trace how raise() and update() accept and expose notification fields, including their REST counterparts, and check the existing location data from @signalk/n2k-signalk. Done means the optional property is specified consistently across the schemas and API surfaces, with the compatibility and open questions resolved.
Written by the indexing model from the issue text.
Description
Summary
Add an optional location string to the Notification value: a human-readable place on the vessel or installation the notification refers to, such as "ER Port" or "Galley". Clients show it together with message, so an alarm reads "Highwater – ER Port" instead of "Highwater".
Motivation
An NMEA 2000 alert (PGN 126985 Alert Text) carries two strings: the alert text and the alert location text. Alerting systems such as Maretron N2KView put the condition in the first and the place in the second, so the text alone is often ambiguous. On one boat, ten alerts include "Highwater" twice and "CO 8Ohm" four times, and only the location tells them apart:
| Text | Location |
|---|---|
| CO 8Ohm | Port Fwd Cabin |
| CO 8 Ohm | Port Mid Cabin |
| CO 8Ohm | Galley |
| CO 8Ohm | Masercabin |
| Highwater | Vorpiek Stb |
| Highwater | ER Port |
@signalk/n2k-signalk has published the location since 4.7.0, as a location property next to message in notifications.nmea.*. The Notification schema has no such property, so clients do not know it exists. Freeboard-SK, for example, builds its alert from message and the Notifications API fields only, and shows "Highwater" with no way to tell which bilge is flooding.
Putting the place into message would work in every client today, but it mixes two pieces of information that a client may want to present differently (a column, a filter, a second line), and every producer would format it its own way. A defined property keeps them apart and gives producers one place to put it.
Proposal
Specification
In the Notification value, next to state, method and message:
"location": {
"type": "string",
"description": "Where on the vessel or installation the condition is, in human-readable form, e.g. \"ER Port\" or \"Galley\". Not a geographic position; see position."
}
- Optional. Absent and empty mean "no location given".
- Free text, set by the producer. No vocabulary is defined, because installations name their spaces themselves.
- Distinct from
position, which is the vessel's geographic position when the notification was raised.
The property is named location because that is what n2k-signalk already emits, so the existing N2K mapping becomes conformant without any change.
Server
Notificationin@signalk/server-apigainslocation?: string.- The Notifications API OpenAPI and AsyncAPI schemas document it.
raise()andupdate()in the Notifications API, and their REST counterparts, acceptlocation, so plugins raising alarms can set it.- Notifications that arrive as deltas already keep the whole value, so
locationpasses through to clients unchanged.
Clients
A client that shows a notification's message should show location with it when present. The exact form ("Highwater – ER Port", a second line, a column) is the client's choice.
Producers
@signalk/n2k-signalk: no change; it already setslocationfrom PGN 126985.- Plugins that know the place of a condition (bilge, fire and gas sensors, tank alarms) can set it instead of writing it into
message.
Compatibility
Purely additive. A client that ignores location behaves as today, and a producer that does not set it is unaffected.
Open questions
- Should the Notifications API's own alarms (MOB, for instance) ever set
location? Probably not, sincepositioncovers them. - Should
locationbe translatable, given that PGN 126985 carries a language id? This RFC treats it as display text in whatever language the producer has.
- Dominant language
- JavaScript
- Stars
- 105
- Forks
- 72
- Avg merge
- 11h 49m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SignalK/specification
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
SignalK/specification#700 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 54/100
SignalK/specification#691 ·
-
RFC: depth transducer offsets: one sign convention, transducer position, server-derived depthsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
SignalK/specification#688 · 3 comments · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
SignalK/specification#685 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
SignalK/specification#681 ·
All issues in SignalK/specification
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
TheOdinProject/curriculum#31596 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mailcow/mailcow-dockerized#7725 ·
Maintainers usually reply within 1 day
-
bug need-fix
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
hoverkraft-tech/ci-github-common#694 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
solana-foundation/solana-com#2579 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
vercel-labs/agent-skills#385 ·