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

WeatherFlow Tempest always shows as 32 degrees in Home app when below freezing outside #143

Open
joshsnelling opened this issue Jan 29, 2022 · 0 comments

Comments

@joshsnelling
Copy link

I was setting up a new WeatherFlow Tempest device to show up in HomeKit, and it was always showing up as 32 degrees Fahrenheit in the Home app even though the outdoor temp is below 32 degrees F. The device is set to Fahrenheit, so I'd checked the Temperate value is Fahrenheit box in the HomeKit-Bridge configuration. I was able to track down the root cause of it showing as 32 degrees F (0 degrees C) to line 1632 in homekit.py, where the temperature conversion is being done:

# Do temperature conversion on the value
if attribute in ["CurrentTemperature", "TargetTemperature", "HeatingThresholdTemperature", "CoolingThresholdTemperature"]:
	if self.convertFahrenheit:
		try:
			cvalue = float(obj.value)
			cvalue = (cvalue - 32) / 1.8000
			if cvalue < 0: cvalue = 0   # <-- This is the offending line
			obj.value = cvalue
		except:
			pass # Nothing happened, leave the current value

I was able to get it working by commenting out line 1632. Is overriding all temps below 32 degrees F the intended behavior or is it a bug? Is there an edge case I'm not considering or some other behavior I'm not aware of that commenting out that line will impact?

If it's a bug, I'll open a PR to fix it. Thanks!

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

No branches or pull requests

1 participant