Reverse change to AQI value polling from air purifier
Describe the bug A recently-merged PR (https://github.com/rytilahti/python-miio/pull/1282) changed the way AQI value is polled from the air purifier by enabling AQI hearbeat to remove manufacturer's smoothening and filters on the hardware-reported values. This enabled real-time raw AQI values to be read at the cost of the filters.
I prefer the filtered AQI data instead as it is much less noisy.
Version information (please complete the following information):
- OS: [e.g.Linux]
- python-miio: [Use
miiocli --versionorpip show python-miio]
Device information:
If the issue is specific to a device [Use miiocli device --ip <ip address> --token <token> info]:
- Model: Air Purifier 3H
- Hardware version:
- Firmware version:
manufacturer's smoothening and filters
Where did you read that about it? Nobody noticed any smoothening, all readings were just flat for 30 minutes.
Only readings above 40 PM2 could previosly trigger proper reporting. Maybe in China it's fine, but in Europie it's 250% of allowed norm, so it isn't acceptable for automation to react only after 40 PM2.
If you want smoothened results, you should use moving average (ca. 1-5 minutes) and not introduce fake reporitng.
https://www.home-assistant.io/integrations/filter/ -> time_simple_moving_average
https://github.com/home-assistant/core/issues/67528
So I'm not sure what's the best option here so that's why I haven't responded... I have no device to test, so I'm not sure, for example, what would happen if the value would be adjusted to be 30 or 60? Would this change the update interval to be that? Should it also be done only once during the initialization?
In principle I agree with @mak3 that it would make more sense to give out the reading as reported by the device, and let the downstream smoothen (or filter) the reported values as needed..
Ping @Razer0123 who reported the delayed updates in the first place.