This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
action alert on pressure drop
#5
(2018-03-16, 02:22 PM)shark24 Wrote: 3 hPa in 3 min that's scary  Big Grin 

I was thinking of using a global variable to store the data of the last 4 hours or so. I guess that would be an easy approach for beginners.

Good idea - here's an easy way to store signalk values into global variables, well some sensor signalk anyway.  >

Plug the output into a MQTT out and you can see all the data on the web as well Cool 


Code:
[
   {
       "id": "72db7bb3.6de9e4",
       "type": "websocket in",
       "z": "3f30ea31.da3756",
       "name": "SignalK input",
       "server": "fc1b2b62.0b63a8",
       "client": "",
       "x": 169,
       "y": 809,
       "wires": [
           [
               "fd8f5723.077e38"
           ]
       ]
   },
   {
       "id": "fd8f5723.077e38",
       "type": "function",
       "z": "3f30ea31.da3756",
       "name": "Create global variable",
       "func": "obj=msg.payload.updates[0].values[0].path;\nvalue=msg.payload.updates[0].values[0].value;\nglobal.set(obj, value);\n\nmsg.payload =  value;\nmsg.topic = obj;\nreturn msg;",
       "outputs": 1,
       "noerr": 0,
       "x": 308,
       "y": 902,
       "wires": [
           [
               "6e82c403.2d258c",
               "ec14fb6b.9c39e8"
           ]
       ]
   },
   {
       "id": "6e82c403.2d258c",
       "type": "debug",
       "z": "3f30ea31.da3756",
       "name": "",
       "active": false,
       "console": "false",
       "complete": "true",
       "x": 547,
       "y": 915,
       "wires": []
   },
   {
       "id": "ec14fb6b.9c39e8",
       "type": "mqtt out",
       "z": "3f30ea31.da3756",
       "name": "",
       "topic": "",
       "qos": "",
       "retain": "",
       "broker": "d07a7e43.825c9",
       "x": 597,
       "y": 848,
       "wires": []
   },
   {
       "id": "fc1b2b62.0b63a8",
       "type": "websocket-listener",
       "z": "",
       "path": "ws://localhost:3000/signalk/v1/stream",
       "wholemsg": "false"
   },
   {
       "id": "d07a7e43.825c9",
       "type": "mqtt-broker",
       "z": "",
       "broker": "m10.cloudmqtt.com",
       "port": "16098",
       "clientid": "",
       "usetls": false,
       "compatmode": true,
       "keepalive": "60",
       "cleansession": true,
       "willTopic": "",
       "willQos": "0",
       "willPayload": "",
       "birthTopic": "press",
       "birthQos": "0",
       "birthPayload": "test birth"
   }
]
Reply


Messages In This Thread
action alert on pressure drop - by all1p - 2018-03-16, 01:40 PM
RE: action alert on pressure drop - by shark24 - 2018-03-16, 01:57 PM
RE: action alert on pressure drop - by PaddyB - 2018-03-16, 02:11 PM
RE: action alert on pressure drop - by shark24 - 2018-03-16, 02:22 PM
RE: action alert on pressure drop - by PaddyB - 2018-03-16, 02:48 PM
RE: action alert on pressure drop - by all1p - 2018-03-16, 04:15 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)