-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
Support for GATT Characteristic and Object Type #689
Comments
Definition [WIP] Option 1 Option 2 Option 3 My first preference goes to the second option at the moment |
Data packets The following data packets are going to be used, following the Bluetooth specifications (table is work in progress)
The factor is used to convert the broadcasted integer to a decimal, and is defined in the Bluetooth specs. e.g.
|
A first Work in Progress version can be found in the HA-BLE branch. At the moment, I have added the temperature sensor to const.py manually, you can test it by changing this line in const.py to the sensor you want (all sensors from the above table should work). Some example payloads are given in the test_ha_ble.py file BLE advertisements must contain |
The current version is released as 7.7.0. Automatic sensor creation will be added in a future release. |
@myhomeiot proposed in #548 to add support for the CayenneLPP for DIY sensors. After some research it turns out that the BLE format already has a definition for sensor readings, called GATT Characteristic and Object Type. The service data UUID16 field (
0x16
) cannot only contain UUID16, but alsoGATT Characteristic and Object Type
service data.In the following document, the
16-bit UUID for Members
(indicator for manufacturers) can be found on page 1-13. But more interesting for DIY sensors are the so calledGATT Characteristic and Object Type
, which can be found on page 13 and further.https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf
An example
A battery reading would read like
04162A1964
04
= length (without the first byte)16
= service data2A19
= Battery64
= in hex is 100 in decimalsThe definition of how the actual data should be defined is also defined in the GATT specification supplement.
https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=524815
Again, as example, as battery reading should be defined in 1 byte, raging between 0-100 (equals to
0x00
-0x64
in hex)CayenneLPPGATT Characteristic and Object TypeThe text was updated successfully, but these errors were encountered: