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

Ability to configure air quality ranges #373

Open
zhukovheorhii opened this issue Jun 19, 2022 · 1 comment
Open

Ability to configure air quality ranges #373

zhukovheorhii opened this issue Jun 19, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@zhukovheorhii
Copy link

zhukovheorhii commented Jun 19, 2022

Would be good to have a custom configuration for air quality ranges

function pm2_5ToAqi(aqi: number) {
  if (!aqi) {
    return 0; // Error or unknown response
  } else if (aqi <= 25) {
    return 1; // Return EXCELLENT
  } else if (aqi > 25 && aqi <= 50) {
    return 2; // Return GOOD
  } else if (aqi > 50 && aqi <= 75) {
    return 3; // Return FAIR
  } else if (aqi > 75 && aqi <= 100) {
    return 4; // Return INFERIOR
  } else if (aqi > 100) {
    return 5; // Return POOR (Homekit only goes to cat 5, so the last two AQI cats of Very Unhealty and Hazardous.
  } else {
    return 0; // Error or unknown response.
  }
}

As a user I want to be able to set another ranges to have more flexible automation at the Apple Home

@zhukovheorhii zhukovheorhii added the enhancement New feature or request label Jun 19, 2022
@naughtydogx
Copy link

Any progress with this? This can't be a problem because another plugins has got it - it is called "pm25_breakpoints".

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

No branches or pull requests

2 participants