Quick BLE control tile for the LED Lights made by Lotus Lantern, built by reverse engineering the original mobile application.
To run this project on your own device, you will need Android Studio installed on your computer to compile the application, and a text editor to update the hardware configuration.
Clone this repository and open it using Android Studio.
Since Bluetooth MAC addresses are unique to each physical hardware device, you must replace the hardcoded placeholder with your own LED controller's MAC address.
- To find the own MAC Address of your device firt you must open the app and tap on the top left menu button. That will display your "Home" and below it the list of devices that are connected to it. (Like shown below)

Grab the set of numbers below the desired device.
-
Open
app/src/main/java/com/fishwarrior06/ledtoggle/LedTileService.ktusing Android Studio or any text editor. -
Locate the
DEVICE_MACconstant inside thecompanion object:private const val DEVICE_MAC = "XX:XX:XX:XX:XX:XX" // <-- Replace with your BLE device MAC address, e.g., "1A:2B:3C:4D:5E:6F"
The application is currently hardcoded to output a specific orange color that i use on my LEDs. If you want to change this to Red, Blue, Yellow, or any other color, you need to modify the payload array inside LedTileService.kt.
- Locate the Color Command
Find the
commandColorbyte array inside thecompanion object:private val commandColor = byteArrayOf(0x7E, 0x07, 0x05, 0x03, 0xFF.toByte(), 0x28, 0x00, 0x00, 0xEF.toByte())
- Protocol Color Mapping The hex positions 0xFF (Red), 0x28 (Green), and 0x00 (Blue) represent the RGB channels of the light.
Red Channel (Position 4): 0xFF (Decimal 255)
Green Channel (Position 5): 0x28 (Decimal 40)
Blue Channel (Position 6): 0x00 (Decimal 0)
- Using AI to Generate the RGB values you have in your App Since hex conversion in Kotlin arrays requires specific formatting (like adding .toByte() for values above 0x7F), the fastest way to customize your color is by asking an AI.
You can copy and paste the following prompt into ChatGPT or Gemini to get your exact byte array:
"I have this Kotlin byte array for an orange BLE LED strip: byteArrayOf(0x7E, 0x07, 0x05, 0x03, 0xFF.toByte(), 0x28, 0x00, 0x00, 0xEF.toByte()). The RGB values are at positions 4, 5, and 6. Please generate a new byteArrayOf for a [INSERT YOUR COLOR HERE, e.g., Solid Blue or Bright Yellow], making sure to apply .toByte() to any hex values above 0x7F."
Simply replace the commandColor line with the output generated by the AI, recompile the app in Android Studio, and your tile will instantly update the hardware to your new color scheme.