Understanding Alarm, Alert, and Notification Handling

87 views
Skip to first unread message

Владимир Калачихин

unread,
Mar 31, 2022, 3:26:18 PM3/31/22
to Signal K
"Alarms are raised by placing an alarm object in the vessels.self.notifications tree"

Ok, I send message via wesocket:
{
    "requestId": "01713c7f-4f3d-419f-abb6-92bc18d4ca70",
    "put": {
        "path": "notifications.mob",
        "value": {
            "method": ["sound"],
            "state": "alarm",
            "message": "A man overboard!",
        },
       "timestamp": "2022-03-31T19:03:24.487Z"
   }
}

I receive response:
{
  "state": "COMPLETED",
  "requestId": "01713c7f-4f3d-419f-abb6-92bc18d4ca70",
  "statusCode": 405,
  "message": "PUT not supported for notifications.mob",
  "href": "/signalk/v1/requests/01713c7f-4f3d-419f-abb6-92bc18d4ca70"
}

What's wrong?

Владимир Калачихин

unread,
Apr 1, 2022, 11:01:49 AM4/1/22
to Signal K
So I fully not understand how it works.
I could not set any value on server from client by any way except via normal socket by publish delta. "PUT Requests" as it described in https://signalk.org/specification/1.5.0/doc/put.html not works for me.
четверг, 31 марта 2022 г. в 22:26:18 UTC+3, Владимир Калачихин:

Paul Reeve

unread,
Apr 1, 2022, 11:23:26 AM4/1/22
to sig...@googlegroups.com
Have you registered a handler for PUT requests on the target path?

See the plugin documentation documentation for:

app.registerPutHandler(context, path, callback, source)


Paul
> --
> You received this message because you are subscribed to the Google
> Groups "Signal K" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to signalk+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/signalk/b44f95a1-3e5c-4d7c-9f24-4d6b6095fd80n%40googlegroups.com
> [1].
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/signalk/b44f95a1-3e5c-4d7c-9f24-4d6b6095fd80n%40googlegroups.com?utm_medium=email&utm_source=footer

--
Paul Reeve

pre...@pdjr.eu
+44.7786.528092
+31.627.168877

Владимир Калачихин

unread,
Apr 1, 2022, 12:06:00 PM4/1/22
to Signal K


пятница, 1 апреля 2022 г. в 18:23:26 UTC+3, pre...@pdjr.eu:
Have you registered a handler for PUT requests on the target path?

Is it necessary for existing paths?

Teppo Kurki

unread,
Apr 1, 2022, 12:50:47 PM4/1/22
to signalk
On Thu, Mar 31, 2022 at 10:26 PM Владимир Калачихин <v.kala...@gmail.com> wrote:
"Alarms are raised by placing an alarm object in the vessels.self.notifications tree"

Apologies, the wording is pretty unclear here. 

Notifications are just values (with no clear outside action), all you need to do is to send a delta message with notification path and a corresponding value, like 

{
"path": "notifications.propulsion.port.revLimitExceeded",
"value": {
"state": "normal",
"method": ["visual"],
"message": "Port Engine Rev Limit Exceeded is Normal"
}
}

PUT causes a lot of confusion. I extended the PUT part in the FAQ a little: https://github.com/SignalK/signalk-server/wiki/FAQ:-Frequently-Asked-Questions#how-do-i-send-data-to-the-server



Владимир Калачихин

unread,
Apr 1, 2022, 2:12:40 PM4/1/22
to Signal K
Ok, maybe I'll understand someday the difference between PUT and delta messages.

But this: "Sensor data / new values for something are sent as delta messages over the WebSocket connection. " was the key info. Thanks.

пятница, 1 апреля 2022 г. в 19:50:47 UTC+3, Teppo Kurki:

Владимир Калачихин

unread,
Apr 7, 2022, 4:20:12 PM4/7/22
to Signal K
By the way, I understand correctly that "Expected implementation behaviour" not implemented in current version? It's not worked for me...

Teppo Kurki

unread,
Apr 8, 2022, 11:47:35 AM4/8/22
to signalk
You mean the automatic notifications based on thresholds in zones? Activate the zones plugin.

On Thu, Apr 7, 2022 at 11:20 PM Владимир Калачихин <v.kala...@gmail.com> wrote:
By the way, I understand correctly that "Expected implementation behaviour" not implemented in current version? It's not worked for me...

--
You received this message because you are subscribed to the Google Groups "Signal K" group.
To unsubscribe from this group and stop receiving emails from it, send an email to signalk+u...@googlegroups.com.

Владимир Калачихин

unread,
Apr 8, 2022, 1:56:54 PM4/8/22
to Signal K
пятница, 8 апреля 2022 г. в 18:47:35 UTC+3, Teppo Kurki:
You mean the automatic notifications based on thresholds in zones? Activate the zones plugin.

 Ok, I activated it. But nothing happened.
I do:
add zones and alarmMethod to the needed meta via my server plugin,
running a simulation.

I see that the current value is in alarm zone. I expect to appear a corresponding "notification" path. But this is not happening. Should it?

Владимир Калачихин

unread,
Apr 19, 2022, 5:04:13 PM4/19/22
to Signal K
пятница, 1 апреля 2022 г. в 19:50:47 UTC+3, Teppo Kurki:
On Thu, Mar 31, 2022 at 10:26 PM Владимир Калачихин <v.kala...@gmail.com> wrote:
PUT causes a lot of confusion. I extended the PUT part in the FAQ a little: https://github.com/SignalK/signalk-server/wiki/FAQ:-Frequently-Asked-Questions#how-do-i-send-data-to-the-server

I have not reached Enlightenment...
First, I could not replicate the docs examples. So, if someone points me to a minimal working example - both client and server - I would be very grateful.
Second, I don't understand what app.registerPutHandler is better than just app.get (app.put, app.all)? Both are only available from the client, and Express is better documented.
Reply all
Reply to author
Forward
0 new messages