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.
  • 📡 Status query — read the light's real white state (follows the physical knobs) and on/standby.
  • 💤 Standby — off that keeps the white values and is reported as off.
  • 🔍 Discovery helper — discover() finds nearby YN360 lights.
  • 🖥️ CLI — yn360 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
yn360 standby AA:BB:CC:DD:EE:FF             # off, reported as standby
yn360 status  AA:BB:CC:DD:EE:FF             # e.g. "on channel=1 cool=52 warm=47"

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)

The light only acts on frames for the channel it is set to (channel 1 by default); frames for other channels are ignored — 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–99) warm 3200 K (0–99)
Off 0xA3 0x00 0x00 0x00
Standby 0xEE channel (1–8) cool (0–99) warm (0–99)
Status query 0x33 0x00 0x00 0x00
  • Service UUID: f000aa60-0451-4000-b000-000000000000
  • Write characteristic: f000aa61-0451-4000-b000-000000000000
  • Notify characteristic: f000aa63-0451-4000-b000-000000000000

0xEE turns the light off (RGB too) and keeps the white values loaded. The status query is answered on the notify characteristic with the white state (0xAA on / 0xEE standby) — RGB output is not reported.

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

  • State feedback covers white mode only: query_status() returns on/standby, channel and the cool/warm levels (including knob changes), but not RGB. Nothing is pushed unprompted — poll it.
  • No built-in effects on the III Pro (the app's effect frames are ignored).
  • 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

Metadata

Release files for yn360-ble 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yn360-ble 0.3.0
File Size Uploaded Provenance Actions
yn360_ble-0.3.0.tar.gz 53.0 kB With provenance Details for yn360_ble-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yn360-ble 0.3.0
File Interpreter ABI Platform Actions
yn360_ble-0.3.0-py3-none-any.whl Python 3 none any Details for yn360_ble-0.3.0-py3-none-any.whl

Total release size: 63.8 kB

Release files / yn360_ble-0.3.0.tar.gz

Download URL yn360_ble-0.3.0.tar.gz
Size 53.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a99f8c19a059e51991e58342c6d2e37e278efe59e54068e9625d6b8cb9cb0300
BLAKE2b-256 checksum
How to use checksums
d6f52d79c634e6403c85953b08b6ed322eec7c4e1c11dc0fdccaa8fe689c251c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Release files / yn360_ble-0.3.0-py3-none-any.whl

Download URL yn360_ble-0.3.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
329320b5fb346a0069156e2fa4dd966391627ce1236947e6a5aa2fd2868d9e8a
BLAKE2b-256 checksum
How to use checksums
d6476df4181ff60339dc5705ced6e9aea938e6044ff1b020dcca1c7c583bd636
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Security for yn360-ble 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for yn360_ble-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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