@meri-imperiumi/signalk-mob-notifier 1.0.3 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,3 +8,12 @@ This plugin detects if Signal K has seen an AIS MOB (MMSI starting with `972`),
8
8
  * Visual with apps like Freeboard
9
9
 
10
10
  Please note that this plugin aims to aid with noticing and locating crew overboard. It is not a replacement for "proper" alerting mechanisms via dedicated alert buzzers, chartplotters, or a VHF radio.
11
+
12
+ ## Changes
13
+
14
+ * 1.1.1 (2025-09-18)
15
+ - Notifications include position when available
16
+ * 1.1.0 (2025-09-04)
17
+ - Notification is not re-published if it already exists
18
+ * 1.0.0 (2025-08-25)
19
+ - Initial release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meri-imperiumi/signalk-mob-notifier",
3
- "version": "1.0.3",
3
+ "version": "1.1.1",
4
4
  "description": "Create Signal K notifications for discovered AIS MOB, EPIRB, and SART beacons",
5
5
  "main": "plugin/index.js",
6
6
  "scripts": {
@@ -12,6 +12,7 @@
12
12
  },
13
13
  "keywords": [
14
14
  "signalk-node-server-plugin",
15
+ "signalk-category-ais",
15
16
  "signalk-category-notifications"
16
17
  ],
17
18
  "author": "Henri Bergius <henri.bergius@iki.fi>",
package/plugin/index.js CHANGED
@@ -97,6 +97,11 @@ module.exports = (app) => {
97
97
  return;
98
98
  }
99
99
  mobs.forEach((mmsi) => {
100
+ // Check if we already have a notification for this one
101
+ const notification = app.getSelfPath(`notifications.mob.${mmsi}`);
102
+ if (notification) {
103
+ return;
104
+ }
100
105
  let message = 'Crew Overboard Beacon detected';
101
106
  if (mmsi.indexOf('970') === 0) {
102
107
  message = 'Search and Rescue Transponder Beacon detected';
@@ -107,9 +112,9 @@ module.exports = (app) => {
107
112
  // For each MOB get direction and range
108
113
  const ownPosition = app.getSelfPath('navigation.position');
109
114
  const mobPosition = app.getPath(`vessels.urn:mrn:imo:mmsi:${mmsi}.navigation.position`);
110
- if (ownPosition && mobPosition) {
111
- const me = new Point(ownPosition.latitude, ownPosition.longitude);
112
- const they = new Point(mobPosition.latitude, mobPosition.longitude);
115
+ if (ownPosition && ownPosition.value && mobPosition && mobPosition.value) {
116
+ const me = new Point(ownPosition.value.latitude, ownPosition.value.longitude);
117
+ const they = new Point(mobPosition.value.latitude, mobPosition.value.longitude);
113
118
  const distance = me.distanceTo(they, 'K') * 1000; // In meters
114
119
  const direction = longDirection(me.directionTo(they));
115
120
  message = `${message} ${distance} meters to ${direction}`;
@@ -129,6 +134,10 @@ module.exports = (app) => {
129
134
  path: `notifications.mob.${mmsi}`,
130
135
  value: {
131
136
  message,
137
+ position: mobPosition ? mobPosition.value : null,
138
+ data: {
139
+ mmsi,
140
+ },
132
141
  state: 'emergency',
133
142
  method: ['visual', 'sound'],
134
143
  },
@@ -155,7 +164,7 @@ module.exports = (app) => {
155
164
  properties: {
156
165
  interval: {
157
166
  type: 'integer',
158
- default: 5,
167
+ default: 30,
159
168
  title: 'How often to check for Beacons (in seconds)?',
160
169
  },
161
170
  },