rgavril / homebridge-xiaomi-air-purifier3

Homebridge plugin for controlling Xiaomi Air Purifier 3/3H
46 stars 7 forks source link

Make AQI-Heartbeat optional #5

Open mouth4war opened 4 years ago

mouth4war commented 4 years ago

Please don't hate me but I think it makes sense to have that AQI-heartbeat function optional 😄

Arguments for:

  1. May not be needed at all times by all users to have real-time AQI all the time. Some might prefer smoothened/throttled AQI.
  2. May cause issues with device hardware since we are altering its expected user behavior.

If you add a config flag for this, users can choose to have smoothened/throttled AQI or real-time AQI.

The way I personally would use it is to have smoothened AQI above 20 and real-time below 20.

rgavril commented 4 years ago

Since the sensor reporting the pm2.5 values in real time on the attached display, I don't think modifying the heartbeat will put any additional stress on the sensors / hardware.

I suspect that is making the device push change notifications for temperature and pm2.5 to the Xiaomi servers and this is what they were trying to avoid. By coding that heartbeat in and enabling it only whey their app is in use they don't get flooded with useless data.

Ont he other hand, smoothening the AQI would be useful and I will try to code it in the plugin. It could be annoying and cause some problems when the pm2.5 is moving up and down around the breakpoints causing the aqi automations to be triggered on and off until the value settles.

mouth4war commented 4 years ago

TBH I am fine with smoothened AQI for automations. They've done a good job with smoothening/throttling except for the low AQI range (<20) where higher sensitivity is needed IMO.