Skip to main content

Manage Govee DreamView T1 (H6199) BLE devices

Project description

Govee DreamView T1 (H6199) Ble client

version python version license

This is a simple python client to control the Govee DreamView T1 (H6199) via BLE.

Limitations

The client was tested on a device with 1.10.04 / 3.02.01 FW/HW versions.

Getting current mode would not return currently set color of a static mode and wouldn't distinguish specific music modes and their parameters. The former is caused by device responding with all zeroes, and the latter can be fixed in the future.

There is no support for setting colors for specific segments, nor controling the brightness for individual segments.

Usage

The client uses bleak library and relies on it's BleakClient instance. Client supports the following actions (from govee_h6199_ble.commands package):

  • Get state
    • power
    • fw version
    • hw version
    • mac address
    • brightness
    • current mode
  • Turn on/off
  • Set brightness
  • Set Static color mode
  • Set Music color mode
    • Energic mode
    • Rythm mode
    • Spectrum mode
    • Rolling mode
  • Set Video color mode
    • Movie mode
    • Game mode

More information can be found by inspecting the govee_h6199_ble.commands package.

Example

from bleak import BleakClient, BleakScanner
from govee_h6199_ble import GoveeH6199, GetFirmwareVersion, PowerOn, PowerOff

if __name__ == '__main__':
    # scan and find first usable device
    devices = await BleakScanner.discover()
    named_devices = (device for device in devices if device.name)
    h6199_devices = (
        device for device in named_devices
        if device.name.startswith("Govee_H6199")
    )

    if device := next(h6199_devices, None):
        # connect
        async with BleakClient(first_device) as client:
            async with connected(client) as h6199:
                power = await device.send_command(GetPowerState())
                if power:
                    print("power on")

                    # get firmware version
                    fw_version = await device.send_command(GetFirmwareVersion())
                    print(fw_version)

                    # turn off
                    await device.send_command(PowerOff())
                else:

                    # turn on
                    await device.send_command(PowerOn())

The chain of commands can be sent using send_commands but in this mode you will not receive any responses.

You can also run raw commands using:

async def command_with_reply(
    self,
    cmd: int,
    group: int,
    payload: list[int] | None = None,
    timeout=5.0,
) -> bytes:...

and inspect responses manually. Be aware, if the command is not implemented in the device this call command will raise asyncio.TimeoutError, since response will not be received.

Credits

Govee for the device and the app.

https://github.com/Obi2000/Govee-H6199-Reverse-Engineering for the details of the protocol.

Contributing

Both bug reports and pull requests are appreciated.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

govee_h6199_ble-0.3.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

govee_h6199_ble-0.3.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file govee_h6199_ble-0.3.0.tar.gz.

File metadata

  • Download URL: govee_h6199_ble-0.3.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.9 Darwin/24.6.0

File hashes

Hashes for govee_h6199_ble-0.3.0.tar.gz
Algorithm Hash digest
SHA256 07e17c0c544b1e878fd1dff04b4c12eb9b4ab0bc35a4976d91432242f4c2efa1
MD5 a5e4d51b6302f0f4c4a3119991528826
BLAKE2b-256 725ed1d4d25f29442ebdf83ac90fc869793f63c1ea96b46c77ef2c6894abc7e3

See more details on using hashes here.

File details

Details for the file govee_h6199_ble-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: govee_h6199_ble-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.9 Darwin/24.6.0

File hashes

Hashes for govee_h6199_ble-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 265369e90d3087c5d7b4819303d6c9aa7a0c7206fa1d122e61fcc5f11885855f
MD5 a581b783f8445c88774aafc86bc7bd6d
BLAKE2b-256 80f98a98873e2deca73a1c2634903954ba558a1978cae02673be6715817bd432

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page