Alternative firmware for Arilux AL-LC03 for use with MQTT and Home Assistant (RGB light strip controller)

The only thing I can suggest is either have another person hold the pins while you work the computer (or vice versa) or make sure that you aren’t moving at all during the whole process.

hey again robbie, so this is what I meant:

it’s discovered automatically and all user changes are registered (correct color, brightness, white) but the bulb icon remains black and you can’t turn of the led lights from hass frontend. I’ve tried a few combinations but always the same result. If there is something I can do let me know, if not I’ll leave it for now.

Problems!

After flashing which went all without errors, my AL-LC08 - No Controller, RGBWW is flashing red all the time and HASS doesn’t control it no rgb color picker nothing just flashing red.

How can I reach the firmware setttings, esp8266, no serial feedback just flashing red???

Connected to my router that he is…

telnet erro :::: ERROR: MQTT message publish failed, either connection lost, or message too large

and after a while-

Username: xx
Password: xxxxx
Broker: <ip>
ERROR: Sending the MQTT subscribe failed for topic: RGBWW/0099532A/json/set

I use an ip for my broker no name is that a problem

I tried that :frowning:

I have now tried from another computer. I think I am going to try using another FTDI next and then try some soldering if that fails. I am getting this error from windows

Arduino: 1.8.1 (Windows 8.1), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 1M (64K SPIFFS), ck, Disabled, All"

Sketch uses 253511 bytes (26%) of program storage space. Maximum is 958448 bytes.
Global variables use 35396 bytes (43%) of dynamic memory, leaving 46524 bytes for local variables. Maximum is 81920 bytes.
warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

Step further but stil not working:

Cyan when startup - then 4 times green flash and then nothing:

My Mosquitto does see the lights messages this is what it says!

1489588369: New connection from 192.168.0.33 on port 1883.
1489588369: New client connected from 192.168.0.33 as ARILUX0099532A (c1, k15, u'pi').
1489588369: Sending CONNACK to ARILUX0099532A (0, 0)
1489588369: Received PUBLISH from ARILUX0099532A (d0, q0, r1, m0, 'RGBWW/0099532A/status', ... (5 bytes))
1489588369: Received PUBLISH from ARILUX0099532A (d0, q0, r1, m0, 'homeassistant/light/ARILUX_LC0X_RGBWW_0099532A/config', ... (255 bytes))
1489588369: Received SUBSCRIBE from ARILUX0099532A
1489588369:     RGBWW/0099532A/json/set (QoS 0)
1489588369: ARILUX0099532A 0 RGBWW/0099532A/json/set
1489588369: Sending SUBACK to ARILUX0099532A

My Yaml config!

-   platform: mqtt
    name: 'ARILUX0099532A'
    state_topic: 'rgbww/0099532A/state/state'
    command_topic: 'rgbww/0099532A/state/set'
    brightness_state_topic: 'rgbww/0099532A/brightness/state'
    brightness_command_topic: 'rgbww/0099532A/brightness/set'
    rgb_state_topic: 'rgbww/0099532A/color/state'
    rgb_command_topic: 'rgbww/0099532A/color/set'
    qos: 0
    payload_on: "ON"
    payload_off: "OFF"
    optimistic: false

but no control over the light and the switch returns to off when set to on after a sec, but nothing is running, where do I go wrong!

Is this a dead topic or no support?

Mosquitto message:

RGBWW/0099532A/status alive
homeassistant/light/ARILUX_LC0X_RGBWW_0099532A/config {"name":"Arilux LC0X RGBWW LED Controller 0099532A","platform":"mqtt_json","state_topic":"RGBWW/0099532A/json/state","command_topic":"RGBWW/0099532A/json/set","brightness":true,"rgb":true,"white_value":true}
RGBWW/0099532A/json/state {"state":"OFF","brightness":85,"white_value":255}

But no control from hass, whatever I try, please I think/know that there is someone dreaming this and can tell me howto transcribe this into a YAML light control.

If you enable discovery in your Home Assistant configuration you don’t need to do anything in YAML. Just add discovery: true to your mqtt configuration in Home Assistant and restart. Your device will automatically be detected.

More info.

