Control LED Strips that use the 'MagicStrip' iOS/Android and 'Zengge' Android app.
Two different protocols/devices are supported:
- Tested with a Bluetooth device named 'HTZM', but should work also with 'JMC-A', 'JMC-B', 'MAGIC_SHOE', 'MAGIC_LAMP', 'LCF', 'CoolStripMic', 'CRGB', 'FS0001' and 'FS0002' devices.
- Devices starting with the Bluetooth device name 'LEDnetWF'.
See example/example.html for usage.
See https://the-sz.com/products/bluetooth_led_strip/ for a real life demo.
Just include the script:
<script type="module"
src="https://cdn.jsdelivr.net/gh/the-sz/BluetoothLedStrip/dist/BluetoothLedStrip.js">
</script>
And call the few functions.
device = new BluetoothLedStrip.Device();
device.connect(onConnect, onDisconnect, onError);
This will open the Bluetooth dialog in the browser.
device.setRGB(red, green, blue);
Set LEDs to the given value. Each parameter can be between 0 and 255.
device.setBrightness(brightness);
Set the overall brightness between 0 and 255 for MagicStrip or 0 and 100 for LEDnetWF.
device.setSwitch(value);
Toggle on/off. The parameter value
seems to be ignored by the 'MagicStrip' device.
device.setMode(mode);
Show a specifc animation. mode
can be between 0 and 40 (MagicStrip) or 1 and 113 (LEDnetWF).
device.setSpeed(speed);
Set the animation speed between 0 (fastest) and 255 (slowest) for MagicStrip or 0 (slowest) and 100 (fastest) for LEDnetWF.
GNU General Public License v3.0
https://github.com/8none1/zengge_lednetwf did the protocol reverse engineering on the LEDnetWF protocol.