@Adrian_Rockall, why do you calculate the dew point in your app at all? The WittBoy WS90 provides the value itself, for example. Is the dew point value not transmitted via the API?
Yesterday, I connected my WS90 to Home Assistant for testing purposes, and it displays the same dew point as the Ecowitt smartphone app.
So the conclusion is, that the calculation of the dew point seems to be wrong in the Homey Misol and Ecowitt app.
jes, but only a smal mistake in the calculation because it is only with negative values. so i guas (i donâs now what) if you place the right part of the calculation between brackets that it wil be fixt.
i have somewhere in my flow also a dewpoint calculation, i wil compaire them and if i find something i wil let it know
i donât know how it happend but my calculations are wrong as wel for the negative decres(good to know). i think we found the same calculation on the internet.
EDIT:
i just ask the AI modus on google and it gave me this to put in a java script, i did not check it yet:
const T = args[0]; // Temperatuur tag
const RH = args[1]; // Vochtigheid tag
const a = 17.27;
const b = 237.7;
const gamma = Math.log(RH / 100) + (a * T) / (b + T);
const dewPoint = (b * gamma) / (a - gamma);
return Math.round(dewPoint * 10) / 10;
According to Code Pilot this is the revised more accurate Magnus formula:
// Calculate Dew Point
relativeHumidity /= 100;
var temperature = (temperatureF - 32) * 5 / 9;
var dewPoint = 0;
if (relativeHumidity > 0.01 && relativeHumidity <= 1)
{
var a = 17.625;
var b = 243.04;
var alpha = Math.log(relativeHumidity) + (a * temperature) / (b + temperature);
dewPoint = (b * alpha) / (a - alpha);
}
dewPoint = Math.round(dewPoint * 10 + Number.EPSILON) / 10;
if (dewPoint != this.getCapabilityValue('measure_temperature.dewPoint'))
{
this.setCapabilityValue('measure_temperature.dewPoint', dewPoint).catch(this.error);
}
I have published a new test version with this revision, but Iâm not sure when the temperature will drop below 0 here, so I havnât been able to test it fully.