Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Trackhe
Copy link

@Trackhe Trackhe commented Dec 14, 2025

I have my Xiaomi-Mi-Air-Purifier-3C in my bedroom and the fan of the sensor is quite loud and also the fan gets very fast bad when it is running 24/7 i know that because i have many of such little fans running for pi cluster as example.

So i make the intervall time in which is the sensor gets readed configurable and i saw that the poll rate of properties is also fix at 60s so i make that also in the same way configurable. with that code it should be possible to controll it like

miot:
  id:  miot_aqi
  miot_heartbeat_siid: 9
  miot_heartbeat_piid: 4
  miot_heartbeat_value:  10 
  miot_heartbeat_interval: 30000

that should run the pm2.5 sensor for 10s every 30s as example.

Copilot AI review requested due to automatic review settings December 14, 2025 13:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the sensor fan polling interval and property poll timer configurable for Xiaomi Mi Air Purifier 3C devices. The motivation is to reduce noise and wear on the sensor fan by allowing users to control how frequently the sensor is activated.

Key Changes

  • Added configurable poll interval for property updates (previously hardcoded to 60 seconds)
  • Added configurable heartbeat interval and value for sensor fan control
  • Made all timing parameters configurable through the YAML configuration

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
components/miot/miot.h Added setter methods and member variables for poll_interval, heartbeat_value, and heartbeat_interval configuration
components/miot/miot.cpp Updated setup() to use configurable intervals instead of hardcoded 60000ms values
components/miot/init.py Added configuration schema entries and initialization code for the new configurable parameters

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Trackhe Trackhe marked this pull request as draft December 14, 2025 13:13
@Trackhe
Copy link
Author

Trackhe commented Dec 14, 2025

I tried it now on my C3 and it works well.

@Trackhe Trackhe marked this pull request as ready for review December 14, 2025 13:42
@Trackhe Trackhe marked this pull request as draft December 14, 2025 19:17
@Trackhe
Copy link
Author

Trackhe commented Dec 14, 2025

Now the Values takes affect also without flashing new.

@Trackhe Trackhe marked this pull request as ready for review December 14, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant