arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.06k stars 4.78k forks source link

Add support for SM2135 as used in Action LSC SmartLed #6495

Closed arendst closed 5 years ago

arendst commented 5 years ago

Extend Tasmota with support for SM2135 five channel intelligent dimmer led with constant current driver interfaced using I2C as used in Action LSC Smart Leds (https://www.action.com/nl-nl/p/lsc-smart-connect-slimme-multicolor-ledlamp-2/)

SM2135E_zh-CN_en-US_translated.pdf

See https://www.mikrocontroller.net/topic/479796#5950544 for background info.

Jason2866 commented 4 years ago

No, because the firmware has to be <500k for initial flash with Tuya Convert. @andrethomas did a special Tuya build. Download from here http://thehackbox.org/tasmota/020300/sonoff-tuya.bin You can upgrade if the needed support is not in this build. Before doing this do a reset 5 After you have done you do the upgrade via file or OTA

WaaZaa666 commented 4 years ago

Thanks @Jason2866, I kinda missed the <500k part. Anyhow, I was able to flash eventually.

For reference of others:

Now you can control the white in web UI, color needs to be done via console. Connect as any other MQTT device to your setup.

@TimelessNL , would you have happened to make some progress with the brightness on the RGB part? It seems to be less bright compared to stock fw. Is this configurable as a custom parameter as well in tasmocompiler?

TimelessNL commented 4 years ago

Please don't take my comment in any negative way, but please keep the discussion about work done on the SM2135 and not about 'tuya-convert' or ' general how to compile tasmota' stuff. The wiki should be sufficient for those questions.

Unfortunately I don't have direct access to a thermal camera from work this week. Probably next week because then my personal unit arrives. So it will take a little longer to get exact measurements of the LEDs and SM2135. I'm currently testing it with a laser temperature gun but this measurement is quite imprecise.

arendst commented 4 years ago

I'v compared the intensity visually between a tuys standard bulb and the Tasmotized one.

I see no real difference but the tasmotized one may seem a bit more faint. The Warm and Cold whites look the same to me.

If you want to experiment with the intensities just change line 54 in file xlgt_04_sm2135.ino while keeping an eye (and a hand) on the temperature.

TimelessNL commented 4 years ago

I did notice that the white and yellow intensities are not identical. 50% yellow does produce allot more light than 50% white. It's also funny to see when they are both on at the same time they produce less light than when only one of them is on. Don't know it this is also with the original tuya firmware though.

arendst commented 4 years ago

The total value of yellow and white is 255. So if yellow is 255, white should/must be 0 and the other way round. The code makes sure that any mixture of yellow/white will always be at most 255.

This is normal practice for mixing colors as you do not want the total lumen/lux to change. It also makes sure the chip does not get overheated as documented in the datasheet.

I think instead of measuring temperature it makes more sense to measure lumen/lux. Once it looks fine to the eye it won't make sense to compare with tuya as it probably ends up in a lot of additional code just to mimic the tuya colors, which by the way are not that correct either.

draeseke commented 4 years ago

First off - THANK YOU ALL SO MUCH! I've been beating my head against a wall for months on these:

https://www.amazon.com/gp/product/B07HG199VX/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Got one working today. I had 8, and destroyed 2 trying to figure them out. Can't tell you how many hours I spent on this.

It appears to be a four channel RGB + WW light. Right now, the color channels are mixed up, but I couldn't care less because it's actually working. I'm sure there's a way to remap the colors.

If there is any info at all you need, let me know. I have the original Tuya firmware.

mainframecn commented 4 years ago

Thanks for adding support of these leds. I've flashed a few now for fun,. 2 of 5 have some weird issue (all same firmware and settings except the (host)name.) It seems like these "faulty" ones have some random default data in the driver after a power-cut (switch). Like they don't retain the power - and color settings. You'd have to cycle all color/light settings to calibrate the light.

redahb commented 4 years ago

The LSC GU10 bulbs seem to be quite nice with their lighting options. However, as mentioned, the RGB is very dim. To be honest it's also quite dim with the original LSC firmware. I've taken measurements with my FLIR camera and the bulb isn't getting hot at all switching to full Red, Green, or Blue compared to having full brightness with the CW or WW LEDs. So I think there's room for improvement with regards to the RGB currents.

I know we're not supposed to ask general compilation stuff but here I go anyway:

I've followed the guide at https://github.com/arendst/Sonoff-Tasmota/wiki/Beginner-Guide---Create-your-own-Firmware-Build and am just wondering what exactly I need to change (besides the xlgt_04_sm2135.ino) to build a 'generic' firmware. I mean, the userconfig thing has a bunch of settings for WiFi and MQTT and such, is this really necessary to fill in if I already have tasmota running on the bulbs? Basically I just want to play with the SM2135**MA values, flash, and put my FLIR and LX meter on it to see if we can make this bulb behave better than it did from the factory.

I'd love to have PM'd someone about a simple question like this but alas GH doesn't have that option.

ascillato commented 4 years ago

I'd love to have PM'd someone about a simple question like this but alas GH doesn't have that option.

@redahb

For support you have the Tasmota Support Chat

maffemuis commented 4 years ago

I updated to 6.6.0.20 and did {"NAME":"LSC RGBCW LED","GPIO":[0,0,0,0,0,0,0,0,181,0,180,0,0],"FLAG":0,"BASE":18} But dont see it to controll my e14 light its not seeing 181 and 180 they are empty screenshotje

andrethomas commented 4 years ago

Usually, if the pin names do not appear in the dropdown then the binary does not include support for it.

arendst commented 4 years ago

See releasenotes which binary supports your sm2135.

Jason2866 commented 4 years ago

Solved at Discord. He used Sonoff-Basic. After upgrading to sonoff.bin it works as expected....

redahb commented 4 years ago

So I've done some measurements and comparisons with the original LSC firmware and the Tasmota build. I've measured temperature and light output for each channel in the same condition for each bulb.

Output (in lux): LSC: WW 4350, CW 5050, R 72, G 154, B 225 TAS: WW 3050, CW 3480, R 64, G 125, B 205

Temp (in Celcius) after 10 minutes: LSC: WW 51, CW 56, R 34, G 32, B 31 TAS: WW 42, CW 48, R 34, G 32, B 31

Temp (in Celcius) after 20 minutes: LSC: WW 60, CW 62, R 34, G 33, B 33 TAS: WW 49, CW 52, R 34, G 33, B 33

Temp (in Celcius) after 30 minutes: LSC: WW 63, CW 56, R 34, G 33, B 33 TAS: WW 51, CW 53, R 34, G 34, B 33

The Warm White and Cold White have less heat but also less light output so I'm guessing the mA can be upped a bit.

Regarding the RGB values they are the same on both firmwares, however looking at the temperature I guess the mA can be upped as well, making the bulb perform 'better' with Tasmota compared to the original firmware.

arendst commented 4 years ago

@redahb thx.

To increase current you might want to change line 54 in file xlgt_04_sm2135.ino from

const uint8_t SM2135_CURRENT = (SM2135_20MA << 4) | SM2135_10MA;

in

const uint8_t SM2135_CURRENT = (SM2135_25MA << 4) | SM2135_15MA;

and redo your measurements.

Pls report back if the results compare better.

redahb commented 4 years ago

New results:

I upped the CW/WW tot 15mA and this brought the WW to 4300lx and CW to 5000lx, which is pretty much spot on with the original firmware. So my guess is 15mA would be the optimal 'same-as-factory' setting. Personally I like the lesser temperature with 10mA (10 degrees is quite a lot) because in my house GU10 bulbs are rarely lighting a room by themselves (it's always a cluster of 2 or more) so I don't need the full brightness. I'll leave the decision up to you ;)

RGB is a different story. As stated before, the RGB values from Tasmota vs LSC firmware are a tad bit dimmer but not by much. If you didn't have a lux meter you wouldn't notice. Having said that, I've bumped up the mA in increments up to 40 mA but didn't know if I should push further. What I'm noticing is:

Conclusion: Basically with 40mA Red overshoots, Green isn't performing like the original firmware yet, and Blue is sort of on par. I would have expected a much bigger difference in brightness but to the naked eye I can barely see difference between 20mA and 40mA. With CW/WW, I can see a difference by only a 5mA increase.

As it stands, both with LSC firmware and Tasmota firmware the RGB colors are pretty weak compared to other bulbs. That's disappointing, but as I'm not knowledgeable about the SM2135 chip at all, I have no idea if we should and can push the RGB channels further. Temperature probably isn't the only limit I guess? And do we want this bulb to behave 'better' on Tasmota or do we want to copy the factory specifications?

Again, decision up to you ;)

arendst commented 4 years ago

Thx again!

I'll up the CW/WW to 15mA and leave the RGB as they are saving power while no real difference in lux.

alex200580 commented 4 years ago

Hello, i have here an E27 model with Tuya TYWE3L Wifi module. It is an RGBW lamp with 11W. (See Google: SKU-2752) According to Tuya there is the ESP8266 installed. As with the GU10 and E14 variant of LSP here is an SM2135E installed, but the GPIO assignment does not match. Has anyone found out the right assignment? Greeting, Alex

Knol010 commented 4 years ago

I have 2 LSC GU10 spots and flashed them with Tasmota. I have a connection, can upgrade the firmware but can't turn turn the lights on or off.

This is my setting. {"NAME":"LSC RGBCW LED","GPIO":[0,0,0,0,0,0,0,0,181,0,180,0,0],"FLAG":0,"BASE":18}

One light worked but stopped working after a power cycle. I can still reach them with wifi (Tasmota)

wolfpins commented 4 years ago

Same here only the e14 rgb bulb

TimelessNL commented 4 years ago

Did you include support for the sm2135? I may not be compiled in and therefore wont work.

wolfpins commented 4 years ago

Thanks , i saw the sm2135 but have not figured out how to flash it to the bulb or where to put it

TimelessNL commented 4 years ago

What you mean? The .bin has support for the sm2135 chip or it doesn't. There is no separate file you have to flash.

ascillato commented 4 years ago

@wolfpins

Please, address this to the Tasmota Support Chat. The chat is a better and more dynamic channel for helping you. Github issues are meant for Tasmota Software Bug Reporting.

Please check the Contributing Guideline and Policy and the Support Guide.

Thanks.


Support Information

See Wiki for more information. See FAQ for common questions/answers and links if none of your question is in the list See Chat for more user experience. See Community for forum. See Code of Conduct