barnaclebill - Can anyone help me configure a n...

Can anyone help me configure a node-red flow? I am measuring a fuel tank sensor, which sends a percentage, but I can't figure out how to configure the pathvalue node.
No description
No description
No description
25 Replies
Scott Bender
Scott Bender•2mo ago
Export and paste your nodes here, then I can help.
barnaclebill
barnaclebillOP•2mo ago
Output from "smooth" is a numeric value...I'm stuck trying to figure out how to translate that payload into the value to be submitted at the path I specify.
Scott Bender
Scott Bender•2mo ago
did youi give me all your flows?
barnaclebill
barnaclebillOP•2mo ago
Yes. I only have one.
Scott Bender
Scott Bender•2mo ago
so, I'm not sure I understand what the issues is you just to convert to a ratio? You can use a change node for that
barnaclebill
barnaclebillOP•2mo ago
If I connect "smooth" to "fuel tank" and deploy, I get an error "The workspace contains some nodes that are not properly configured:"
Scott Bender
Scott Bender•2mo ago
it does look like the send-path node is not using the entered path and you do need to convert to a ratio, so add a change node like this
Scott Bender
Scott Bender•2mo ago
No description
Scott Bender
Scott Bender•2mo ago
(of course, change the math and path) let me make a real example for you...
[{"id":"81ee81a2c1303be9","type":"debug","z":"50961b374e1aefc7","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":880,"y":260,"wires":[]},{"id":"afeee15b412ed126","type":"inject","z":"50961b374e1aefc7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"54","payloadType":"num","x":550,"y":140,"wires":[["f1108a8da68fb223"]]},{"id":"ea4c67d59a1899c5","type":"signalk-send-pathvalue","z":"50961b374e1aefc7","name":"fuel tank","path":"","source":"","meta":"","x":1000,"y":180,"wires":[]},{"id":"f1108a8da68fb223","type":"change","z":"50961b374e1aefc7","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"tanks.fuel.0.currentLevel","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload/100","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":200,"wires":[["ea4c67d59a1899c5","81ee81a2c1303be9"]]}]
[{"id":"81ee81a2c1303be9","type":"debug","z":"50961b374e1aefc7","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":880,"y":260,"wires":[]},{"id":"afeee15b412ed126","type":"inject","z":"50961b374e1aefc7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"54","payloadType":"num","x":550,"y":140,"wires":[["f1108a8da68fb223"]]},{"id":"ea4c67d59a1899c5","type":"signalk-send-pathvalue","z":"50961b374e1aefc7","name":"fuel tank","path":"","source":"","meta":"","x":1000,"y":180,"wires":[]},{"id":"f1108a8da68fb223","type":"change","z":"50961b374e1aefc7","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"tanks.fuel.0.currentLevel","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload/100","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":200,"wires":[["ea4c67d59a1899c5","81ee81a2c1303be9"]]}]
barnaclebill
barnaclebillOP•2mo ago
OK so I divided/100 in the "ads-to-fuel-level" node, so I should have the ratio correct now. But (I realize this is kind of idiotic)...I can't figure out how to get Rules in the UI.
Scott Bender
Scott Bender•2mo ago
Also note the proper path for a tank level in my example)
barnaclebill
barnaclebillOP•2mo ago
(This is my first day with node-red 🙂
Scott Bender
Scott Bender•2mo ago
delete the path you entered in the send-path-value node (there does look like I have a bug there) and use a change node to set the topic to the path you want to send which should probably be tanks.fuel.0.currentLevel
barnaclebill
barnaclebillOP•2mo ago
I added a change node to set the topic, and the payload is the ratio, but I'm still getting the same error on deploy, so I must be doing something wrong.
barnaclebill
barnaclebillOP•2mo ago
No description
Scott Bender
Scott Bender•2mo ago
Try deleting and recreating that send-path-value node Don’t change anything in it And I think if you hover over that red triangle, it will tell you what’s wrong
barnaclebill
barnaclebillOP•2mo ago
Success!
barnaclebill
barnaclebillOP•2mo ago
No description
barnaclebill
barnaclebillOP•2mo ago
Now I just need to figure out why SK says I have 3% fuel when there's almost half a tank :- ) Thanks for your help.
Scott Bender
Scott Bender•2mo ago
That’s what you are sending
barnaclebill
barnaclebillOP•2mo ago
Yes. My fuel sender is quite non-linear.
barnaclebill
barnaclebillOP•2mo ago
No description
Scott Bender
Scott Bender•2mo ago
FYI, I published a new version of the plugin. You can now enter the path on that node instead of sending as the topic
PaddyB
PaddyB•2mo ago
Tried the signalk calibration app for that?
barnaclebill
barnaclebillOP•2mo ago
Great, thanks!

Did you find this page helpful?