#1866 Amazfit GTS: Missing Calendar support

Open
opened 2 weeks ago by sre · 7 comments
sre commented 2 weeks ago

Before reporting a bug, please confirm the following:

  • I have read the wiki, and I didn't find a solution to my problem / an answer to my question.
  • I have searched the issues, and I didn't find a solution to my problem / an answer to my question.
  • If you upload an image or other content, please make sure you have read and understood the github policies and terms of services

I got Gadgetbridge from:

  • F-Droid, but checked the feature has not implemented in git since last release

If you got it from Google Play, please note that version is unofficial and not supported here; it's also often quite outdated. Please switch to one of the above versions if you can.

Your issue is:

Gadgetbridge settings provide an option, that calendar events should be synchronized to the gadget and the Amazfit GTS has an Event reminder section. None of my calendar entries have been synchronized to the watch, though. I could saw some gadgetbridge code to send calendar events to Amazfit devices, so I'm not sure if this is an issue with that code not supporting the GTS or gadgetbridge not being able to pull calendar events from my old LineageOS.

Your wearable device is:

Amazfit GTS, HW V0.36.19.20, FW 0.0.8.90

Your android version is:

LineageOS 14.1 on Motorola Droid 4

Your Gadgetbridge version is:

0.44.0

#### Before reporting a bug, please confirm the following: - [x] I have read the [wiki](https://github.com/Freeyourgadget/Gadgetbridge/wiki), and I didn't find a solution to my problem / an answer to my question. - [x] I have searched the [issues](https://github.com/Freeyourgadget/Gadgetbridge/issues), and I didn't find a solution to my problem / an answer to my question. - [x] If you upload an image or other content, please make sure you have read and understood the [github policies and terms of services](https://help.github.com/articles/github-terms-of-service/#1-responsibility-for-user-generated-content) ### I got Gadgetbridge from: * [x] F-Droid, but checked the feature has not implemented in git since last release ~~If you got it from Google Play, please note [that version](https://github.com/TaaviE/Gadgetbridge) is unofficial and not supported here; it's also often quite outdated. Please switch to one of the above versions if you can.~~ #### Your issue is: Gadgetbridge settings provide an option, that calendar events should be synchronized to the gadget and the Amazfit GTS has an Event reminder section. None of my calendar entries have been synchronized to the watch, though. I could saw some gadgetbridge code to send calendar events to Amazfit devices, so I'm not sure if this is an issue with that code not supporting the GTS or gadgetbridge not being able to pull calendar events from my old LineageOS. #### Your wearable device is: Amazfit GTS, HW V0.36.19.20, FW 0.0.8.90 #### Your android version is: LineageOS 14.1 on Motorola Droid 4 #### Your Gadgetbridge version is: 0.44.0
ashimokawa commented 2 weeks ago
Owner

@sre

The calendar events are synchronized as “reminders” upon connect. This is a minimal solution.

There is far more sophisticated code which listens for added and removed calendar events but that is only used for the pebble becaue the Huami devices only allow a handful of events and we do not have code to deal with the constraint.

If nothing gets synced and Gadgetbridge has the permission to read the calendar then it could be that the protocol has changed for the GTS. I do not have a GTS so I cannot test.

@sre The calendar events are synchronized as "reminders" upon connect. This is a minimal solution. There is far more sophisticated code which listens for added and removed calendar events but that is only used for the pebble becaue the Huami devices only allow a handful of events and we do not have code to deal with the constraint. If nothing gets synced and Gadgetbridge has the permission to read the calendar then it could be that the protocol has changed for the GTS. I do not have a GTS so I cannot test.
sre commented 2 weeks ago
Poster

For me no Event reminders are configured by gadgetbridge at all. I just verified that Gadgetbridge has the calendar permission granted. I don't have privacy guard configured for GB either.

I couldn't find any mention of calendar in the GB log (except for “Loaded calendars_blacklist has 0 entries”), that's why I wasn't sure if its related to my LineageOS installation. I expected some log lines, that GB tries/failed to push an event reminder.

For me no Event reminders are configured by gadgetbridge at all. I just verified that Gadgetbridge has the calendar permission granted. I don't have privacy guard configured for GB either. I couldn't find any mention of calendar in the GB log (except for "Loaded calendars_blacklist has 0 entries"), that's why I wasn't sure if its related to my LineageOS installation. I expected some log lines, that GB tries/failed to push an event reminder.
ashimokawa commented 2 weeks ago
Owner

For me no Event reminders are configured by gadgetbridge at all

There is no way to configure event reminders in gadgetbridge.

Did you enable calendar syncing when pressing the gear icon in the main activity?

you can go to the debug menu and press “set time”, this should also trigger the calendar(reminder) sync code.

There could also be some confusion, because I never saw the GTS, does it have a calender feature apart from reminders maybe? And we should use that?

I tested the feature with Mi Band 4 and Bip.

> For me no Event reminders are configured by gadgetbridge at all There is no way to configure event reminders in gadgetbridge. Did you enable calendar syncing when pressing the gear icon in the main activity? you can go to the debug menu and press "set time", this should also trigger the calendar(reminder) sync code. There could also be some confusion, because I never saw the GTS, does it have a calender feature apart from reminders maybe? And we should use that? I tested the feature with Mi Band 4 and Bip.
sre commented 2 weeks ago
Poster

There is no way to configure event reminders in gadgetbridge.

Yes, I meant none are configured on the GTS via the calendar syncing feature. I do have the feature enabled in gadgetbridge via the gear icon option.

you can go to the debug menu and press “set time”, this should also trigger the calendar(reminder) sync code.

After pressing the “set time” debug option, I can now see event reminders on the GTS.

