softgrass / govee-api-ble

Python API for Govee H6127 RGB lighting strips
MIT License
11 stars 1 forks source link

Characteristic Write Request failed: Attribute can't be written (False, False, b'') #2

Open johnsturgeon opened 2 years ago

johnsturgeon commented 2 years ago

Following the steps in the readme:

from govee_api_ble import GoveeDevice
my_device = GoveeDevice('D4:AD:FC:33:0A:D9')
my_device.setPower(False)
Characteristic Write Request failed: Attribute can't be written
(False, False, b'')

Some diagnostic info from gatttool Characteristics:

handle: 0x0002, char properties: 0x08, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
handle: 0x0004, char properties: 0x02, char value handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb
handle: 0x0006, char properties: 0x02, char value handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb
handle: 0x0009, char properties: 0x12, char value handle: 0x000a, uuid: 00010203-0405-0607-0809-0a0b0c0d2b10
handle: 0x000d, char properties: 0x06, char value handle: 0x000e, uuid: 00010203-0405-0607-0809-0a0b0c0d2b11
handle: 0x0012, char properties: 0x1c, char value handle: 0x0013, uuid: f000ffc1-0451-4000-b000-000000000000
handle: 0x0016, char properties: 0x1c, char value handle: 0x0017, uuid: f000ffc2-0451-4000-b000-000000000000
johnsturgeon commented 2 years ago

Device is H619A RGBIC

D4:AD:FC:33:0A:D9 GBK_H619A_0AD9 D4:AD:FC:33:0A:D9 GBK_H619A_0AD9

softgrass commented 2 years ago

From what I've researched, it appears that H619A's packets differ from H6127, the device this API was mainly made for. I'm doing some research as to what the packets are for your device.

I've found https://github.com/bwp91/homebridge-govee which has an API for the H619A, but the program is only for HomeBridge with integrates HomeKit devices.

I'm going to keep searching through their source code and try to get in contact with the developer to see if I can get the packet codes, but at the moment it appears the H619A won't work with this. I'll keep you updated and let you know if I find anything! :-)

softgrass commented 2 years ago

Also, the H619A has support for Alexa and Google Home according to Amazon, so implementing something there (for example with https://github.com/greghesp/assistant-relay) or with Govee's API (like with https://github.com/LaggAt/python-govee-api, which I believe would work since the lights can be controlled through WiFi).

Just a thought, I'll continue working on this though to try and support more devices :-)

johnsturgeon commented 2 years ago

Thanks for continuing to look into this, the Govee WiFi API is extremely limited, and very slow, so I was hoping this library would work :)

johnsturgeon commented 2 years ago

If there is any debugging information you would like, please let me know.

0PandaDEV commented 2 months ago

any updates on this?