Skip to main content

Yongnuo

yn360-ble

CI PyPI Python License: MIT

Control Yongnuo YN360 / YN360 III Pro LED lights over Bluetooth LE from Python — power, brightness, RGB colour, and white colour temperature.

This library powers the Yongnuo YN360 Home Assistant integration, but works standalone in any async Python project (or straight from the command line).

Features

  • 🔌 Async BLE control built on bleak — works on Linux, macOS, and Windows.
  • 💡 On / off
  • 🔆 Brightness (0.0–1.0)
  • 🎨 RGB colour
  • 🌡️ White colour temperature — 3200 K (warm) to 5500 K (cool), the light's bi-colour range.
  • 🔍 Discovery helperdiscover() finds nearby YN360 lights.
  • 🖥️ CLIyn360 scan / rgb / white / off for quick testing.

Requirements

  • Python 3.11 or newer.
  • A Bluetooth LE adapter (built-in or USB).
  • A Yongnuo YN360 III Pro (other YN360 models using the same BLE protocol may also work).

Installation

pip install yn360-ble

CLI usage

yn360 scan                                  # find nearby lights
yn360 rgb   AA:BB:CC:DD:EE:FF 255 153 0     # set an RGB colour
yn360 white AA:BB:CC:DD:EE:FF 4500          # set a white colour temperature (K)
yn360 white AA:BB:CC:DD:EE:FF 4500 --channel 3   # ...on group channel 3
yn360 off   AA:BB:CC:DD:EE:FF               # turn off

Library usage

import asyncio
from yn360 import YN360Light, discover

async def main():
    devices = await discover()
    light = YN360Light(devices[0])
    await light.set_rgb(255, 153, 0)             # orange
    await light.set_white(4500, brightness=0.8)  # warm-ish white at 80%
    await light.turn_off()
    await light.disconnect()

asyncio.run(main())

YN360Light also accepts a bleak BLEDevice (e.g. from Home Assistant's shared scanner or an ESPHome Bluetooth proxy), not only a string address.

Supplying your own connection

Pass client_factory to have the light use a connection you built, instead of opening its own. Home Assistant uses this to route through bleak_retry_connector.establish_connection, which manages the adapter's connection slots and caches GATT services:

from bleak import BleakClient
from bleak_retry_connector import establish_connection

light = YN360Light(
    ble_device,
    client_factory=lambda: establish_connection(BleakClient, ble_device, address),
)

The factory must return an already connected client.

Group channels

White commands carry a channel byte, so one command can address a group:

await light.set_white(4500, brightness=0.8, channel=3)

Channels 1–8 are documented for the YN360-II. On the III Pro only channel 1 is confirmed to work — see HARDWARE.md.

How it works

The light speaks a 6-byte BLE command frame [0xAE, CMD, V1, V2, V3, 0x56] written to a single GATT characteristic:

Command CMD V1 V2 V3
RGB 0xA1 R G B
White 0xAA channel (1–8) cool 5500 K (0–100) warm 3200 K (0–100)
Off 0xA3 0x00 0x00 0x00
Standby 0xEE channel (1–8) cool (0–100) warm (0–100)
  • Service UUID: f000aa60-0451-4000-b000-000000000000
  • Write characteristic: f000aa61-0451-4000-b000-000000000000
  • Notify characteristic: f000aa63-0451-4000-b000-000000000000

0xEE is documented elsewhere as an off that keeps the current values loaded; it is not verified on the III Pro.

Commands are sent as acknowledged writes (response=True); the YN360 III Pro silently drops write-without-response packets. See HARDWARE.md for the full reverse-engineering notes.

Limitations

  • The light has no state feedback over Bluetooth — it only receives commands. A notify characteristic exists and start_notify() will subscribe to it, but the III Pro was verified to send nothing at all, not even when its physical knobs are turned. There is also no battery service to read.
  • Bluetooth LE allows one client at a time — close the official Yongnuo app while controlling the light.
  • RGB and white are mutually exclusive modes; setting one switches the active mode.

Contributing

See CONTRIBUTING.md.

License

MIT © Hudson Brendon

Download files

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

Source Distribution

yn360_ble-0.2.0.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

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

yn360_ble-0.2.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file yn360_ble-0.2.0.tar.gz.

File metadata

  • Download URL: yn360_ble-0.2.0.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for yn360_ble-0.2.0.tar.gz
Algorithm Hash digest
SHA256 101af56569c31f9bfa4fb3f0f4db5d1ddec3f3d235f73614f84745ab0a5f3edd
MD5 39b0dc401ffb14316fddb4acdf99012e
BLAKE2b-256 8b903f87cb630e14cb1589899353f02fa61e89c255bd56b32b3e10874cd7bea2

See more details on using hashes here.

Provenance

The following attestation bundles were made for yn360_ble-0.2.0.tar.gz:

Publisher: publish.yml on hudsonbrendon/yn360-ble

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yn360_ble-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: yn360_ble-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for yn360_ble-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e292089963963138d97c040ca20c027a55f9bd6ffecb4e2b4ce5dc19e4c72100
MD5 a41340aa71f7a6b8f8f093dfdde1570b
BLAKE2b-256 75321ddf95e16ee4dcb5713baf900d2b63ced2869ca437885cd11f3fbc22b061

See more details on using hashes here.

Provenance

The following attestation bundles were made for yn360_ble-0.2.0-py3-none-any.whl:

Publisher: publish.yml on hudsonbrendon/yn360-ble

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page