MagicHome LED strip controller - seurat-atreides/Sonoff-Tasmota GitHub Wiki

MagicHome LED controllers (aka Flux-Led, aka Arilux AL-LC01)

Board is essentially a ESP-12S (or ESP-2M) with necessary voltage converters, little bit of flash, 3 or 4 MOSFETs to drive LED strip (depending on the model), connector for LED strip and optional IR receiver.

Module is powered by 12V that is used to power LED strip as well. RGB models are declared as 144W, RGBW models as 192W.

Module comes in (at least) 3 variants:

  • LC01: RGB,
  • LC02: RGBW and
  • LC03: RGB with IR receiver.
  • LC04: RGBW with IR receiver.
  • LC05: RGB with Screw-Headers.
  • LC06: RGBW/WW with Screw-Headers

A different version of this controller with an ESP8285 is documented here

Serial Connection

Board has RX, TX, GND and GPIO00 pads exposed on the bottom side of the PCB. You need to solder temporary wires those pads.

You need to power the board while keeping it connected to the programmer.

With all Sonoff boards that work with AC, this is a big no-no that will fry your programmer, your Sonoff and might even get you killed. In this case, you'd be dealing with 12V, so the only thing that matters is to connect the GND of your programmer to GND of the board before you supply the 12V. Not doing so might fry your board and/or programmer, but would definitely not hurt you.

Steps used:

  1. Connect your programmer to a breadboard and notice the locations of GND, TX and RX columns.
  2. Open the MagicHome controller box and expose bottom side of PCB
  3. Solder 4 jumper wires to 4 exposed pads.
  4. FIRST connect GND to your programmer (and make sure they are connected well!)
  5. Connect RX from the MagicHome to TX on the programmer. TX from the board goes to RX on the programmer.
  6. Connect GPIO00 to GND (best to use same column on the breadboard)
  7. Connect the 12V power supply to MagicHome. As GPIO00 is connected to GND, board will go into flash mode. Disconnect GPIO00 after few seconds.
  8. Upload Sonoff-Tasmota like it would be any other board.
  9. Once upload is complete, disconnect power from the MagicHome controller
  10. Disconnect RX and TX and then only then GND. GND gets disconnected LAST.

You can then connect the power back to the board and Sonoff-Tasmota should be running on it. Once you verify that board is up and you can access it over the Web, you can unsolder temporary wires and update subsequent firmware versions using OTA.

Configuration

Some GPIO are preconfigured with the board:

  • GPIO05 - (PWM2) Green color on the led strip, first pin from the GND
  • GPIO14 - (PWM1) Red color on the LED strip, second pin from the GND
  • GPIO12 - (PWM3) Blue color on the LED strip, third pin from the GND

For instructions to setup the 24 Button Remote visit the AL-LC04 device page

Check this for Board Version 2.3 : #1867

