-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Suggestion] Dynamic Sensor Data Notifications #538
Comments
Old versions of the Linux kernel do not support devices with advertising intervals longer than 4 seconds.
The described parameters are set in the ZigBee firmware. You can set thresholds in 10C and a period in days. My air conditioner maintains the temperature more accurately than you describe. I consider the optimal measurement step for BLE thermometers to be up to 30 seconds and the advertising transmission period to be 5 seconds when accuracy is not required.
Such an interval makes no sense in automation (IoT, Smart Home). AQARA temperature and humidity sensor (Lumi Weather, Zigbee) uses the parameters you specified. When using "Lumi Weather", automation is impossible - comparison with typical BL sensor settings: |
For some automations, it is not the absolute value that is important, but the trend of change (derivative). Inverter air conditioners have power regulation in steps, for example in the range from 170 W to 2 kW. A similarity to a PID controller is used and in this case the smaller the measurement discreteness in time and value, the better. Even for controlling a simple heater, it is desirable to have smaller the measurement discreteness in time and value... People mostly use firmware for LYWSD03MMC. And this thermometer does not have buttons to enable the connection mode (when BLE advertising is transmitted at short intervals). This option does not particularly affect the overall battery life. Other factors have an effect. Usually, over a period of a year, due to the low current consumption, the battery contacts oxidize and the thermometer requires maintenance (you can knock it and the contact is restored). But in general, the operating time of normal thermometers from one battery (CR2450), |
Currently the firmware just sends temperature and humidity at pre-configured interval.
In my similar projects with ESP32-based sensor I've used a dynamic approach which reduces the amount of data points sent to HA while maintaining precision. It can be described as follows:
This way, if the value changes fast we will still get frequent upgrades and fast sensor response. And if it changes slowly - we will get 1 value each 300 seconds, but we do know that it changed no more than the threshold from the last one.
This approach worked fine for me for a couple of years and will be great to see it implemented here.
I think I can actually produce the pull request for it, but would need a hint on where in the code this logic is implemented.
The text was updated successfully, but these errors were encountered: