Giter VIP home page Giter VIP logo

arilux_al-lc0x's Introduction

Build Status

Alternative firmware for Arilux LED controllers

THIS REPOSITORY IS NOT MAINTAINED ANYMORE, SEE ESPHome AS AN ALTERNATIVE.

This is an alternative firmware for Arilux LED controllers which uses MQTT instead of the default "Magic Home"/"Flux LED" protocol which has numerous reliability problems. The LED controller is a cheap product available on sites like Banggood.com, Aliexpress, eBay and even Amazon which can be easily reprogrammed as it is based on the popular ESP8266 Wi-Fi chip. The controllers are also known to sell under different manufacturer names such as "Firstd". If the product you bought looks similar to one of the Arilux controllers below, it most likely is.

WARNING: DUE TO A NEW PINOUT, THIS FIRMWARE SEEMS TO BE NOT MORE COMPATIBLE WITH THE NEWEST MODELS (PCB version > 1.4).

ANOTHER FIRMWARE IS AVAILABLE HERE, WHICH WRAPS THE WS2812FX LIBRARY AND OFFERS MANY EFFECTS

Arilux

Features

  • Remote control over the MQTT protocol via individual topics or JSON
    • Supports transitions, flashing and effects in JSON mode
  • Remote control with the included IR control (uncomment #define IR_REMOTE in config.h)
  • Remote control with the included RF control (uncomment #define RF_REMOTE in config.h)
  • TLS support (uncomment #define TLS in config.h and change the fingerprint if not using CloudMQTT)
  • Debug printing over Telnet (uncomment #define DEBUG_TELNET in config.h)
  • ArduinoOTA support for over-the-air firmware updates
  • Native support for Home Assistant, including MQTT discovery

Supported devices

Model Color Support Voltages Remote Price Link
LC01 RGB 5-28V None ~$8 Banggood
LC02 RGBW 9-12V None ~$11 Banggood
LC03 RGB 5-28V IR ~$12 Banggood
LC04 RGBW 9-12V IR ~$13 Banggood
LC08 RGBWW 5-28V None ~$12 Banggood
LC09 RGB 5-28V RF ~$12 Banggood
LC10 RGBW 9-28V RF ~$14 Banggood
LC11 RGBWW 9-28V RF ~$15 Banggood

Demonstration

Arilux AL-LC03 + IR + MQTT + Home Assistant

Flash the firmware

Whichever flashing option you choose, ensure your Arduino IDE settings match the following:

Configuration

You must copy config.example.h to config.h and change settings to match your environment before flashing.

Settings for the Arduino IDE

Parameter Value
Board Generic ESP8266 Module
Flash Mode DIO
Flash Frequency 40 MHz
Upload Using Serial
CPU Frequency 80 MHz
Flash Size 1M (64K SPIFFS)
Reset Method ck
Upload Speed 115200
Port COMX, /dev/ttyUSB0, etc.

Note: If you own a board labeled 1.4 or the board isn't booting, use the DOUT mode instead of the DIO mode to flash the firmware

Option 1

Schematic

Arilux Left FTDI Right FTDI
VCC VCC (set to 3.3V)
RX TX
TX RX
GPIO0 GND
GND GND

Note: To enter in programming mode, you need to pull GPIO0 LOW while powering the board via the FTDI. It's not possible to reprogram the module without soldering the wire to the ESP8266 module. If you are unable or don't know how to solder try option 2 below which can be accomplished without soldering.

The FTDI from the left gives power and it's connected to an USB charger (VCC, GND). The FTDI from the right is connected to the computer and is used to reprogram the ESP8266 (RX, TX, GND).

ESP-12F Layout

Layout

Option 2

Using the following image, connect RX, TX and GND of a single FTDI to the shown pins on the underside of the board. Plug in the wall power supply and flash using the above settings. It helps to have another person able to plug in the device and start the upload while you hold the pins.

Option 2 Layout

Updating

OTA is enabled on this firmware. Assuming the device is plugged in you should find the device as a Port option in the Arduino IDE. Make sure you are using the settings listed above.

Control

IR

The LED controller can be controlled with the IR remote included with the Arilux AL-LC03 and AL-LC04. The Flash, Strobe, Fade and Smooth functionalities are not yet implemented.

RF

The LED controller can be controlled with the RF remote included with the Arilux AL-LC09, AL-LC10 and AL-LC11. The Mode+, Mode-, Speed+, Speed- and toggle functionalities are not yet implemented.

MQTT

Control modes

This firmware can work with MQTT in one of two ways. To cut down on firmware size only one mode can be enabled at a time. Whichever mode is not enabled will not be loaded to the board.

  1. JSON mode. Only one topic will be published and subscribed to (as well as the Last Will and Testament topic). The payload for both will be/is expected to be a JSON object with all properties listed below in it. If a property is missing, the state of that property will change. JSON is great because it reduces roundtrips across the network. For example, if you wanted to turn the light on, set it to full brightness, and make it red, you would have to publish to the state topic, the brightness topic and the color topic. JSON also allows effects and transitions to be specified. No properties are required. You must have the [ArduinoJson] library installed for this to work. If you are have Home Assistant MQTT Discovery enabled, the light.mqtt platform will be loaded by Home Assistant with schema set to json. To enable JSON mode, uncomment #define JSON in config.h.

    JSON properties
    Name Data Type Example Description
    brightness Integer, 0-255 255 The brightness to set to
    color Object/dictionary {} A dictionary with the below RGB values
    color.r Integer, 0-255 255 The red color to set to
    color.g Integer, 0-255 255 The green color to set to
    color.b Integer, 0-255 255 The blue color to set to
    flash Integer, number of seconds to flash 10 If true, light will flash with either colors provided in payload or previously set colors. Integer is number of seconds to flash for.
    state Boolean true The state of the lights, true = on, false = off
    transition Integer, number of seconds to transition 5 If greater than 0, light will transition from old values to new ones for the given number of seconds
    white_value Integer, 0-255 255 Controls the whiteness level of the lights. Only supported for RGBW and RGBWW. Only the first white level is set, there is no support for setting the second white level on RGBWW lights
  2. Individual topics mode. The firmware will publish and subscribe to at least 11 topics and expect specifically formatted payloads for each of them. The full list is below.

    Individual topics
    State
    # Topic Payload
    State rgb(w/ww)/<chipid>/state/state ON/OFF
    Command rgb(w/ww)/<chipid>/state/set ON/OFF
    Brightness
    # Topic Payload
    State rgb(w/ww)/<chipid>/brightness/state 0-255
    Command rgb(w/ww)/<chipid>/brightness/set 0-255
    Color
    # Topic Payload
    State rgb(w/ww)/<chipid>/color/state 0-255,0-255,0-255
    Command rgb(w/ww)/<chipid>/color/set 0-255,0-255,0-255
    White

    White is only supported for RGBW/RGBWW models (LC02, LC04, LC08, LC10, LC11).

    # Topic Payload
    State rgb(w/ww)/<chipid>/white/state 0-255,0-255
    Command rgb(w/ww)/<chipid>/white/set 0-255,0-255

Last Will and Testament

The firmware will publish a MQTT Last Will and Testament at rgb(w/ww)/<chipid>/status. When the device successfully connects it will publish alive to that topic and when it disconnects dead will automatically be published.

Discovery

This firmware supports Home Assistant's MQTT discovery functionality, added in 0.40. This allows for instant setup and use of your device without requiring any manual configuration in Home Assistant. If you are using the MQTT JSON mode, the light.mqtt_json platform will be loaded. Otherwise, the light.mqtt platform will load. light.mqtt_json is required for full functionality. There are a few one time steps that you need to take to get this working.

  1. Install the [ArduinoJson] library.
  2. Add discovery: true to your mqtt configuration in Home Assistant, if it isn't there already.
  3. In your Ardunino libraries folder, find PubSubClient and open PubSubClient.h for editing. Change MQTT_MAX_PACKET_SIZE to 512.
  4. Uncomment the HOME_ASSISTANT_MQTT_DISCOVERY and HOME_ASSISTANT_MQTT_DISCOVERY_PREFIX definitions in your config.h file.
  • You can change the discovery prefix (default is homeassistant) by changing HOME_ASSISTANT_MQTT_DISCOVERY_PREFIX. Make sure this matches your Home Assistant MQTT configuration.
  1. Upload the firmware once more after making the previous changes.

From now on your device will announce itself to Home Assistant with all of the proper configuration information.

Attributes

Installing the [ArduinoJSON] library and uncommenting HOME_ASSISTANT_MQTT_ATTRIBUTES in your config.h will cause device specific attributes to be published. These can be consumed by Home Assistant to improve the display of the light, as well as provide some useful debugging information. The attributes payload looks like this:

{
  "BSSID": "AA:BB:CC:DD:EE:FF",
  "Chip ID": "000AAB12",
  "Hostname": "ARILUX000AAB12",
  "IP Address": "192.168.1.2",
  "LED Strip Type": "RGB",
  "MAC Address": "GG:HH:II:JJ:KK:LL",
  "Model": "LC01",
  "Remote Type": "None",
  "RSSI": -68,
  "SSID": "my-funny-wifi-name",
  "Telnet Logging Enabled": true
}

Configuration for Home Assistant

configuration.yaml

mqtt:
  broker: 'm21.cloudmqtt.com'
  username: '[REDACTED]'
  password: '[REDACTED]'
  port: '[REDACTED]'
  discovery: true

light:
  - platform: mqtt
    name: 'Arilux RGB Led Controller'
    availability_topic: 'rgb(w/ww)/<chipid>/status'
    brightness_command_topic: 'rgb(w/ww)/<chipid>/brightness/set'
    brightness_state_topic: 'rgb(w/ww)/<chipid>/brightness/state'
    command_topic: 'rgb(w/ww)/<chipid>/state/set'
    json_attributes_topic: 'rgb(w/ww)/<chipid>/attributes'
    rgb_command_topic: 'rgb(w/ww)/<chipid>/color/set'
    rgb_state_topic: 'rgb(w/ww)/<chipid>/color/state'
    state_topic: 'rgb(w/ww)/<chipid>/state/state'
    white_value_command_topic: 'rgb(w/ww)/<chipid>/white/set'
    white_value_state_topic: 'rgb(w/ww)/<chipid>/white/state'

Todo

IR remote

  • Flash
  • Strobe
  • Fade
  • Smooth

RF remote

  • Mode+
  • Mode-
  • Speed+
  • Speed-
  • Toggle

Licence

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Home Assistant Community Discussion Forum

For further information and to join the discussion for this firmware check out this thread on the Home Assistant Community Discussion Forum.

Contributors

If you like the content of this repo, please add a star! Thank you!

arilux_al-lc0x's People

Contributors

alexschwantes avatar dangunvald avatar robbiet480 avatar smrtnt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arilux_al-lc0x's Issues

Brightness can't be increased to 255 with remote

Brightness will go to 235 but won't go to 255. It is because of the default step of 25+235>255.

Here is my patched code:

uint8_t Arilux::increaseBrightness(void) {
  if (!m_state)
    return false;
  if ((m_brightness+ARILUX_BRIGHTNESS_STEP) >= ARILUX_PWM_RANGE)
    return setBrightness(ARILUX_PWM_RANGE);  
  if (m_brightness < (ARILUX_PWM_RANGE - ARILUX_BRIGHTNESS_STEP))
    return setBrightness(m_brightness + ARILUX_BRIGHTNESS_STEP);
  return false;
}

on compile IRrecv error

hi,
I installed IRremoteESP8266.h
on compile I am getting the following

Arduino: 1.6.12 (Windows 7), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 1M (64K SPIFFS), ck, Serial, None"

Arilux_AL-LC0X:82: error: 'IRrecv' does not name a type

 IRrecv            irRecv(ARILUX_IR_PIN);

 ^

C:\Users\SSS\Desktop\Arilux_AL-LC0X\Arilux_AL-LC0X.ino: In function 'void handleIRRemote()':

Arilux_AL-LC0X:590: error: 'decode_results' was not declared in this scope

   decode_results  results;

   ^

Arilux_AL-LC0X:590: error: expected ';' before 'results'

   decode_results  results;

                   ^

Arilux_AL-LC0X:592: error: 'irRecv' was not declared in this scope

   if (irRecv.decode(&results)) {

       ^

Arilux_AL-LC0X:592: error: 'results' was not declared in this scope

   if (irRecv.decode(&results)) {

                      ^

C:\Users\SSS\Desktop\Arilux_AL-LC0X\Arilux_AL-LC0X.ino: In function 'void setup()':

Arilux_AL-LC0X:908: error: 'irRecv' was not declared in this scope

   irRecv.enableIRIn();

   ^

exit status 1
'IRrecv' does not name a type

ESP8285

I've ordered a AL-LC03 on bang good. After opening it and trying to identify which pin I've to connect to flash firmware, I've noticed that the wifi chip is not a 8266 but a 8285.

Is there a way to flash a firmware with mqtt feature ?

Unit does not power off with MQTT JSON Command

Even if the unit is off, and you send the {"state":"OFF"} message to RGB/XXXXXXXX/json/set, it results in turning the unit on. Unit can be turned off with IR though. The problem lies in the callback method which always sets the startFade=true.

I have a fix I will create a pull request for. I just did the minimum to fix this, although there are a few too many nested if statements in that method, might be cleaner to rework it a bit.

compile problem IRremote

First of all, thank you for your program.

With IRremoteESP8266 in Version 2.3.2 I get the following errors:

Arilux_AL-LC0X:80: error: 'IRrecv' does not name a type IRrecv irRecv(ARILUX_IR_PIN); ^

And after downgrade to V1.2.0 I get some errors like this:

/Volumes/myData/Documents/Arduino/libraries/IRremoteESP8266-1.2.0/IRKelvinator.cpp: In member function 'void IRKelvinatorAC::setTemp(uint8_t)': /Volumes/myData/Documents/Arduino/libraries/IRremoteESP8266-1.2.0/IRKelvinator.cpp:96:41: error: no matching function for call to 'max(unsigned int, uint8_t&)' temp = max(KELVINATOR_MIN_TEMP, temp); ^

I hope, you can help me
thx

Color not being sent to RGB/XXXXXXXX/json/state

When in JSON mode and changing the state, the color is not being sent.

This is what is being sent
{"state":"OFF","brightness":145,"white_value":0}
and this is what should be sent
{"state":"OFF","brightness":145,"white_value":0,"color":{"r":224,"g":72,"b":90}}

I have a fix for this, but it exposes another bug when transition is set. but will discuss that separately.

What is the problem with 2.0 boards?

I just got a number of LC02 devices, some are 1.4 and some are 2.0. Before I dive in what are the issues with the 2.0 boards not being compatible? Is it just pin mappings or something more fundamental?

Support for AL-LC01

Hi,

I've got an Arilux AL-LC01 controller. Can you please add support for this device as well?

Thank you!

IR remote codes different for LC03

I have the LC03 from Banggood but my IR codes were different to what you had in the code. I changed mine in Arilux.h to:

#ifdef IR_REMOTE
#define ARILUX_IR_CODE_KEY_UP 0xE5CFBD7F
#define ARILUX_IR_CODE_KEY_DOWN 0xA23C94BF
#define ARILUX_IR_CODE_KEY_OFF 0xE721C0DB
#define ARILUX_IR_CODE_KEY_ON 0xF0C41643
#define ARILUX_IR_CODE_KEY_R 0x97483BFB
#define ARILUX_IR_CODE_KEY_G 0x86B0E697
#define ARILUX_IR_CODE_KEY_B 0x9EF4941F
#define ARILUX_IR_CODE_KEY_W 0xA3C8EDDB
#define ARILUX_IR_CODE_KEY_1 0x5BE75E7F
#define ARILUX_IR_CODE_KEY_2 0xF377C5B7
#define ARILUX_IR_CODE_KEY_3 0xC101E57B
#define ARILUX_IR_CODE_KEY_FLASH 0x7EC31EF7
#define ARILUX_IR_CODE_KEY_4 0xD7E84B1B
#define ARILUX_IR_CODE_KEY_5 0xEE4ECCFB
#define ARILUX_IR_CODE_KEY_6 0x51E43D1B
#define ARILUX_IR_CODE_KEY_STROBE 0xFA3F159F
#define ARILUX_IR_CODE_KEY_7 0x2A89195F
#define ARILUX_IR_CODE_KEY_8 0xF63C8657
#define ARILUX_IR_CODE_KEY_9 0x44C407DB
#define ARILUX_IR_CODE_KEY_FADE 0xDC0197DB
#define ARILUX_IR_CODE_KEY_10 0x488F3CBB
#define ARILUX_IR_CODE_KEY_11 0x13549BDF
#define ARILUX_IR_CODE_KEY_12 0x35A9425F
#define ARILUX_IR_CODE_KEY_SMOOTH 0x9716BE3F
#endif

Ws2812 aka Neopixels?

I have a few of these and I'm likely to buy more...
I also have a bunch of esp8266 units of other flavors. Hooking up a WS2812 strip to them is easy enough (and either bit banging or faster ways of pushing pixels have been found, lots of GitHub repos with code) but I'm wondering if they could be made to support ws2812 as well.

From https://www.muzik.ca/2016/11/30/hacked-esp8266-rgb-led-controller/
A 5v source is available at the IR, and there is at least one more data line available it seems.
Neopixels need 5v, ground, and data. Depending on method used, data line can vary... ( I2S Output pin is the same as RX1 (pin 25), and the I2S method is fast... See https://github.com/cnlohr/esp8266ws2812i2s )

Does the above mean that potentially, an Arilux could be wired to drive Neopixels too, at worst needing a breakout of the RX pad combined with the IR cable?? If so, anyone interested in trying this out and seeing if it's worth adding support for this... Essentially making it drive an addressable strip with full mqtt/OTA/etc firmware?

Can't make debugging over telnet working

I need some help with DEBUG_TELNET.

  1. I enabled it in config.h and uploaded the new firmware.
  2. Checked the IP address of the device in my router's DHCP list
  3. Ran nmap on the IP address, it showed port 23 open
  4. Ran telnet 192.168.1.73 from my RPi which showed Connected
  5. Waited for any new message to arrive but nothing showed up
  6. Closed telnet connection and tried it again but this time it got disconnected immeditely by Connection closed by foreign host

So for me it looks like the debugging over telnet isn't really working.
Any help would be great!

Can't make RF Remote work with LC11

Was able to control LC11 with remote before flashing Arilux_AL-LC0X, besides this remote interferes with other RF LED controller, so it sends something.

But no reaction on pressing remote button with Arilux_AL-LC0X. Not even "ERROR: RF code not defined" in debug messages.

Tried to change ARILUX_RF_PIN to 2 and 16 - no luck. Out of troubleshooting ideas. Would appreciate any suggestions.
Does anyone have RF remote working with LC11?

MQTT discovery name gets corrupt

It looks like device name used for MQTT discovery gets corrupt. Here is what I get in the MQTT after some time:

homeassistant/light/ARILUX_LC11_RGBWW_000EDAA8/config {"name":"Arilux LC11 RGBWW LED Controller{\"state\":\"OFF\",\"brightness\":255,\"white_value\":118,\"color\":{\"r\":245,\"g\":3,\"b\":0}}","platform":"mqtt_json","state_topic":"RGBWW/000EDAA8/json/state","command_topic":"RGBWW/000EDAA8/json/set","brightness":true,"rgb":true,"white_value":true}

instead of

homeassistant/light/ARILUX_LC11_RGBWW_000EDAA8/config {"name":"Arilux LC11 RGBWW LED Controller 000EDAA8","platform":"mqtt_json","state_topic":"RGBWW/000EDAA8/json/state","command_topic":"RGBWW/000EDAA8/json/set","brightness":true,"rgb":true,"white_value":true}

IMO the problem is
char friendlyName[32];
as length of "Arilux LC11 RGBWW LED Controller 000EDAA8" is > 32

I simply changed it to
char friendlyName[48];

will see if it fixes the problem.

v1.4 not booting into flash mode

I'm trying to flash a v1.4 board, but I can't get it to boot in flash mode. I have it connected up as follows:

FTDI Board
Rx --> Tx
Tx --> Rx
GND --> GND
GND --> GPIO0

Using ESPtool I'm getting the error: A fatal error occurred: Invalid head of packet ('\x00'), I've also tried with PIO and the recommended settings from the Readme with Arduino IDE with similar results.

[Help] AL-LC01 flashing problems

Hi all,

Not sure what I'm doing wrong but I can't flash this firmware on my LC01 v1.4

  1. I soldered three wires on the back: RX, TX and GND.
  2. I connected the RX (Arilux) to TX (FTDI), TX (Arilux) to RX (FTDI) and GND (Arilux) to GND (FTDI).
  3. Then I connected my FTDI to my PC.
  4. Using a small cable I shorted GPIO0 with GND cable I have soldered on the back
  5. Plugged the power supply into Arilux (the onboard LED didn't blink)
  6. Set the desired configurations in Arduino (DOUT) and hit Upload

But I get this error:

Arduino: 1.8.4 (Windows 7), Board: "Generic ESP8266 Module, Serial, 80 MHz, 40MHz, DOUT, 115200, 1M (64K SPIFFS), ck, Disabled, None"
...
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

If I don't short GPIO0 then the onboard LED blinks once when it starts up. I tried shorting GPIO0 with GND that comes with the power cable also.

Any idea or help would be appreciated!

Wrong state when turning device on with a color command

When the device is off. if you send just a color command via json/mqtt such as follows, it will turn on the light to the specified color but the state that is returned is OFF, instead of ON. The same happens if you use the IR remote...

SET: { 'color': {'r':0, 'g':255, 'b':0}}
STATE: {"state":"OFF","brightness":145,"white_value":0,"color":{"r":0,"g":255,"b":0}}

Further in this state, you can't turn it off. you first have to send an ON command and then an OFF command to turn the device off. This is due to the checking of m_state variable on lines 57 and 60 of arilux.cpp.

Open box

Juste a simple question that I think most of them will laugh at it ... Is there a particular way to open the enclosure of the AL-LC03 ? (Youtube video welcomed ๐Ÿ˜ƒ )

Thank you for your work !

[Feature] Toggle lights with physical switch connected to GPIO

Allow light to be controlled (on/off) from the wall toggle switch for the backwards compatibility with non-geek family members.

Had to do this to meet minimum WAF.

Have simple working code that I wanted to share, but could not push it to new branch in this repo. Is it not allowed or it is my ignorance issue?

Arilux LC-01 flash wired DOUT mode

After getting my hands on an LC-01 from Banggood.com , I attempted to reflash with this firmware following the instructures in the README.md here.

Unfortunately, it seems that on this particular model the low-cost ESP8266 module is used, in which the PN25F08B flash chip is wired in DOUT mode, not DIO mode as referred to in the readme.

Here's some reference to a similar problem with a different branded LED controller
https://www.letscontrolit.com/forum/viewtopic.php?t=3071

[Feature] Add ability to turn on/off with transition

I'd like to request a feature so that when I turn off the device it fades into black with the specified transition duration.

For example:
{ "state": "ON", "transition": 3 } would turn on the lights with a black to color transition of 3 seconds.
{ "state": "OFF", "transition": 1 } would turn on the lights with a color to black transition of 1 second.

Docu incomplete

Under paragraph MQTT. chapter one it states: "For example, if you wanted to turn the light on, set it to full brightness, and make it red, you would have to publish to the state topic, the brightness topic and the color topic. JSON also allows effects and transitions to be specified"

It appears that is not true as I had to publish under the set topic in order to change colours.

Can you pls adapt the docu and give an example also such as:

{"state":"ON","brightness":145,"white_value":0,"color":{"r":224,"g":99,"b":90}}

Thanks

New controller version not working

It appears there are new versions of the LC-01 and LC-02 boards, coming without the metal shield on top of the wifi module.
This firmware doesn't boot on the new version, here is the serial log:

` ets Jan 8 2013,rst cause:1, boot mode:(3,2)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0xef
csum 0xef
csum err
ets_main.c q `

Looking at the serial boot log before and after the flash, I think these are booting in the wrong mode for some reason:

Original firmware: ets Jan 8 2013,rst cause:1, boot mode:(3,7)
After flashing: ets Jan 8 2013,rst cause:1, boot mode:(3,2)

Here you can find some info on boot modes:
digistump/OakCore#45

MTD0 GPIO0 GPIO2 Mode
0 0 0 Remapping
0 0 1 UART boot
0 1 0 Jump boot
0 1 1 Flash boot
1 0 0 SDIO LowSpeed V2 IO
1 0 1 SDIO HighSpeed V1 IO
1 1 0 SDIO LowSpeed V1 IO
1 1 1 SDIO HighSpeed V2 IO

A related discussion:
https://community.smartthings.com/t/release-smartlife-h801-rgbw-led-strip-wifi-controller-bulb/51182/1253

Color State incorrect when fading color (transition is set)

Given the fix for #18 there is now a new bug that is visible where the returned state is incorrect.
When in JSON mode and an MQTT command is sent to change the color the following is observed:

Changing color without transition works fine

SET: { 'color': {'r':0, 'g':255, 'b':0}}
STATE: {"state":"ON","brightness":145,"white_value":0,"color":{"r":0,"g":255,"b":0}}

but when a transition is set, it returns the state of the first step in the fade sequence rather than the actual set color. ie.

SET: { 'color': {'r':255, 'g':0, 'b':0}, 'transition': 4}
STATE: {"state":"ON","brightness":145,"white_value":0,"color":{"r":1,"g":254,"b":0}}

The returned color state is wrong.
This is related a bit to do with the flow of the program and the way the fade changes the m_color variables instead of setting m_color to be the final color and using other variables to handle the fading.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.