Due to variants, you can configure:

  • GPIO04 - on non-IR boards, it's an open pin you can use for Onewire, button or something else. It might have pull-down resistor and/or bypass capacitor, so please take that into consideration. On IR-enabled boards, IR receiver is connected to this pin, so you can use IRRecv as functionality.
  • GPIO13 - This pin is not used on RGB board (so you'll leave it as "None"), but on RGBW, it's driving another channel (cold white or warm white) for LED strip.

Variant without Rx/Tx pads:

-

Using the IRrecv (IR Remote) feature

If you have a variant with an IR Remote (as per the opening picture), you can use the new rule command to make the remote buttons change the light levels. For example, this rule allows me to turn it on and off, change the brightness, and turn it on to full white:

mosquitto_pub -t 'cmnd/light/rule1' -m 'on IrReceived#Data=0xFFF807 do power OFF endon on IrReceived#Data=0xFFB04F do WAKEUP endon on IrReceived#Data=0xFF906F do dimmer + endon on IrReceived#Data=0xFFB847 do dimmer - endon on IrReceived#Data=0xFFA857 do color #000000ff endon'

Full Set of rules for IR remote

Each rule can only be 511 characters long, some of the colors below use the built in predefined shortcut color numbers.

mosquitto_pub -t 'cmnd/light/rule1' -m 'on IrReceived#Data=0xFFF807 do power OFF endon on IrReceived#Data=0xFFB04F do WAKEUP endon on IrReceived#Data=0xFF906F do dimmer + endon on IrReceived#Data=0xFFB847 do dimmer - endon on IrReceived#Data=0xFFA857 do color 12 endon on IrReceived#Data=0xFF9867 do color 1 endon on IrReceived#Data=0xFFD827 do color 2 endon on IrReceived#Data=0xFF8877 do color 3 endon on IrReceived#Data=0xFF28D7 do color  #007FFF endon  on IrReceived#Data=0xFF38C7 do color 4 endon'

mosquitto_pub -t 'cmnd/light/rule2' -m 'on IrReceived#Data=0xFFE817 do color #FF3F00 endon on IrReceived#Data=0xFF48B7 do color #00FF3F endon on IrReceived#Data=0xFF6897 do color #3F00FF endon on IrReceived#Data=0xFF02FD do color 4 endon on IrReceived#Data=0xFF32CD do color #00FFBF endon on IrReceived#Data=0xFF20DF do color #7F00FF endon on IrReceived#Data=0xFF50AF do color #FF7F00 endon on IrReceived#Data=0xFF7887 do color #00BFFF endon on IrReceived#Data=0xFF708F do color #FF00FF endon on IrReceived#Data=0xFFF00F do color #FF003F endon'

mosquitto_pub -t 'cmnd/light/rule3' -m 'on IrReceived#Data=0xFF00FF do scheme 4 endon on IrReceived#Data=0xFF58A7 do scheme 3 endon on IrReceived#Data=0xFF30CF do scheme 2 endon on IrReceived#Data=0xFFB24D do backlog BlinkCount 600; Power 3 endon'

After setting the rules you need to activate them with the following:

mosquitto_pub -t 'cmnd/light/rule1' -m '1'
mosquitto_pub -t 'cmnd/light/rule2' -m '1'
mosquitto_pub -t 'cmnd/light/rule3' -m '1'

The hex codes for the "Data" value come from the data tag when looking at the JSON sent via MQTT. You can also view this data on the Tasmota console screen. From here you can program it to do what ever you want. See here for more details: https://github.com/arendst/Sonoff-Tasmota/wiki/Rules

MagicHome with ESP8285

Yet another MagicHome RGB controller

Aside from it going 9-28v, there are no other external model numbers etc, however opening it up revealed a very different configuration inside, using an ESP8285 chip directly on the board.

(Right click and view the original image to see the full size image for all images below)

Identifying this board

Looking closely you can see it's an ESP8285, on the main board, it has the part number: ZJ-WFMN-B V1.1

Flashing

I found that on the back it has pads to solder to so you can flash it.

The IO0 port is GPIO0 that needs to be pulled to ground when powered on for flashing (as per all ESP devices). I soldered cables to each of these. Note that some are very close to other pads, so be careful. If you want to avoid soldering, also pogo pins work well with the pads.

Configuration

Once flashed, I configured it as follows (using Tasmota v6.1.1):

ZJ-WFMN-B V1.1

Field Value
Module type 18 Generic
D1 GPIO5 38 PWM2
D6 GPIO12 39 PWM3
D7 GPIO13 40 PWM4
D5 GPIO14 37 PWM1

ZJ-WFMN-A V1.1

Field Value Function
Module type 18 Generic Module type
D2 GPIO4 51 IRRecv IR Remote (optional, view console for debugging!)
D1 GPIO5 38 PWM2 BLUE
D6 GPIO12 37 PWM1 RED
D7 GPIO13 39 PWM3 GREEN
D8 GPIO15 40 PWM4 WHITE

ZJ-WFMN-A V1.1(RGB version)

Field Value Function
Module type 18 Generic Module type
D1 GPIO5 38 PWM1 RED
D6 GPIO12 37 PWM2 GREEN
D7 GPIO13 39 PWM3 BLUE

With all that done, one of the critical things I needed to do so I could set the colors was to run the command to set SetOption15 to 1. For me, this was sending the MQTT command (you will need to adjust for your config):

mosquitto_pub -t 'cmnd/rgbled/SetOption15' -m '1'

Once the above was done and the device rebooted, I could set the colors using commands such as (to turn on red and white full):

mosquitto_pub -h openhab.sf -t 'cmnd/rgbled/color' -m '#ff0000ff'

RF control

If you have the RF variant, you will want to configure the GPIOs like this:

  { "MagicHome RF",    // Magic Home RF (ESP8266) - (Arilux LC10)
     GPIO_USER,        // GPIO00 Optional Button
     GPIO_USER,        // GPIO01 Serial RXD and Optional sensor
     GPIO_LED1_INV,    // GPIO02 Blue onboard LED (optional)
     GPIO_USER,        // GPIO03 Serial TXD and Optional sensor0
     GPIO_ARIRFRCV,    // GPIO04 RF receiver input 
     GPIO_PWM2,        // GPIO05 RGB LED Green
     0, 0, 0, 0, 0, 0, // Flash connection
     GPIO_PWM3,        // GPIO12 RGB LED Blue
     GPIO_PWM4,        // GPIO13 RGBW LED White
     GPIO_PWM1,        // GPIO14 RGB LED Red
     GPIO_LED2_INV,    // GPIO15 RF receiver control
     0, 0
  },

After choosing the correct module type in your Tasmota configuration, press a key on the remote after boot for the device to learn your code.