esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

HM3301 AQI Calculation Is Wrong #2365

Closed calco88 closed 2 years ago

calco88 commented 3 years ago

The problem

The AQI calculation for the HM3301 air quality sensor is incorrectly casted to an int8_t, when it should ideally be an uint16_t. The 8 bit signed integer causes any AQI value above 127 to overflow and display as a negative value starting from -127

IMG-4412

Which version of ESPHome has the issue?

v1.17.2+

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

core-2021.7.4+

What platform are you using?

ESP8266

Board

NodeMCU

Component causing the issue

HM3301 AQI Sensor

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

github-actions[bot] commented 2 years ago

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.

calco88 commented 2 years ago

Bumping this, hoping it can get included in the next round of fixes