For the synced events time and date looks correct, but they are missing a text/subject/title (so only time and date are provided). I see the text is included in the data sent to the watch according to the log, so I guess that really is a protocol change. I will try to get a BT log how Amazfit app sends the event to the GTS.

There could also be some confusion, because I never saw the GTS, does it have a calender feature apart from reminders maybe? And we should use that?

no, there is no calendar feature apart from event reminders. But reminders are called “Event reminder” on GTS.

> There is no way to configure event reminders in gadgetbridge. Yes, I meant none are configured on the GTS via the calendar syncing feature. I do have the feature enabled in gadgetbridge via the gear icon option. > you can go to the debug menu and press “set time”, this should also trigger the calendar(reminder) sync code. After pressing the "set time" debug option, I can now see event reminders on the GTS. For the synced events time and date looks correct, but they are missing a text/subject/title (so only time and date are provided). I see the text is included in the data sent to the watch according to the log, so I guess that really is a protocol change. I will try to get a BT log how Amazfit app sends the event to the GTS. > There could also be some confusion, because I never saw the GTS, does it have a calender feature apart from reminders maybe? And we should use that? no, there is no calendar feature apart from event reminders. But reminders are called "Event reminder" on GTS.
sre commented 2 weeks ago
Poster

Here is a message as being sent by Amazfit app to the GTS. I added annotation based on the information I found in sendCalendarEventsAsReminder().

-----------------------------------------------------
Amazfit: Saturday 13:30 [repeat weekly], Text=Tauchen
-----------------------------------------------------
0x0b // always 0x0b?
0x02 // id

0x09 // flags: 0x1=enable, 0x08=has text
0x04 // period: 0x04=repeat weekly, 0x00=do not repeat
0x00 // possibly days of week for custom period
0x00 // terminator?

0xe4 0x07 // YEAR=2020
0x05 // MONTH=May
0x10 // DAY=16
0x0d // HOUR=13
0x1e // MINUTE=30

0x00 // new?

0x54 0x61 0x75 0x63 0x68 0x65 0x6e // TEXT=Tauchen

0x00
-----------------------------------------------------

The Amazfit app does not support setting end date or body, but it's possible to setup different periods (once, every day, every week, every month, every year, custom -> [List of Weekdays]). I will have a look at reversing the period information later.

Here is a message as being sent by Amazfit app to the GTS. I added annotation based on the information I found in `sendCalendarEventsAsReminder()`. ``` ----------------------------------------------------- Amazfit: Saturday 13:30 [repeat weekly], Text=Tauchen ----------------------------------------------------- 0x0b // always 0x0b? 0x02 // id 0x09 // flags: 0x1=enable, 0x08=has text 0x04 // period: 0x04=repeat weekly, 0x00=do not repeat 0x00 // possibly days of week for custom period 0x00 // terminator? 0xe4 0x07 // YEAR=2020 0x05 // MONTH=May 0x10 // DAY=16 0x0d // HOUR=13 0x1e // MINUTE=30 0x00 // new? 0x54 0x61 0x75 0x63 0x68 0x65 0x6e // TEXT=Tauchen 0x00 ----------------------------------------------------- ``` The Amazfit app does not support setting end date or body, but it's possible to setup different periods (once, every day, every week, every month, every year, custom -> [List of Weekdays]). I will have a look at reversing the period information later.
sre commented 2 weeks ago
Poster

I figured out the remaining controllable flags. At least for the GTS Amazfit app does not support disabling reminders, does not support saving them with empty text, has only one text box (so no title + body) and provides no way to setup an end date. The flag names in brackets are taken over from existing code, since they are constant for GTS and cannot be verified with Amazfit app:

Flags (upper two bytes are both 0):

BIT( 0) = 1 (reminder is enabled)
BIT( 1) = 0
BIT( 2) = 0 (reminder has end date)
BIT( 3) = 1 (reminder has text)
BIT( 4) = 0
BIT( 5) = repeat on monday
BIT( 6) = repeat on tuesday
BIT( 7) = repeat on wednesday
BIT( 8) = repeat on thursday
BIT( 9) = repeat on friday
BIT(10) = repeat on saturday
BIT(11) = repeat on sunday
BIT(12) = repeat monthly
BIT(13) = repeat yearly
BIT(14) = 0
BIT(15) = 0

All GTS reminders send by Amazfit app were structured like this:

Byte(0x0b)
Byte(id)
Int(flags)
BLETypeConversions.shortCalendarToRawBytes(datetime)
Byte(0x00)
ByteArray(title)
Byte(0x00)
I figured out the remaining controllable flags. At least for the GTS Amazfit app does not support disabling reminders, does not support saving them with empty text, has only one text box (so no title + body) and provides no way to setup an end date. The flag names in brackets are taken over from existing code, since they are constant for GTS and cannot be verified with Amazfit app: Flags (upper two bytes are both 0): ``` BIT( 0) = 1 (reminder is enabled) BIT( 1) = 0 BIT( 2) = 0 (reminder has end date) BIT( 3) = 1 (reminder has text) BIT( 4) = 0 BIT( 5) = repeat on monday BIT( 6) = repeat on tuesday BIT( 7) = repeat on wednesday BIT( 8) = repeat on thursday BIT( 9) = repeat on friday BIT(10) = repeat on saturday BIT(11) = repeat on sunday BIT(12) = repeat monthly BIT(13) = repeat yearly BIT(14) = 0 BIT(15) = 0 ``` All GTS reminders send by Amazfit app were structured like this: ``` Byte(0x0b) Byte(id) Int(flags) BLETypeConversions.shortCalendarToRawBytes(datetime) Byte(0x00) ByteArray(title) Byte(0x00) ```
ashimokawa commented 2 weeks ago
Owner

@sre

Thanks! That should be enough information :+1:

@sre Thanks! That should be enough information :+1:
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.