-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weather_Common.pl: Dewpoint calculated only once #329
Comments
…y time the humidity is measured. Fixes #329
@JohanBraeken I've created a pull request with your change. Am I correct that this will only update the calculated dew point when the humidity is measured, but not when the temperature is updated? Note to the other developers: if we need additional fixes we can just add them extra to the branch I created for this fix, the pull request should get updated automatically. |
Sorry for the late reply. DewPoint will be calculated everytime "&weather_updated;" is called and "$$w{HumidOutdoorMeasured})" is true. |
OK, merged into master. |
When changes are made to weather_array[], "&weather_updated;" must be executed in order to calculate certain values.
The "dewpoint" is one of these values that gets calculated and the calculation depends on temperature and humidity.
Currently, the dewpoint calculation is not done when temperature and/or humidity changes as that part of the code is wrongly skipped.
Around Line 90:
This statement is only true when MisterHouse starts or is reloaded.
Once the dewpoint is calculated, the value gets inserted into the Weather_Array.
The next time "&weather_updated;" is executed, the $dewpoint variable is pulled from the Weather_Array and can never be "unknown" again.
Around line 75:
Because of this the dewpoint will never be calculated again.
Solution:
The code assumes temperature and dewpoint are known and tries to calculate the humidity as seen in the following lines of code:
Around line 113:
The original
can be changed to:
so it will calculate the dewpoint correctly everytime.
The text was updated successfully, but these errors were encountered: