No Branch/Tag Specified
master
nightly-branch
ble-scan-before-reconnect
ui-improvements
osmand-jr-ashimokawa
osmand-experiments
device-cycling-sensor
bicycle_sensor
nightly-changelog
fossil-hr-alarms-flatten-to-ascii
flattenasciitransliterator-force-ascii
fix_supported_unsupported_discovery
supercars_blinking
device-update-reason
device-flipper-zero
test_link
test_debug_release
debug-branch
fossil-hr-gen6
test_own_image
fix_logger_again
streaks
huami-sms-reply
RemoveMibandGlobalPreferences
SystemEvents
combined
openTracksObserver-debug
cycling_sensor
multi-device-support-clean-2
miband6-alipay
fossil-hr-activity-fix
fossil-q-hr-html
dakhnod/fix-notification-removed
dakhnod/beautify-device-information
Lightwars/TurnClocksForward
andyboeh/ble_reconnect_scan
ildar/patches/circleci
mvallerie/custom_menu_miband2
christian-n/master
lucasgaley/master
Dikay900/steps_diagram
comradekingu/patch-3
elagin/sleep_values_on_chart
boun/runnerup
thePanz/add-raw-data-support
plugdio/master
atx/master
Vebryn/csv-export
rosenpin/master
lazarosfs/EnableBtOnConnect
health-new-database
mi2-text-notifications
polarm400
release-0.11.x
led-profile
live-sensor-data
0.1.0
0.1.1
0.1.2
0.1.3
0.1.4
0.1.5
0.10.0
0.10.1
0.10.2
0.11.0
0.11.1
0.11.2
0.12.2
0.13.0
0.13.1
0.13.2
0.13.3
0.13.4
0.13.5
0.13.6
0.13.7
0.13.8
0.13.9
0.14.0
0.14.1
0.14.2
0.14.3
0.14.4
0.15.0
0.15.1
0.15.2
0.16.0
0.17.0
0.17.1
0.17.2
0.17.3
0.17.4
0.17.5
0.18.0
0.18.1
0.18.2
0.18.3
0.18.4
0.18.5
0.19.0
0.19.1
0.19.2
0.19.3
0.19.4
0.2.0
0.20.0
0.20.1
0.20.2
0.21.0
0.21.1
0.21.2
0.21.3
0.21.4
0.21.5
0.21.6
0.22.0
0.22.1
0.22.2
0.22.3
0.22.4
0.22.5
0.23.0
0.23.1
0.23.2
0.24.0
0.24.1
0.24.2
0.24.3
0.24.4
0.24.5
0.24.6
0.25.0
0.25.1
0.26.0
0.26.1
0.26.2
0.26.3
0.26.4
0.26.5
0.27.0
0.27.1
0.28.0
0.28.1
0.29.0
0.29.1
0.3.0
0.3.1
0.3.2
0.3.3
0.3.4
0.3.5
0.30.0
0.31.0
0.31.1
0.31.2
0.31.3
0.32.0
0.32.1
0.32.2
0.32.3
0.32.4
0.33.0
0.33.1
0.34.0
0.34.1
0.35.0
0.35.1
0.35.2
0.36.0
0.36.1
0.36.2
0.37.0
0.37.1
0.38.0
0.39.0
0.39.1
0.4.0
0.4.1
0.4.2
0.4.3
0.4.4
0.4.5
0.4.6
0.40.0
0.40.1
0.41.0
0.41.1
0.42.0
0.42.1
0.43.0
0.43.1
0.43.2
0.43.3
0.44.0
0.44.1
0.44.2
0.45.0
0.45.1
0.46.0
0.47.0
0.47.1
0.47.2
0.48.0
0.49.0
0.5.0
0.5.1
0.5.2
0.5.3
0.5.4
0.50.0
0.51.0
0.52.0
0.53.0
0.54.0
0.54.1
0.55.0
0.56.0
0.56.1
0.56.2
0.57.0
0.57.1
0.58.0
0.58.1
0.58.2
0.59.0
0.59.1
0.59.2
0.59.3
0.6.0
0.6.1
0.6.2
0.6.3
0.6.4
0.6.5
0.6.6
0.6.7
0.6.8
0.6.9
0.60.0
0.61.0
0.62.0
0.63.0
0.63.1
0.64.0
0.65.0
0.66.0
0.67.0
0.67.1
0.68.0
0.69.0
0.7.0
0.7.1
0.7.2
0.7.3
0.7.4
0.70.0
0.71.0
0.71.1
0.71.2
0.71.3
0.72.0
0.73.0
0.74.0
0.8.0
0.8.1
0.8.2
0.9.0
0.9.1
0.9.2
0.9.3
0.9.4
0.9.5
0.9.6
0.9.7
0.9.8
Labels
Clear labels
Mi Band 7
activity data processing, import, export
the provided PR needs some modifications
Information for contributors
Amazfit Band 5
Huawei honor
Mi Smart Band 5
Mi Smart Band 6
Sony
Gadgetbridge
good entry level issue for new contributors
no, sorry
An icebox for abandoned PRs. Feel free to pick it up, update and make a new PR
metric/imperial/celsius/fahrentheit...
ideas pool for a network enabled companion app
ideas and improvements for notifications
PR seems to abandoned
probably should/could close
Apply labels
device mi band 7
Mi Band 7
activity post processing
activity data processing, import, export
activity/health
Android 12
Android 13
android integrations
architecture
Bangle.js
bug
changes requested
the provided PR needs some modifications
charts
details not provided
developer documentation
Information for contributors
device amazfit band 5
Amazfit Band 5
device amazfit bip
device amazfit cor
device Casio
device fossil
device gtr 2e
device gts 2 mini
device h30
device hplus
device Huawei
Huawei honor
device liveview
device mi band
device mi band 2
device mi band 3
device mi band 4
device mi band 5
Mi Smart Band 5
device mi band 6
Mi Smart Band 6
device no.1 f1
device pace
device pebble
device pebble 2
device pinetime infinitime
device request
device sony
Sony
device support
device watch 9
discussion
documentation
duplicate
enhancement
feature request
Gadgetbridge
Gadgetbridge
good first issue
good entry level issue for new contributors
help wanted
i am developing my own app can you help
no, sorry
icebox
An icebox for abandoned PRs. Feel free to pick it up, update and make a new PR
internationalisation
metric/imperial/celsius/fahrentheit...
invalid
needs work
network companion app
ideas pool for a network enabled companion app
no feedback
not a bug
notifications
ideas and improvements for notifications
one of the 1000 issues about disconnection
pairing/connecting
potentially fixed / confirm and close
question
research
security
seems abandoned
PR seems to abandoned
Solved, waiting for F-Droid release
suggest to close
probably should/could close
task
user interface / UX
weather
wontfix
Zepp OS
No Label
device mi band 7
activity post processing
activity/health
Android 12
Android 13
android integrations
architecture
Bangle.js
bug
changes requested
charts
details not provided
developer documentation
device amazfit band 5
device amazfit bip
device amazfit cor
device Casio
device fossil
device gtr 2e
device gts 2 mini
device h30
device hplus
device Huawei
device liveview
device mi band
device mi band 2
device mi band 3
device mi band 4
device mi band 5
device mi band 6
device no.1 f1
device pace
device pebble
device pebble 2
device pinetime infinitime
device request
device sony
device support
device watch 9
discussion
documentation
duplicate
enhancement
feature request
Gadgetbridge
good first issue
help wanted
i am developing my own app can you help
icebox
internationalisation
invalid
needs work
network companion app
no feedback
not a bug
notifications
one of the 1000 issues about disconnection
pairing/connecting
potentially fixed / confirm and close
question
research
security
seems abandoned
Solved, waiting for F-Droid release
suggest to close
task
user interface / UX
weather
wontfix
Zepp OS
Milestone
Set milestone
Clear milestone
No items
No Milestone
Assignees
Assign users
Clear assignees
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
No dependencies set.
Reference: Freeyourgadget/Gadgetbridge#206
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
No
Yes
We should port our manual db handling code to http://greendao-orm.com/
Now that there's greendao in master, I believe we should start discussing what we want from the schema.
The following describes a proposal for the new database schema. With @comments@ and ?questions?
General considerations:
@Eg: we want to save activityTypes which we are not aware of, but generally we want to show to the user only the one we know about (sleep, deep sleep, etc.)
User:
birthday, gender, height, weight
?do we want more then one user, if so: ID?
Device:
id,user_id,?shortname?,?system_id?,!TBD!
?a device is tied to the user (because of personal data), so it's sufficient to have the device as foreign key in the following tables.
If the same device is reused by another user in the future, it must get a new ID.?
Activity_dataprovider_type:
id,description @eg. HRM, steps, activity recognition, ...@
@this points to the different tables documented below, but the link logic cannot live at the DB layer unfortunately@
Device_activity_dataprovider_type_link:
device_id,activity_dataprovider_type_id
@N-to-N relationship between device and supported providers@
Data providers: @The schema of each dataprovider depends on the specific data type, possibly even by the device!
Where possible, they are abstracted to a MCD (e.g. steps per minute and HRM per minute)@
HRM_minute_average:
device_id,timestamp,HRM_value
@used by miband 1s, HRM straps (unsupported as of now), pebble 2 (unsupported as of now)@
steps_minute_average:
device_id,timestamp,steps_count
@used by miband*, pebble time *@
miband_specific_data_minute_average:
device_id,timestamp,activity_intensity,activity_type,...
pebble_specific_data_minute_average:
device_id,timestamp,orientation,VMC,light_intensity,...
@used by pebble time *@
miband_live_activity_measurement:
device_id,timestamp,?all_the_readings_serialized?
pebble_activity_data_overlay:
device_id,timestamp_start,timestamp_end,activity_type,...
@used by pebble time@
user_entered_activity_data_overlay:
device_id,timestamp_start,timestamp_end,...
@used to store the "corrections" the user enters into GB. Eg. sleep vs non-sleep, etc.@
General remarks:
UserAttributes
andDeviceAttributes
and giving the entries a validity date. As soon as any volatile data is changed, the old table row will be marked as invalid from now on and a new row will be created and marked as valid from now on.Remarks regarding the tables
✅
User
done🔸
Device
-- done, except for the link to the user. ATM the user is linked to each sample, not the device. If we want to have it at the device, it should be considered volatile and go intoDeviceAttributes
, I think.❓ I don't quite get the
Activity_dataprovider_type
. Isn't this just an Activity_type?❓ why
steps_minute_average
It's the actual steps per minute, not an average value, no?❓
miband_live_activity_measurement
I'd like to have a single table for all intensity values, a single table for all HR measurements and a single table for all steps. What's the reason for splitting them?A final remark: I'm afraid that having so many device specific tables will make the implementation rather complex. I'd vote for having as few device specific tables as possible.
I didn't get the static vs volatile data thing. It makes great sense!
Here's a summary of the current state, as well as the reasons for it.
On the Road
First, we did consider to use separate tables for every sample type (i.e. one table for heart rate samples, one for activity samples (intensity), one for steps, one for light intensity, etc.). But since we want to store raw values, that is, device specific values that are normalized at runtime, we would have even more tables. E.g. activity intensity values are device specific, similarly activity type values. Only few sample types like heart rate (= bpm) and steps (total per day, or maybe a delta) would be device independent.
So instead of having a few device independent tables plus a few device specific tables and all the complexity of mixing and matching these at runtime, we went for having a single table per device, or more correct, per sample provider (there are different software implementations that provide samples for the Pebble, for example).
Now that we settled on one specific table per device type, we still wanted to have separate sample interfaces (e.g.
HeartRateSample
,ActivitySample
,LightIntensitySample
, etc.When implementing the client side for that, we noticed two drawbacks of having such separate interfaces:
instanceof
check for every sample, and another validity check for its value.Having separate interfaces also made the backend implementation a tad complicated, so these three things made us go another route, which is what we have right now in master.
Current State
ActivitySample
, but about to be renamed toSample
. This interface contains the parts about heart rate, activity, light intensity, steps, etc.NOT_MEASURED
value by defaultBenefits
SampleProvider
implementationsinstanceof
necessary. If the client queries for heart rate samples only, it can easily ignore all the methods about steps and light in the sample interface.ActivitySample.NOT_MEASURED.
Sample
interface, as well as default implementations to theAbstractSample
class. Then a device specificSampleProvider
andSample
implementation can actually handle the new sample type and a client has to make use of it.So the main benefit and reason we did it that way is reduced complexity on all levels.
Closed with 0.12