-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add device decoder: TicWatch GTH & GTH Pro (GTH+). #494
Conversation
First attempt at any decoder. - Invented a (unique) model_id. - Condition checks name starts with TicWatch GTH (Pro version adds '+'). Name suffixed by a space and last 4 characters of MAC). - Properties: mac decoder from manufacturer data (offset 4 hex digits, ie 0000<mac> in usual printed order) - Tag: picked 11(Body) type (vs.16). Not an RMAC. Believe continuous/active scanning may be best (how to tell? TheengsDecoder Gateway updates mqtt with rssi value regularly as is; is not cidc compliant, reports Ericsson AB mfr but Mobvoi/Ticwatch no known connection to them). - (Assumed "byte[0]" from adding-decoders doc is lsb not first digits in value. Is hex representation ok?
The existing |
MQTT post for the ticwatch, replaced the MAC by aabbccddeeff for privacy reasons (assuming the last 4 hex digits aren't the same for all of these devices) - this is for the GTH+ but I also previously owned the GTH (non-pro version). |
Looks like a good start @jgbreezer Just off to bed here, but will look at it more and comment tomorrow, but
The commented out pretty JSON is for clarity and making changes. If you are using Visual Studio Code as well you can do a ![]() from the Command Palette to convert it. And as the name suggests, it would also be auto-applied with a git commit. |
@jgbreezer Did you follow https://decoder.theengs.io/use/python.html#installing-a-development-version? ArduinoJSON should then be found, as the repository is cloned recursively with all submodules this way. If you have cloned the repository without its submodules, you can always get it later with For the automatic conversion, it's expected that you do your changes in the comment with the R-string, and then automatically convert it to the C char array. To do this, install pre-commit with |
Hi again @jgbreezer
With this sample you have given for your GTH+ I assume that this is the only advertising data being broadcast by the watch, or do you ever receive any other data? Also with the manufacturerdata and you understandably masking out the MAC address, the 0000 would then have been the company ID for the Gateway If this manufacturerdata is all that is being received by the watch I don't really see any point in creating a full decoder for it, as there are no useful encoded properties in the broadcast data, apart from its MAC address, which is already known for this device from being scanned. So my assumption here is that you would want to use the GTH+ as an auto-discovered device tracker in Home Assistant. Is that the case? For that you would only want a tracker decoder, best added to the other tracker decoders in https://github.com/theengs/decoder/blob/development/src/devices/tracker_json.h
Continuous scanning is only really required for devices like contact or motion sensors, where the broadcast data could happen at any time and only for a very brief moment - this is not the case for the watch. Active scanning is however an issue to consider here,e specially as you have the broadcast name in the model condition. The vast majority of devices only broadcast their name when being actively scanned. As passive scanning is preferable though, as it does not affect the device's battery at all, it might be better to change the model condition to only look at the data length of the manufacturerdata, looking that it starts with the Ericsson AB company ID and that from index 4 of the manufacturerdata it contains the MAC address. For a decoder like that, only being used as a tracker decoder the type should also be changed to I hope this clarifies things a bit more. |
Hi @jgbreezer How are you getting on with the GTH/GTH Pro decoder, or let us know if you have any further queries? |
I have added the TicWatch GTH (Pro) to the existing tracker decoders, as form your sample above there doesn't seem to be any additional information, like steps or heart rate, encoded in the broadcast manufacturerdata - only the Ericsson AB company id and the MAC address. Hence also no separate device documentation page and Have a look at the PR and let us know if you think there should be any additions or changes. |
First attempt at any decoder for a device. Please check carefully/make suggestions for the rest of it, and help me do a decent job, perhaps update docs for unclear things I mention below, and see my comments:
Description:
Checklist: