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

import asyncio

from bleak import BleakClient, BleakScanner

from govee_h6199_ble import (
    GetFirmwareVersion,
    GetHardwareVersion,
    GetPowerState,
    PowerOff,
    PowerOn,
    connected,
)


async def main():
    # scan and find first usable device
    devices = await BleakScanner.discover()
    named_devices = ((device, device.name) for device in devices if device.name)
    h6199_devices = (
        device for device, name in named_devices if name.startswith("Govee_H6199")
    )

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

                    # get firmware version and turn device off
                    fw_version, hw_version, _ = await device.send_commands(
                        [GetFirmwareVersion(), GetHardwareVersion(), PowerOff()]
                    )

                    print(fw_version, hw_version)
                else:

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


if __name__ == "__main__":
    asyncio.run(main())

Exchanging raw frames

You can also exchange raw frames with the device using:

async def exchange_frame(
    self,
    frame: bytes,
    timeouts: CommandTimeouts,
) -> bytes:...

and inspect responses manually.

Be aware, if the command is not implemented on the device this call command will raise asyncio.TimeoutError, since response will not be received.

Timeouts

By default, the client uses the following timeouts:

  • command send timeout: None
  • response receive timeout: 5 seconds

You can customize these timeouts by passing a CommandTimeouts instance to the send_command(s) calls.

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-1.0.0.tar.gz (7.0 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-1.0.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: govee_h6199_ble-1.0.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.13.2 Darwin/24.6.0

File hashes

Hashes for govee_h6199_ble-1.0.0.tar.gz
Algorithm Hash digest
SHA256 62b41bd6445ba256f284190fd38a9ce8890d2f6aeac95137c4da7523f8f86178
MD5 2195f7c12e88539503ce02acbed4f4e0
BLAKE2b-256 6a549f0de7cfc3bf083305bcb24f909966264799b7244b1dd0e4c4bcb49fadbc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: govee_h6199_ble-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.13.2 Darwin/24.6.0

File hashes

Hashes for govee_h6199_ble-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 952b91b3171219fa7aabd3a21642dd1f1b016a055457fd5caa9e3dd333ceff7a
MD5 523e5102fc035c6213a60438cf34ac70
BLAKE2b-256 500875630c2c9e1a7a81f0654468c6de5809d7c3f6e255553555a89ab33add00

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