esphome / esphome/feature-requests
FR: Add manual (asynchronous) 'update' method for PMSX003 sensor
- Dominant language
- No language data
- Stars
- 450
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the problem you have/What new integration you would like**
PMSX003 sensor lacks an `update` method forcing one to choose a single fixed synchronous, update interval.
Specifically when using this sensor, I often face the following choice between conflicting goals:
- On the one hand, due to the relatively short life of the PMSX003 laser diode, I want to keep the `update_interval` as long as possible, particularly when generally more frequent updates are not needed
- On the other hand, sometimes you want an update sooner, such as right after boot or before some other critical operation.
Adding an `update` method for this sensor will allow one to have the best of both worlds
- Generally, maximize time between regular, synchronous updates
- When needed get a new update out of schedule
As a special case, it would be good to allow `never` as the update_interval and then **only** update the readings when triggered manually with the new `update` method -- thereby maximally extending the life of the sensor since it only turns on precisely when needed.
**Please describe your use case for this integration and alternatives you've tried:**
USE CASE 1:
I want to occasionally sample the particle counts in a room (such as my workshop) when unoccupied, but no need to sample that frequently as in the absence of human activity the air quality won't change much plus early detection is not critical when the room is unoccupied
BUT, when the room is occupied, I want to sample more frequently since values will change with my activity and I need to be warned as soon as possible if particle counts increase too high. With the proposed `update` method, I could call a script or use an interval timer to update more frequently when room is occupied
USE CASE 2:
I generally want to set the `update_interval` to be as long as possible (say 10 minutes), but I don't want to have to wait 10 minutes for the first reading. So, I could add a manual update in the on_boot section to get an early first reading
USE CASE 3:
I don't need *any* regular updates to the sensor but rather only need occasional updates as triggered by some other condition. In such a case, I would like to set the `update_interval: never` and only get updates with the proposed manual method triggered by some condition.
**Additional context**
None
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.