Skip to content

Conversation

@watertrainer
Copy link

@watertrainer watertrainer commented Apr 16, 2022

This pull requests starts a Heart Rate measurement every 60 seconds.
It's a bit wanky if the user wants to stop the heart rate sensor in the app while a measurement is running. At the moment it turns off the sensor, but will turn it back on the next time it checks if it needs to go on (currently 1 tenth of a second I think), because I thought it would be confusing if the sensor wouldn't turn off at all.
It's also not detected by the Heart Rate App yet if the sensor is running before the app is started, so it still gives the option to start the sensor, even though it is on, the press has no effect though (except that the app starts to show the current heart Rate). The digi watch face was able to detect the heart rate and showed that a measurement is going on.

In the future it might be a good idea to average out the heart rate over a prolonged period instead of taking the first avaible value to reduce noise, this would depend on #1092.

This might be useful for general fitness tracking (#749), sleep tracking (#307) or just to keep track of your heart rate (#895).
The intervall could easily be implemented as a setting, I don't know how to implement new settings though, especially if they are supposed to be persistent.
60 Seconds does seem quite often when my watch was just laying aroung on the table, so the standard might be something more like 90/120.
I'll let the watch run overnight to see how much power would be consumed by this feature.

@watertrainer
Copy link
Author

I let it run on my watch for 8h and 40min which was charged to 93% and it is now on 80%. A night before gadgetbridge shows a power consumption of 3-4% in the same period. So this should definitely be a setting, I still think users should have the option to regularly let their heart rate be measured, especially in the farer future when sleep tracking is a thing.

@kieranc
Copy link
Contributor

kieranc commented Apr 24, 2022

This is certainly something that needs implementing, I can't speak for the quality of this implementation but I hope someone else can? In terms of adding a setting it's reasonably straightforward, you define them in src/components/Settings.h and increment the settingsVersion, then add a settings app to change the value. You could look at #1043 as an example, or the 12/24h, ble disable etc for a simple boolean toggle.
Nice work in any case, I think 60s is too short an interval but that can easily be tweaked, you could even add the interval as a setting if you wanted to!

@Riksu9000
Copy link
Contributor

I'll close this as I don't understand the intended behaviour here since it seems to start measuring without ever going into the app let alone starting a measurement, and the author acknowledges there are issues which haven't been resolved.

@Riksu9000 Riksu9000 closed this Jul 30, 2022
@khimaros
Copy link

khimaros commented Nov 7, 2022

@Riksu9000 offering a proposal: add a new setting named "Heart Rate" with description "Measurement frequency:" with options options: 1) Never, 2) 60s, 3) 90s, 4) 120s

when the setting is enabled, a background service will be started which checks heart rate at this frequency. the most recent 30 measurements are preserved and transmitted to eg. Gadgetbridge.

is that a compelling end goal?

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.

4 participants