Xample33 / govee_H613_BTcontroller

Python script to control bluetooth govee devices
MIT License
1 stars 1 forks source link

H6008/H6003 support and general question #1

Open Fefedu973 opened 3 months ago

Fefedu973 commented 3 months ago

Hi ! I love this project this is exacly what i was looking for, i was wondering if it was possible to add the support of the H6008 (and optionally H6003) Govee light bulbs. they are wifi and bluetooth controllable but as they don't are compatible with the Govee LAN API and that i wanted to integrate them with third party software on my pc but i don't want to use the govee wifi api (lot of delay and rate limit so not suitable to do direct control with animations) By the way how is the delay with your script ? Can I use it to send like 20 colors every seconds to do an animation or it is not designed to do that ? Thanks

Xample33 commented 3 months ago

Hi,  I've also tested the library with two H6008s that I have. I wanted to sync the colors between the BLE LED strip and the two wifi H6008 (because, as you said, they do not have LAN API support). Theoretically,  the library works fine for getting the status of the H6008 (like power on/off, color, mode, brightness), but sending changes to the lamp does not work due to differences between the bytes for the BLE LED strip and the wifi lamp.

I don't know if it is possible to send lots of "commands" in a short amount of time, maybe with some adjustments I can do it.

If I have some free time, I will make some tests, and maybe if they are successful, I will release a new version.

Maybe, if you agree, we can also try with H6003, and if we are lucky enough, the commands are the same or at least similar.

Thanks!

Fefedu973 commented 3 months ago

Yes as you said i wanted to know if it could replace the lan api by sending 20/30 colors every seconds to create an animation (with signal rgb)

I can try with the H6003 how can i do it ? thanks

Xample33 commented 3 months ago

I will make some tests in the next few days, i'll let you know.

Fefedu973 commented 3 months ago

Thanks !

Fefedu973 commented 2 months ago

hi ! have you been able to do the tests ?

Xample33 commented 2 months ago

Hi, sorry for the late reply. I've done some tests and i can send about 5/7 commands per seconds to the light, i don't know if this limited by my hardware, the python bleak library or the optimization of my code.

Have you tried if the code works for H6003? Thanks

Fefedu973 commented 2 months ago

Hi, sorry for the late reply. I've done some tests and i can send about 5/7 commands per seconds to the light, i don't know if this limited by my hardware, the python bleak library or the optimization of my code.

Have you tried if the code works for H6003? Thanks

I think this is limited by the light hardware

Fefedu973 commented 2 months ago

Hi ! I'm back. I tried with my H6008 and unfortunately it didn't work. What can I do to help adding support for my devices ? Thanks

"Traceback (most recent call last): File "C:\Python311\Lib\site-packages\govee_H613_BTcontroller\govee_H613_BTcontroller.py", line 31, in connect await self.client.connect() File "C:\Python311\Lib\site-packages\bleak__init__.py", line 605, in connect return await self._backend.connect(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\bleak\backends\winrt\client.py", line 287, in connect raise BleakDeviceNotFoundError( bleak.exc.BleakDeviceNotFoundError: Device with address 60:74:F4:9F:20:98 was not found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\Users\ferre\Codespace\Projects\govee ble control test\main.py", line 19, in asyncio.run(main()) File "C:\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\asyncio\base_events.py", line 650, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "c:\Users\ferre\Codespace\Projects\govee ble control test\main.py", line 6, in main device = await device.connect() ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\site-packages\govee_H613_BTcontroller\govee_H613_BTcontroller.py", line 33, in connect raise BleakDeviceNotFoundError(f'Could not connect to {self.mac_address}') bleak.exc.BleakDeviceNotFoundError "

Xample33 commented 2 months ago

From traceback, probably the MAC address that you provided is incorrect or the device is off.

Fefedu973 commented 2 months ago

From traceback, probably the MAC address that you provided is incorrect or the device is off.

Hum that's weird, I copied the mac address from the govee app and yes the device is off but is powered so it should receive Bluetooth commands. And I just tried with it on and same error