2022-04-12, 09:58 PM
(2022-04-12, 09:47 PM)Techstyle Wrote:(2022-04-12, 06:53 PM)dreeas Wrote: Checked out the KIP addon. Looks like this is just for display of data and not creating a new datapoint that can be sent to Influx with Signal K.
But even Kip outputs the wind angle in +/- 180 degrees and not 0-360.
I guess the "Derived Data" addon is not creating any new datapoints in wind angles since I don't have data on Heading or Speed of a vessel and this is used in the calculations.
But even "Derived Data" would maybe just output it in degrees +/- 180 instead of 0-360?
Starting to give up on Signal K for this project, at least for wind direction.
your sensor is outputting +/-180. to get it to output 0-360 you would need to add 3.14 (Pi), and then divide by 2xPi to get it into degrees.
if you are up to doing a little bit of coding, you could just write your own <filename>.js and put it in the derived data directory with the rest of them and use it to calculate what ever you wanted. it would look something like this:
Code:module.exports = function (app, plugin) {
return [
{
group: 'wind',
optionKey: 'directionTrueDeg',
title: 'Stationary True Wind Direction in Degrees (based on AWA)',
derivedFrom: ['environment.wind.angleApparent'],
calculator: function (awa) {
let windHeadingDeg = (awa + Math.PI) / (2 * Math.PI)
return [{ path: 'environment.wind.directionTrueDeg', value: windHeadingDeg }]
}
}
]
}
then restart signal K and go into the derived data page and look for "Stationary True Wind Direction in Degrees (based on AWA)" and turn it on
this is cheating but should work (although my code may be a little wrong!)
Thank you so much for this, I will try that out tomorrow.
My windsensor is already outputting wind angle 0-359 degrees in to Signal K, I just thought it would be possible to just forward that, or prevent the recalculation to Apparent wind angle.
I realiize Signal K is used for boating and that's why my problem is probably not relevant for this software.