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
Change data path...
#4
(2021-03-14, 05:41 AM)SCarns Wrote:
(2021-03-13, 07:29 PM)beercansailor Wrote: Hi Steve, you may want to look into applying node-RED to this challenge. It's one of the signalk plugins.

I figured. I’ve been looking at it, but haven’t figured it out yet. 

Thanks. 

Steve

Try this, first install @signalk/signalk-node-red from the appstore/available if you haven't already. Then open node red by clicking on it in web apps. 
With node red open press control-i, then copy and paste the code below, should look something like this >
[Image: QnQwQAj.png]

Then click the import button and click the deploy button top right and that should be it! 

SO what happens, the node on the left gets the data from environment.outside.relativeHumidity and sends it to the next node which is a function node, the data is passed in "msg.payload", all the function node does is set "msg.topic" to environment.outside.humidity. The last node on the right sends the msg.payload data to the path in msg.topic. 
Hope this works, should do. You can test it by putting this into the data fiddler in the server>
{"updates": [{"values": [{"path": "environment.outside.relativeHumidity", "value": 40.04253}]}]}
[Image: Zd2B4PU.png]

Code:
[
   {
       "id": "b6e07228.375ca",
       "type": "signalk-subscribe",
       "z": "cc33fe4a.e428d",
       "name": "input environment.outside.relativeHumidity",
       "mode": "sendAll",
       "flatten": true,
       "context": "vessels.self",
       "path": "environment.outside.relativeHumidity",
       "source": "",
       "period": 1000,
       "x": 340,
       "y": 440,
       "wires": [
           [
               "efb6a8e7.c8ffe8"
           ]
       ]
   },
   {
       "id": "efb6a8e7.c8ffe8",
       "type": "function",
       "z": "cc33fe4a.e428d",
       "name": "",
       "func": "msg.topic = \"environment.outside.humidity\"\nreturn msg;",
       "outputs": 1,
       "noerr": 0,
       "initialize": "",
       "finalize": "",
       "x": 640,
       "y": 440,
       "wires": [
           [
               "b5fd7236.fe9bc"
           ]
       ]
   },
   {
       "id": "b5fd7236.fe9bc",
       "type": "signalk-send-delta",
       "z": "cc33fe4a.e428d",
       "name": "send environment.outside.humidity",
       "x": 930,
       "y": 440,
       "wires": []
   }
]
Reply


Messages In This Thread
Change data path... - by SCarns - 2021-03-13, 05:35 PM
RE: Change data path... - by beercansailor - 2021-03-13, 07:29 PM
RE: Change data path... - by SCarns - 2021-03-14, 05:41 AM
RE: Change data path... - by PaddyB - 2021-03-14, 10:11 AM
RE: Change data path... - by SCarns - 2021-03-14, 08:27 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)