v1ack / smartLightConnector

App for managing ble smart light
4 stars 1 forks source link
ble python smarthome

Light control app

home assisant integration

There are at least 3 apps with the same light control

Icon Name package
GM Smart Light com.hm.simpleble
Le Smart Light cn.lelight.smart.lzg
Le+ Pro (simple ble mode) com.lelight.pro

If your lamp works with any of the above apps, you can use this app too

Algorithm decompiled from Android app GM Smart Light v0.0.3download link

You need to find Current ID (mode) in app settings and copy it to MAC in app.py

Example:

from ble_light.connector import App
from ble_light.encoder import Commands
from ble_light.connector_bluezero import BluezeroBackend

app = App("D6FFFFFC", BluezeroBackend())
app.send(Commands.turn_on())  # Turn on light
app.send(Commands.turn_off())  # turn off light
app.send(Commands.night())  # night mode
app.send(Commands.all_light())  # all light mode
app.send(Commands.bright(1000))  # brightness 0-1000
app.send(Commands.temp(3000))  # temperature 3000-6400

How does it work?

Lamp accepts commands by listening ble advertisement packets.

Commands must be sent as manufacturer data (0xFF ble type) - two first bytes are manufacturer id and other bytes is command data.

Commands sending twice and then twice as a second message

Message contains from:

Requirements:

Tested with provided Dockerfile on Debian 11 host with blueZ 5.55

Tested with

Tested with IRALAN Lamp aliexpress link