I received a Kinsa BLE thermometer as a gift, but to my dismay discovered that their proprietary app doesn't keep measurements in HealthKit. Not to look a gift horse in the mouth, but I prefer to keep my private data private, where possible. I reverse engineered the BT protocol to a sufficient degree that I could read the data off of the device as it is taking measurements. This is my gift to you so that you can take ownership of your private health data, too.
This repo contains a Swift framework and a sample application. You merely need to get an instance of a ThermometerManager
, implement the ThermometerObserver
protocol and let the manager know about your observer:
ThermometerManager.shared.addObserver(self)
That's it. You'll get notified of various events, like when the thermometer is connected, ready to take measurements, starts reading temperature, and comes back to you with a final reading. Not a lot of rocket science.
Oh, and in case there was any doubt, this is not an official Kinsa project, trademarks belong to their respective owners, etc.
If you're interested in creating your own implementation for another platform, below are the byte mappings for messages sent:
Example bytes: 42000170
42
- Intermediate temperature reading header.00
- Sequence byte. Increments with each subsequent reading.01
- First byte of the temperature.70
- Second byte of the temperature.Example bytes: 46000170000038
46
- Final temperature reading header.00
- Always 0. Reserved for some future use.01
- First byte of the temperature.70
- Second byte of the temperature.00
- Always 0. Reserved for some future use.00
- Always 0. Reserved for some future use.38
- Unknown. No discernible pattern. Some sort of confidence or error byte?Example bytes: 304b696e73610000000000000000000000
30
- Text Header4b
- Ascii K69
- Ascii i6e
- Ascii n73
- Ascii s61
- Ascii aExample bytes: 06140607102106
06
- Date/Time header14
- Year #Y2K06
- Month07
- Day10
- Hour (expressed in 24 hour time)21
- Minute06
- SecondExample bytes: 0830303032333034323031353136313736
08
MAC header