I found I had the tx and rx around the wrong way :sweat:

The upload now seems to work correctly but hangs near the end. Have you see anything like this?

Sketch uses 251171 bytes (26%) of program storage space. Maximum is 958448 bytes.
Global variables use 34288 bytes (41%) of dynamic memory, leaving 47632 bytes for local variables. Maximum is 81920 bytes.
Uploading 255312 bytes from /tmp/arduino_build_324176/Arilux_AL-LC0X.ino.bin to flash at 0x00000000
................................................................................ [ 32% ]
................................................................................ [ 64% ]
................................................................................ [ 96% ]
..........                                                                       [ 100% ]

1 Like

Robbiet480, auto discovery didn’t work, the error was light component not a valid…, and when I read about discovery in HASS it says only for boolean operators, so I did put it in my configuration.yaml but it only gave an error.

But even with the output from MMosquitto I was unable to get it going all parameters are there but I’m too thick i guess, and needed help to translate it into a working mqtt snippet for in my light.yaml.

Anyway thanks for replying.

It’s working for me. Light MQTT discovery is only supported as of Home Assistant 0.40.

That’s standard behavior. You’ll notice that the UI now says “Done uploading”.

Hey if your still stuck, try switching the TX and RX wires, you may have them around the wrong way like I did.

1 Like

Thanks again :slight_smile: It doesnt seem to be connecting to my wifi. I am going to double check my ssid and password.

One last thing. I cant compile the firmware if I set:

#define RGB

I have to use

#define RGBW

I am not sure if this could be causing problems when it tries to boot the firmware as my controller doesnt have a White channel. There appears to be a pin missing/not used


update

It seems to be working. Anyone else else having issues flashing these in let me know and I might be able to help :slight_smile:

Does anyone have yaml examples for controlling lights via MQTT?

This is what I was looking for!
I’m ordering some controllers to try this. However I can’t decide on controller/light strips. I’ve always thought that
RGBW = RGB + cold white / RGBWW = RGB + warm white.

However looking at AL-LC02 (RGBW) I see it has 5 pins, whereas AL-LC08 (RGBWW) has 6 pins.

What am I missing?

Firstly - thanks very much for this @robbiet480 - really nice work :slight_smile:
My AL-LC02 and RGBW lightstrip arrived the other day, and I’ve flashed the new firmware and got it working in hass with auto-discovery/JSON.

However - I seem to be having the same problem as @lv-88 in that I’m unable to turn the lights off properly from hass. Did anyone get to the bottom of this problem, and if not - is there any further information I can provide / testing I can do to help resolve it?

Thanks!

1 Like

Another slightly odd behaviour i’m seeing is that every time i power the AL-LC02 off/on - hass is autodetecting it as another instance - so I end up with multiple copies of the light eg :

entity_id=light.arilux_lc02_rgbw_led_controller_0013a840
entity_id=light.arilux_lc02_rgbw_led_controller_0013a840_2
entity_id=light.arilux_lc02_rgbw_led_controller_0013a840_3
etc etc

not sure if this is anything to do with your code, or a problem with the MQTT auto-discovery code in HASS?

Did you find the solution to this issue? I have re-flashed my controller to enable JSON and now have exactly the same issue you have described.

Hey! Not for this firmware, however what I did end up flashing AND that works flawlessly for me is:

It’s also linked from the hass documented if I remember correctly, everything works nicely, turning on/off, having transitions/fade etc. Only difference for me is that this one doesn’t have automatic discovery, but I personally don’t need it.

edit: I basically added the right pins in the sketch and made some personal tweaks, other than that not much is needed to get it working as is.

Thanks for the info. I will give go!

What do you set for the pins as I assume they will be the same for all the RGB Arilux controllers:

// Pins
#define CONFIG_PIN_RED 0
#define CONFIG_PIN_GREEN 2
#define CONFIG_PIN_BLUE 3

For my arilux lc02 I used red: 5 green: 14 blue: 12
Obviously I can’t use white (rgbw) since it’s not in the sketch, but I don’t use it anyhow so rgb is perfect at the moment, maybe I’ll try and incorporate it in the future.

But you can find all the different pins for the different controllers in this file: