[APP][Pro] Misol and Ecowitt (Release 0.2.10, Test 0.2.11 )

This is the code that I use to calculate the dew point:

            relativeHumidity /= 100;
            var dewPoint = (temperatureF - 32) * 5 / 9;
            if (dewPoint > 0 && dewPoint < 60)
            {
                if ((relativeHumidity) > 0.01 && (relativeHumidity < 1))
                {
                    var a = 17.27;
                    var b = 237.7;

                    var alphaTR = ((a * dewPoint) / (b + dewPoint)) + Math.log(relativeHumidity);

                    var Tr = (b * alphaTR) / (a - alphaTR);
                    dewPoint = Tr;
                }
            }

            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 can’t remember where I got that from, but it would have been of the internet.

Merry Christmas, everyone! :christmas_tree:

Indeed, the dew point is calculated incorrectly in the Homey Misol and Ecowitt app, well spotted, @qawsedrf57! :+1:

Dew point acc. the Homey Misol and Ecowitt app: -2.1 °C

Dew point acc. the Ecowitt iOS smartphone app: -6.8 °C

@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?

It’s not sent in the data on any of the stations I have, including the WS90.

If you look in the app settings page, the information that’s transmitted is shown there.

1 Like

I checked, the dew point is not transmitted.

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

1 Like

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.

1 Like

Thanks, looks like whe get some negative decrees over here next fryday or saturday

1 Like

the temp was -0.1 and the dewpoint -2.1 so it looks like the new calculations work thanks for the very quick fix

2 Likes

Basically, I can confirm that:

WittBoy GUI

Homey Insights

The 0.1 °C difference may be due to the fact that insights in Homey are smoothed out for display durations of more than one hour.

Thanks @Adrian_Rockall! :+1:

1 Like