domoticz-zigbee2mqtt-plugin icon indicating copy to clipboard operation
domoticz-zigbee2mqtt-plugin copied to clipboard

Barometer Forecast incorrect (due to Domoticz documentation error)

Open waltervl opened this issue 3 years ago • 3 comments

Issue description Barometer Forecast incorrect (due to Domoticz documentation error)

In temperature_humidity_barometer_sensor.py there is a reference to the incorrect values of the forcast. type 84 subtype 16 has the folowing forecast values. So calculations should get other values. Forecast: 0 = Heavy Snow, 1 = Snow, 2 = Heavy Rain, 3 = Rain, 4 = Cloudy, 5 = Some Clouds, 6 = Sunny, 7 = Unknown, 8 = Unstable, 9 = Stable

    if (value < 966):
        return 3  # Rain
    elif (value < 993):
        return 4  # Cloudy
    elif (value < 1007):
        return 5  # Some Clouds
    elif (value < 1013):
        return 6  # Sunny
    else:
        return 7  # No Info

waltervl avatar Sep 02 '21 23:09 waltervl

Do you know what barometer value should be used for each state?

stas-demydiuk avatar Sep 04 '21 11:09 stas-demydiuk

I put the correct values in the calculation. To extend with snow: If temp < 1 degree Celsius rain will change in snow. I checked in the Domoticz source code but could not find good calculations of the other values.

waltervl avatar Sep 05 '21 05:09 waltervl

Just for info, found the domoticz source code of the right calculation, but it depends on the pressure change rate. So you will need some extra work to handle this. https://github.com/domoticz/domoticz/blob/c997900e7c92c62946f600ec863b97fab16fbe61/main/BaroForecastCalculator.cpp

So for the time being the basic calculation as already present in temperature_humidity_barometer_sensor.py is fine it only needs other state id's (as indicated in the first post).

The device type in barometer.py is a different one ( TypeName="Barometer") and there the weathers states are fine.

waltervl avatar Sep 06 '21 15:09 waltervl

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 30 '22 17:08 stale[bot]