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.

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
    • color mode
  • Turn on/off
  • Set brightness
  • Set Static color
  • Set Music color mode
    • Energic mode
    • Rythm mode
    • Spectrum mode
    • Rolling mode
  • Set Video color mode

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 h6199.get(GetFirmwareVersion())
                    print(fw_version)

                    # turn off
                    await h6199.set(PowerOff())
                else:

                    # turn on
                    await h6199.set(PowerOn())

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.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

govee_h6199_ble-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: govee_h6199_ble-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.4 Darwin/23.6.0

File hashes

Hashes for govee_h6199_ble-0.1.0.tar.gz
Algorithm Hash digest
SHA256 059997613ad2e68a033d6464ff6710824e970572a64dbc4aca5921dfdd50e5b2
MD5 d64d29b4adf3c8614af31c8c8e47146a
BLAKE2b-256 a1ebcc0b40dbe6d88c7792132a2ef2687b1db35893b128d9bf9d5025698b1683

See more details on using hashes here.

File details

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

File metadata

  • Download URL: govee_h6199_ble-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.4 Darwin/23.6.0

File hashes

Hashes for govee_h6199_ble-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e7abaf680571b20e289c7d6a713243002c492ae4f51707ba8849cbeb87fa146
MD5 f649a7b698b28a195bb5156c0a53f175
BLAKE2b-256 47883c6a046955f6c4d63eeff70672be45769d38270799fe42af821290b22a1f

See more details on using hashes here.

Supported by

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