Transform Engine Notifications to Binary Values for Grafana #22
Replies: 1 comment
-
[{"id":"26472670.e6048a","type":"tab","label":"Engine Notifications","disabled":false,"info":""},{"id":"154f6197.a7e95e","type":"signalk-subscribe","z":"26472670.e6048a","name":"Engine Notifications","mode":"sendAll","flatten":true,"context":"vessels.self","path":"notifications.propulsion.*","source":"","period":"5000","x":130,"y":160,"wires":[["1df920c6.6be84f"]]},{"id":"5f03a74c.b170b8","type":"change","z":"26472670.e6048a","name":"Modify MSG.TOPIC","rules":[{"t":"change","p":"topic","pt":"msg","from":"notifications.propulsion","fromt":"str","to":"notifications.propulsion.state","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":320,"wires":[["b4579f91.53e06"]]},{"id":"1df920c6.6be84f","type":"change","z":"26472670.e6048a","name":"Topic Change & Parse Payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"msg.payload.state","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":160,"wires":[["fef5310d.a8455"]]},{"id":"fef5310d.a8455","type":"change","z":"26472670.e6048a","name":"Transform Payload to Integer","rules":[{"t":"change","p":"payload","pt":"msg","from":"normal","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"alert","fromt":"str","to":"2","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"warn","fromt":"str","to":"3","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"alarm","fromt":"str","to":"4","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"emergency","fromt":"str","to":"5","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":240,"wires":[["5f03a74c.b170b8"]]},{"id":"b4579f91.53e06","type":"signalk-send-pathvalue","z":"26472670.e6048a","name":"","source":"","meta":"","x":710,"y":320,"wires":[]}] |
Beta Was this translation helpful? Give feedback.
-
Ok. I wrote this plugin so that I could take my John Deere engine notifications which are in JSON format and convert them to a binary value for storage in Influxdb. I wanted to create a new msg.topic as well so that it would be easier for the Influxdb SignalK plugin to pass these over to Influxdb.
The change nodes are designed to allow multiple streams to be passed in at the same time.
End goal was to have a 1-5 status value that would align in Grafana to stat plugin which was setup for green / orange / red notification.
Beta Was this translation helpful? Give feedback.
All reactions