Skip to content
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

Add usb temp compensation to weather #160

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sjefferson99
Copy link
Contributor

This is to provide the offset approach I mentioned in #134

It is based on the work done on #142 and adds the same adjustment code into the weather.py sensor reading function.
I have adjusted the rounding to happen in the return data section rather than the initial variable population to reduce rounding errors and also added some logging to allow the adjustment to be visible in the logs.

I have tested briefly and it has behaved as expected with no errors and reasonable output values. I have a separate thermometer and humidity sensor in this room and the values are now both much improved in matching these.

@ZodiusInfuser ZodiusInfuser added the enhancement New feature or request label Jul 10, 2023
Copy link

@sdmeers sdmeers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was regularly getting relative humidities from 100-110% from this code. I think the issue was with this line

absolute_humidity = helpers.relative_to_absolute_humidity(humidity, temperature)

I think it should be

absolute_humidity = helpers.relative_to_absolute_humidity(humidity, adjusted_temperature)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants