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
How to publish a timestamp/ environment.time?
#2
(2017-09-11, 10:31 AM)Alpenskipper Wrote: Hi!
For an airpressure chart, I would need the local time (the time of the raspberry pi, no nmea sequences with a time string available ).
How can the internal raspberry pi time be published in OP?
Martin

Node red has a chart node which does all that for you.

Something like...(The limit node would be better set to something like 1 per minute)

Code:
[
   {
       "id": "747c2583.7cc55c",
       "type": "websocket in",
       "z": "c9b82bf0.2e8e78",
       "name": "SignalK input",
       "server": "d4503be4.7ab258",
       "client": "",
       "x": 130,
       "y": 80,
       "wires": [
           [
               "f40c5860.801988"
           ]
       ]
   },
   {
       "id": "f40c5860.801988",
       "type": "json",
       "z": "c9b82bf0.2e8e78",
       "name": "",
       "pretty": false,
       "x": 250,
       "y": 120,
       "wires": [
           [
               "97e64833.127fa8"
           ]
       ]
   },
   {
       "id": "97e64833.127fa8",
       "type": "switch",
       "z": "c9b82bf0.2e8e78",
       "name": "Is it Met data?",
       "property": "payload.updates.\"$source\"",
       "propertyType": "jsonata",
       "rules": [
           {
               "t": "eq",
               "v": "OPsensors.I2C.BMP180",
               "vt": "str"
           }
       ],
       "checkall": "false",
       "outputs": 1,
       "x": 360,
       "y": 200,
       "wires": [
           [
               "33642b2d.aa92d4"
           ]
       ]
   },
   {
       "id": "33642b2d.aa92d4",
       "type": "change",
       "z": "c9b82bf0.2e8e78",
       "name": "create msg.presure",
       "rules": [
           {
               "t": "set",
               "p": "payload",
               "pt": "msg",
               "to": "msg.payload.updates.values[path=\"environment.outside.pressure\"].$round(value)/100",
               "tot": "jsonata"
           }
       ],
       "action": "",
       "property": "",
       "from": "",
       "to": "",
       "reg": false,
       "x": 330,
       "y": 300,
       "wires": [
           [
               "f47dd59d.508d18",
               "2e555623.d43aba",
               "ba9d42d3.142ae"
           ]
       ]
   },
   {
       "id": "f47dd59d.508d18",
       "type": "delay",
       "z": "c9b82bf0.2e8e78",
       "name": "",
       "pauseType": "rate",
       "timeout": "5",
       "timeoutUnits": "seconds",
       "rate": "1",
       "nbRateUnits": "1",
       "rateUnits": "second",
       "randomFirst": "1",
       "randomLast": "5",
       "randomUnits": "seconds",
       "drop": true,
       "x": 510,
       "y": 260,
       "wires": [
           [
               "1e715698.7829e9"
           ]
       ]
   },
   {
       "id": "1e715698.7829e9",
       "type": "ui_text",
       "z": "c9b82bf0.2e8e78",
       "group": "78fc673a.a74ed8",
       "order": 0,
       "width": 0,
       "height": 0,
       "name": "Pressure",
       "label": "Pressure",
       "format": "{{msg.payload}}",
       "layout": "row-spread",
       "x": 660,
       "y": 200,
       "wires": []
   },
   {
       "id": "2e555623.d43aba",
       "type": "debug",
       "z": "c9b82bf0.2e8e78",
       "name": "",
       "active": true,
       "console": "false",
       "complete": "false",
       "x": 490,
       "y": 380,
       "wires": []
   },
   {
       "id": "ba9d42d3.142ae",
       "type": "delay",
       "z": "c9b82bf0.2e8e78",
       "name": "",
       "pauseType": "rate",
       "timeout": "5",
       "timeoutUnits": "seconds",
       "rate": "1",
       "nbRateUnits": "1",
       "rateUnits": "second",
       "randomFirst": "1",
       "randomLast": "5",
       "randomUnits": "seconds",
       "drop": true,
       "x": 550,
       "y": 300,
       "wires": [
           [
               "6d0fb71d.7c2098"
           ]
       ]
   },
   {
       "id": "6d0fb71d.7c2098",
       "type": "ui_chart",
       "z": "c9b82bf0.2e8e78",
       "name": "",
       "group": "78fc673a.a74ed8",
       "order": 0,
       "width": 0,
       "height": 0,
       "label": "chart",
       "chartType": "line",
       "legend": "false",
       "xformat": "HH:mm:ss",
       "interpolate": "linear",
       "nodata": "",
       "dot": false,
       "ymin": "",
       "ymax": "",
       "removeOlder": 1,
       "removeOlderPoints": "",
       "removeOlderUnit": "3600",
       "cutout": 0,
       "colors": [
           "#1f77b4",
           "#aec7e8",
           "#ff7f0e",
           "#2ca02c",
           "#98df8a",
           "#d62728",
           "#ff9896",
           "#9467bd",
           "#c5b0d5"
       ],
       "x": 720,
       "y": 320,
       "wires": [
           [],
           []
       ]
   },
   {
       "id": "d4503be4.7ab258",
       "type": "websocket-listener",
       "z": "",
       "path": "ws://localhost:3000/signalk/v1/stream",
       "wholemsg": "false"
   },
   {
       "id": "78fc673a.a74ed8",
       "type": "ui_group",
       "z": "",
       "name": "Gauges",
       "tab": "2b930b0f.158ef4",
       "disp": true,
       "width": "6"
   },
   {
       "id": "2b930b0f.158ef4",
       "type": "ui_tab",
       "z": "",
       "name": "Gauges",
       "icon": "dashboard",
       "order": 1
   }
]

[Image: aDDXVl4.png]
Reply


Messages In This Thread
RE: How to publish a timestamp/ environment.time? - by PaddyB - 2017-09-11, 11:53 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)