Created
January 8, 2020 05:48
-
-
Save shinyquagsire23/f7907fdf6b470200702e75a30135caf3 to your computer and use it in GitHub Desktop.
Philips Hue BLE Services and Characteristics (WIP)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DeviceInfo(softwareRevision, isOn, | |
| SceneLightState(color, powerOnBehavior, deviceInfo | |
| Light(id, | |
| Capabilities(dimmable, customState | |
| PowerOnBehavior(option | |
| hueplay, huebloom, hueiris, huelightstrip, huego, plug, bollard, wallspot, groundspot, flexiblelamp, wallshade, walllantern | |
| [ea:44:13:bd:db:59] Service [b8843add-0000-4aa1-8794-c3f462030bda] Unknown, ble_firmware_update? | |
| [ea:44:13:bd:db:59] Characteristic [b8843add-0004-4aa1-8794-c3f462030bda] | |
| [ea:44:13:bd:db:59] Characteristic [b8843add-0003-4aa1-8794-c3f462030bda] | |
| [ea:44:13:bd:db:59] Characteristic [b8843add-0002-4aa1-8794-c3f462030bda] | |
| [ea:44:13:bd:db:59] Characteristic [b8843add-0001-4aa1-8794-c3f462030bda] | |
| [ea:44:13:bd:db:59] Service [932c32bd-0000-47a2-835a-a8d455b859dd] light_control - startupConfiguration, combinedControl | |
| [ea:44:13:bd:db:59] Characteristic [932c32bd-0001-47a2-835a-a8d455b859dd] unk, 00 01 03 01 02 99 00 02 02 F4 01 03 02 01 00 | |
| [ea:44:13:bd:db:59] Characteristic [932c32bd-0002-47a2-835a-a8d455b859dd] Light state, 01/00 | |
| [ea:44:13:bd:db:59] Characteristic [932c32bd-0003-47a2-835a-a8d455b859dd] Brightness | |
| [ea:44:13:bd:db:59] Characteristic [932c32bd-0004-47a2-835a-a8d455b859dd] unk, E9 00 | |
| [ea:44:13:bd:db:59] Characteristic [932c32bd-0005-47a2-835a-a8d455b859dd] Color | |
| [ea:44:13:bd:db:59] Characteristic [932c32bd-0006-47a2-835a-a8d455b859dd] unk, write-only | |
| [ea:44:13:bd:db:59] Characteristic [932c32bd-0007-47a2-835a-a8d455b859dd] everything, includes color and brightness combined_light_control_port | |
| [ea:44:13:bd:db:59] Characteristic [932c32bd-1005-47a2-835a-a8d455b859dd] Also everything, but last four bytes FF FF FF FF - default powerloss state? combined_light_control_port_factory? | |
| [ea:44:13:bd:db:59] Service [0000fe0f-0000-1000-8000-00805f9b34fb] device_configuration_service_info - ProximityPairingSetup somewhere | |
| [ea:44:13:bd:db:59] Characteristic [97fe6561-0001-4f62-86e9-b71ee2da3d22] zigbee address, 64 e2 7a 08 01 88 17 00 | |
| [ea:44:13:bd:db:59] Characteristic [97fe6561-0003-4f62-86e9-b71ee2da3d22] userDefinedDeviceName, "Lamp" | |
| [ea:44:13:bd:db:59] Characteristic [97fe6561-0004-4f62-86e9-b71ee2da3d22] | |
| [ea:44:13:bd:db:59] Characteristic [97fe6561-0008-4f62-86e9-b71ee2da3d22] | |
| [ea:44:13:bd:db:59] Characteristic [97fe6561-a001-4f62-86e9-b71ee2da3d22] write-only | |
| [ea:44:13:bd:db:59] Characteristic [97fe6561-2004-4f62-86e9-b71ee2da3d22] write-only | |
| [ea:44:13:bd:db:59] Characteristic [97fe6561-2002-4f62-86e9-b71ee2da3d22] write-only | |
| [ea:44:13:bd:db:59] Characteristic [97fe6561-2001-4f62-86e9-b71ee2da3d22] unk, 0A | |
| [ea:44:13:bd:db:59] Service [0000180a-0000-1000-8000-00805f9b34fb] | |
| [ea:44:13:bd:db:59] Characteristic [00002a28-0000-1000-8000-00805f9b34fb] fw version | |
| [ea:44:13:bd:db:59] Characteristic [00002a24-0000-1000-8000-00805f9b34fb] model | |
| [ea:44:13:bd:db:59] Characteristic [00002a29-0000-1000-8000-00805f9b34fb] manufacturer | |
| [ea:44:13:bd:db:59] Service [00001801-0000-1000-8000-00805f9b34fb] | |
| [ea:44:13:bd:db:59] Characteristic [00002a05-0000-1000-8000-00805f9b34fb] Service changed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @nattzp @evan-brass , I have been tinkering with my Hue bulb lately and found out how to create schedules.
The GATT UUID is 9da2ddf1‑0001‑44d0‑909c‑3f3d3cb34a7b (handle 0x0072), which is used to create a new schedule but also to activate/deactivate and delete existing schedules. I'll describe in detail my findings in the following.
I have created this Python script to manage and create schedules as an example.
List schedules
Listing schedules is a short query, not a full-body payload. You just want to send
0x00to the GATT, and you'll receive a response like:Example response:
Common Full Schedule Payload Layout
Create and update operations both use the same full schedule-body format.
Confirmed byte layout:
0011..2ff fffor create, existing id for update300in captured create/update payloads401for active,00for disabled500in captured create/update payloads6..910..1300 0e 01 01for standard wake/sleep payloads1400sleep,01wake15..2223..2425..260x0118 + title_len27..42in early notes /28..43in opcode-included payloads43in early notes /44in opcode-included payloads01for captured sleep schedules,00for captured wake schedules4bytesff ff ff ff1byteNbytesImportant timestamp rule:
Important type-specific fixed blocks for standard payloads:
10..2200 0e 01 01 00 02 01 01 03 02 4c 02 05 0200 0e 01 01 01 02 01 fe 03 02 bf 01 05 02Create A New Schedule
Create uses the full schedule-body format with a source id of
ffff.Generic create payload shape:
For a standard sleep schedule built from parameters:
01ff ff00 01 0000 0e 01 01 00 02 01 01 03 02 4c 02 05 020x0118 + title_len01ff ff ff ff01For a standard wake schedule built from parameters:
01ff ff00 01 0000 0e 01 01 01 02 01 fe 03 02 bf 01 05 020x0118 + title_len00ff ff ff ff01Create success notifications:
Create failure notification:
Read Back One Schedule In Detail
Detail-read is a short request followed by a containerized schedule body.
Request format:
Response shape:
The
<body...>bytes can be reconstructed into a normal schedule-like payload as:That reconstructed payload reuses the same offsets as create/update payloads, which is why read-back decoding can extract title, kind, fade, timestamp, UUID, and enabled flag directly.
5. Update An Existing Schedule
Update reuses the full schedule-body format from create, but changes the source id and, when toggling state, the enabled bytes.
Generic update prefix:
Rules:
source_id_leis the existing schedule id to replaceUpdate success notifications:
Activate Or Deactivate A Schedule
Activate and deactivate are specialized update operations using the same full-body update format.
Deactivate:
Activate:
Confirmed live deactivate example:
Meaning: schedule id
2was replaced by disabled schedule id3.Confirmed live reactivate example:
Meaning: schedule id
3was replaced by enabled schedule id4.Delete A Schedule
Delete is a separate short command and does not use the full schedule body.
Request format:
Success notifications:
Confirmed example for deleting schedule id
5:Missing pieces
I don't have access to repeating schedules or other options which are paywalled on the app.
The following parts are still partly inferred even though the overall command format is operational:
10..22beyond their role as kind/behavior descriptors0x0118 + title_lenfield at offsets25..26, even though it is confirmed for the standard wake/sleep builderff ff ff ffis strictly a recurrence mask, a default-all-days marker, or another scheduler bitfield