RFC: A location property for notifications
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, json, openapi
- Ambito
- api, backend-api-design
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- JavaScript
- Stelle
- 105
- Fork
- 72
- Merge medio
- 11h 49m
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SignalK/specification
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
SignalK/specification#700 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 54/100
SignalK/specification#691 ·
-
RFC: depth transducer offsets: one sign convention, transducer position, server-derived depthsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
SignalK/specification#688 · 3 commenti · 1 reazione ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
SignalK/specification#685 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
SignalK/specification#681 ·
Tutte le issue di SignalK/specification
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100
TheOdinProject/curriculum#31596 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
mailcow/mailcow-dockerized#7725 ·
I maintainer di solito rispondono entro 1 giorno
-
bug need-fix
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
hoverkraft-tech/ci-github-common#694 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 94/100
solana-foundation/solana-com#2579 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
vercel-labs/agent-skills#385 ·