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
#1
hello, is it possible to create an action with warning for a drop in pressure over time. Example, drop of 1 hpa per hour. Thank you.
Reply
#2
(2018-03-16, 01:40 PM)all1p Wrote: hello, is it possible to create an action with warning for a drop in pressure over time. Example, drop of 1 hpa per hour. Thank you.

Well it's possible with the help of node-red. You would have to log the data to a file or database or cache them.
There are many tutorials out there on node-red. You can do so much with it that it's really worth to get into it.
Reply
#3
(2018-03-16, 01:57 PM)shark24 Wrote: Well it's possible with the help of node-red. You would have to log the data to a file or database or cache them.
There are many tutorials out there on node-red. You can do so much with it that it's really worth to get into it.

Node red could  certainly do it, I record pressure into a database so checking for a drop over time wouldn't be that tricky once you have the rest sorted out. 

What about a change of nearly 3hPa in 3 minutes? This is a close shave with a tornado a few weeks ago in Portugal 

[Image: S9xceXD.png]
Reply
#4
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.
Reply
#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
#6
(2018-03-16, 02:48 PM)PaddyB Wrote:
(2018-03-16, 02:22 PM)shark24 Wrote: 3 hPa en 3 min c'est effrayant  Big Grin 

Je pensais utiliser une variable globale pour stocker les données des 4 dernières heures. Je suppose que ce serait une approche facile pour les débutants.

Bonne idée - voici un moyen facile de stocker des valeurs de signal dans des variables globales, ainsi qu'un signal de capteur de toute façon. >

Branchez la sortie dans un MQTT et vous pouvez voir toutes les données sur le web ainsiCool 


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"
   }
]

Merci pour vos réponses. Je soupçonnais que la solution était l'utilisation du nœud rouge. Je ne comprends rien aux programmes :-) Je vais d'abord chercher des tutoriels en français pour commencer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)