Skip to content
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

Aqara SRTS-A01 heartbeat decoding (fixes battery percentage and firmware version) #5363

Merged
merged 4 commits into from
Jan 21, 2023

Conversation

protyposis
Copy link
Contributor

@protyposis protyposis commented Jan 18, 2023

Add decoding of heartbeat messages (sent ~once per hour) of the Aqara TRV. This adds a few new properties, increases the update frequency of some, and fixes a few related issues. This PR is inspired by #4763 which proposed basic heartbeat decoding.

  • Add exposes of setup state, power_outage_count, and device_temperature.
  • Expose hidden valve_alarm.
  • Add description to valve_detection expose.
  • Improve description of local_temperature expose.
  • Remove the battery percentage-from-voltage calculation introduced by Battery for SRTS-A01 Aqara TRV #4674. The device reports the percentage directly and more precisely. The calculation used a wrong scale where almost full batteries were classified as almost empty, e.g. 2.9V were converted to 33%, and it was based on the imprecisely calculated voltage in 100mV steps. This also fixes inconsistent battery percentages that jump between the reported percentage and the calculated percentage, e.g. jumping between 95% and 33% at 2.9V.
  • Update the device firmware version to the currently installed version instead of using the default "placeholder" version 0.0.0_0025 advertised by the basic cluster (which doesn't update with firmware updates).
  • Initialize the battery voltage at device configuration, which was initially added in Battery for SRTS-A01 Aqara TRV #4674 but replaced in [SRTS-A01](Aqara Smart Radiator Thermostat E1) add external sensor #4754 by the voltage conversion.

devices/xiaomi.js Outdated Show resolved Hide resolved
@@ -0,0 +1,79 @@
const xiaomi = require('./xiaomi');
Copy link
Owner

Choose a reason for hiding this comment

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

Can this be merged into lib/xiaomi.js similar to how this was done for the fp1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

9c00c0a

@Koenkk Koenkk merged commit 3055f45 into Koenkk:master Jan 21, 2023
@Koenkk
Copy link
Owner

Koenkk commented Jan 21, 2023

clean, thanks!

@protyposis protyposis deleted the feature/aqara-e1-trv-heartbeat branch January 21, 2023 10:46
@leroyloren
Copy link
Contributor

@protyposis Could you please fix the version prefix? With the new FW 1030 the version is displayed as 0.0.0_01030

obrazek

@Otnow
Copy link
Contributor

Otnow commented Feb 1, 2024

@protyposis Could you please fix the version prefix? With the new FW 1030 the version is displayed as 0.0.0_01030

obrazek

In PR, among other things, formatting of firmware version has been fixed.

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.

None yet

4 participants