You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add sleep mode/extended lifespan toggle for PM2.5 sensor #27
First off, awesome configuration. It makes my air gradient so much more useful since it now seamlessly integrates into my home assistant setup.
I read that the Plantower sensors have a limited lifetime and can be set to update less often. It would be great if you could add a toggle to change the update frequency for the sensor.
I'm not likely to add something to do that on a schedule in ESPHome itself, but since the brightness for LED and Contrast for Display are both controllable sliders (As well as a blank page switch), you could create an Automation in HomeAssistant that lowers both (or disables all pages except the blank one) on your own automation schedule and then enables them as you see fit.
The Update Intervals aren't currently set with any type of variable to be controllable by HomeAssistant and not currently any type of substitution in ESPHome.
I'm not aware of a concern about lifespan of the Sensair S8 CO2 sensor, but have here different reports of expected life for the Plantower PMS5003 sensor, so I do offer an alternate package that extends the life by only taking measurements every 2 minutes instead of every second, but there are possible concerns about the impact to accuracy with that.
You're right, I misspoke. I meant have a sleep mode for the Plantower PMS5003 sensor. I like your idea not to have a general sleep mode as it can be handled in home assistant instead. So I rewrote the issue to ask for a sleep mode/extended life for the Plantower sensor that can be toggled without recompiling. For example, I would flip that toggle at night or when I am not home.
Making it a substitution variable that you could define in your ESPHome yaml at install time is one option
Another option is to add a slider bar or a field you could type into that could fully control it, but adds new complexity, and currently we are nearly out of memory if adding the ESP32_Improv feature to allow for bluetooth discovery, so being a bit cautious about adding all of the features
Can you also do a pm_2.5_2 extended life yaml? I could copy and paste it myself but it would be nice to have yours referenced for folks who want to be native.
Can you also do a pm_2.5_2 extended life yaml? I could copy and paste it myself but it would be nice to have yours referenced for folks who want to be native.
I just added a package for an extended life version of the second PMS5003T sensor. It is also set to 2 minutes.
sensor_pms5003t_2_extended_life.yaml
In recent forum discussions, the highest risk of using this with the outdoor model is that the fan will spin down after 30 seconds and could provide an opportunity for bugs to crawl inside. Just be aware.
I'm pretty sure this is not possible, as the sensor needs to know the value at compile time.
If you find anything from ESPHome that indicates different, we can look at modifications to enable that, but I would need links to examples or documentation.
Activity
MallocArray commentedon Jan 29, 2024
I'm not likely to add something to do that on a schedule in ESPHome itself, but since the brightness for LED and Contrast for Display are both controllable sliders (As well as a blank page switch), you could create an Automation in HomeAssistant that lowers both (or disables all pages except the blank one) on your own automation schedule and then enables them as you see fit.
The Update Intervals aren't currently set with any type of variable to be controllable by HomeAssistant and not currently any type of substitution in ESPHome.
I'm not aware of a concern about lifespan of the Sensair S8 CO2 sensor, but have here different reports of expected life for the Plantower PMS5003 sensor, so I do offer an alternate package that extends the life by only taking measurements every 2 minutes instead of every second, but there are possible concerns about the impact to accuracy with that.
Change the line
to
[-]Add sleep mode[/-][+]Add sleep mode for PM2.5 sensor[/+]domoritz commentedon Jan 29, 2024
You're right, I misspoke. I meant have a sleep mode for the Plantower PMS5003 sensor. I like your idea not to have a general sleep mode as it can be handled in home assistant instead. So I rewrote the issue to ask for a sleep mode/extended life for the Plantower sensor that can be toggled without recompiling. For example, I would flip that toggle at night or when I am not home.
[-]Add sleep mode for PM2.5 sensor[/-][+]Add sleep mode/extended lifespan toggle for PM2.5 sensor[/+]MallocArray commentedon Jan 29, 2024
It will be taken into consideration.
Making it a substitution variable that you could define in your ESPHome yaml at install time is one option
Another option is to add a slider bar or a field you could type into that could fully control it, but adds new complexity, and currently we are nearly out of memory if adding the ESP32_Improv feature to allow for bluetooth discovery, so being a bit cautious about adding all of the features
I also just started this conversation on the AirGradient forums to see if we can get some testing about impacts to adjusting the interval and if it will affect accuracy overall
https://forum.airgradient.com/t/accuracy-comparison-of-pms5003-with-large-interval-values/1615
pyrodex commentedon Feb 6, 2024
Can you also do a pm_2.5_2 extended life yaml? I could copy and paste it myself but it would be nice to have yours referenced for folks who want to be native.
MallocArray commentedon Apr 3, 2024
I just added a package for an extended life version of the second PMS5003T sensor. It is also set to 2 minutes.
sensor_pms5003t_2_extended_life.yaml
In recent forum discussions, the highest risk of using this with the outdoor model is that the fan will spin down after 30 seconds and could provide an opportunity for bugs to crawl inside. Just be aware.
domoritz commentedon May 19, 2024
Can you set the pm update interval at runtime now? I looked at the code and only saw how it can be changed at compile time.
MallocArray commentedon May 19, 2024
I'm pretty sure this is not possible, as the sensor needs to know the value at compile time.
If you find anything from ESPHome that indicates different, we can look at modifications to enable that, but I would need links to examples or documentation.