SK
Signal K•7d ago
Ilker

Ilker - Hey @Scott Bender , in pathmapper plugi...

Hey @Scott Bender , in pathmapper plugin, is there a way to publish the values within an object as a separate path? For example, navigation.attitude has a value of {"yaw": X, "pitch": Y, "roll": Z} . Is there a way to publish these as navigation.attitud.yaw, navigation.attitude.pitch, etc.?
18 Replies
Scott Bender
Scott Bender•7d ago
No. Pretty simple to do in node-red
Ilker
IlkerOP•7d ago
Yeah, Node Red will be difficult for this user. Let me see if I ChatGPT can spit out a plugin doing this 🙂
Scott Bender
Scott Bender•7d ago
Are you using node-red at all now?
Ilker
IlkerOP•7d ago
I am using it but this is for a Saillogger user you mean whether Saillogger uses it?
Scott Bender
Scott Bender•7d ago
No, thought this was for your boat how does this relate to Sailogger?
Ilker
IlkerOP•7d ago
Saillogger can do detailed NMEA 2000 monitoring A user is trying to monitor navigation.attitude which is an object, which needs to be split out to its keys and values for monitoring
Scott Bender
Scott Bender•7d ago
Wouln'd it make more sense to make Sailloger able to handle it?
Ilker
IlkerOP•7d ago
It probably makes sense but I need to think about it, there is a lot of composite values out there and turning each into a value of its own can bloat the datamodal There probably is a way to do it in a smart way but may be non-trivial NMEA monitoring is generic, so needs to work across all fields
Scott Bender
Scott Bender•7d ago
if your user is using node-red already, I can throw together a flow for them
Ilker
IlkerOP•7d ago
If you have it handy, I can recommend it
Scott Bender
Scott Bender•7d ago
they need all three values?
Ilker
IlkerOP•7d ago
Yes
Scott Bender
Scott Bender•7d ago
[{"id":"03814fb729f94bf2","type":"signalk-subscribe","z":"1a65e795a2e4022a","name":"navigation.attitude","mode":"sendAll","flatten":true,"context":"vessels.self","path":"navigation.attitude","source":"","period":1000,"x":190,"y":200,"wires":[["aa303e3ca247371e","1be984c9b6dbe6d0","7ae5e956a921f72f"]]},{"id":"aa303e3ca247371e","type":"change","z":"1a65e795a2e4022a","name":"yaw","rules":[{"t":"move","p":"payload.yaw","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"navigation.attitudeflat.yaw","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":200,"wires":[["74ede648e6a55306"]]},{"id":"74ede648e6a55306","type":"signalk-send-pathvalue","z":"1a65e795a2e4022a","name":"","source":"","meta":"{\"units\": \"rad\" }","x":710,"y":200,"wires":[]},{"id":"1be984c9b6dbe6d0","type":"change","z":"1a65e795a2e4022a","name":"pitch","rules":[{"t":"move","p":"payload.pitch","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"navigation.attitudeflat.pitch","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":260,"wires":[["74ede648e6a55306"]]},{"id":"7ae5e956a921f72f","type":"change","z":"1a65e795a2e4022a","name":"roll","rules":[{"t":"move","p":"payload.roll","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"navigation.attitudeflat.roll","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":320,"wires":[["74ede648e6a55306"]]}]
[{"id":"03814fb729f94bf2","type":"signalk-subscribe","z":"1a65e795a2e4022a","name":"navigation.attitude","mode":"sendAll","flatten":true,"context":"vessels.self","path":"navigation.attitude","source":"","period":1000,"x":190,"y":200,"wires":[["aa303e3ca247371e","1be984c9b6dbe6d0","7ae5e956a921f72f"]]},{"id":"aa303e3ca247371e","type":"change","z":"1a65e795a2e4022a","name":"yaw","rules":[{"t":"move","p":"payload.yaw","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"navigation.attitudeflat.yaw","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":200,"wires":[["74ede648e6a55306"]]},{"id":"74ede648e6a55306","type":"signalk-send-pathvalue","z":"1a65e795a2e4022a","name":"","source":"","meta":"{\"units\": \"rad\" }","x":710,"y":200,"wires":[]},{"id":"1be984c9b6dbe6d0","type":"change","z":"1a65e795a2e4022a","name":"pitch","rules":[{"t":"move","p":"payload.pitch","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"navigation.attitudeflat.pitch","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":260,"wires":[["74ede648e6a55306"]]},{"id":"7ae5e956a921f72f","type":"change","z":"1a65e795a2e4022a","name":"roll","rules":[{"t":"move","p":"payload.roll","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"navigation.attitudeflat.roll","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":320,"wires":[["74ede648e6a55306"]]}]
Scott Bender
Scott Bender•7d ago
No description
Scott Bender
Scott Bender•7d ago
hmm. no units for the first two. Do you needd that?
Ilker
IlkerOP•7d ago
Thanks! Units should not matter Stupid question, how do you deploy this to Node Red?
Scott Bender
Scott Bender•7d ago
Top right menu, Import Can copy/paste or import a file
Ilker
IlkerOP•7d ago
Perfect, worked like a charm, thank you

Did you find this page helpful?