SmartThings Community

[RELEASE] SmartLife (H801) RGBW LED Strip Wifi Controller & Bulb


(Paul Champagne) #899

Never mind, just found it. :confused:

(Daryl) #900

Firmware 2.0.6
Mar21 2017

(Dale C) #901

I don’t know what to say… I am using that version and my WiFi settings are staying intact.

(Eric M) #902

What are the conditions for it losing WiFi settings? Power surge, pulling plug, something else?

Also, do you have a switch attached to J3?

(Timothe Fillion Brunet) #903

I have a small question, I use smart lighting to controls de led. I’m trying to create an environnement where when my mode is on TV, I only light up the leds in my kitchen and living room with the color cyan(for exemple). I cannot find a way to change the color to white when there is motion in the kitchen and after 5min when motion stopped, go back to cyan.
Any idea how I could configure this?


(Dale C) #904

Not sure if Smart Lighting can do what you are asking… however CoRE can.

(Timothe Fillion Brunet) #905

I’ll give a try, thx!

Oh wow, this thing is crazy, you can do anything

(Daryl) #906

I don’t think it is related to any power surge or outage. The only thing i can think of is my wifi is a little sketchy, so maybe it loses its wifi connection for a minute and falls back to the default ESP one?

I do have a switch connected, one i modified to be momentary like in one of the videos. I recently turned off the j3 reset, I’ll see if that helps.

(David) #907

I got a weird result happening with my H801. If I send it a specific color, it doesn’t set that color exactly:

For example if I set it to: #240d0e it sets the color to #200c0c

Why would it do that?

curl -s

{"rgb":"200c0c", "r":"20", "g":"0c", "b":"0c", "w1":"00", "w2":"00", "power":"on", "running":"false", "program":"", "uptime":"6 days and 16:39:43", "version":"2.0.6", "date":"Mar 21 2017 22:35:01"}

I did some more testing, it seems the values are consistently counted in 0x04 increments. So only values 0x04, 0x08, 0x0c, 0x10, etc are available. The values for these are set at 0x04 increments with an off by one error from 0x00. So, 0x00-0x04 = 0x00; 0x05-0x08 = 0x04; 0x09-0x0c = 0x08, 0x0d-0x10 = 0x0c, 0x11-0x14 = 0x10

# curl -s
{"rgb":"00ffff", "r":"00", "g":"ff", "b":"ff", "w1":"00", "w2":"00", "power":"on", "running":"false", "program":"", "uptime":"6 days and 20:52:38", "version":"2.0.6", "date":"Mar 21 2017 22:35:01"}
# curl -s
{"rgb":"00ffff", "r":"00", "g":"ff", "b":"ff", "w1":"00", "w2":"00", "power":"on", "running":"false", "program":"", "uptime":"6 days and 20:52:41", "version":"2.0.6", "date":"Mar 21 2017 22:35:01"}
# curl -s
{"rgb":"00ffff", "r":"00", "g":"ff", "b":"ff", "w1":"00", "w2":"00", "power":"on", "running":"false", "program":"", "uptime":"6 days and 20:52:43", "version":"2.0.6", "date":"Mar 21 2017 22:35:01"}
# curl -s
{"rgb":"00ffff", "r":"00", "g":"ff", "b":"ff", "w1":"00", "w2":"00", "power":"on", "running":"false", "program":"", "uptime":"6 days and 20:52:44", "version":"2.0.6", "date":"Mar 21 2017 22:35:01"}
# curl -s
{"rgb":"04ffff", "r":"04", "g":"ff", "b":"ff", "w1":"00", "w2":"00", "power":"on", "running":"false", "program":"", "uptime":"6 days and 20:52:46", "version":"2.0.6", "date":"Mar 21 2017 22:35:01"}

@erocm1231 what math are you doing to convert the input values to pwm signals? My guess is you are (rightly) converting it to the pwm range for the esp8266 clock of 0-1023 (which if you take 1023/255 you get just a tiny bit over 4) or you have a linear lookup array of values to try and “brightness correct” the rgb values? Is there anyway to have it follow the input and not modify it?

Edit 2:
There is definitely a bug in the math of the firmware. It appears the following is going on to convert RGB-input to RGB-output. If you assume RGB is split and converted the decimal… the following algo would produce what is being seen when going from input to output

If we take just R… where R is R-input and R’ is R-output

R’ = floor(floor(R / (1023/255)) * (1023/255))

It is as if the R is incorrectly converted to RGB from PWM and then converted from this bad PWM to PWM again!

The proper alog should be

R’ = floor((R * (1023/255)) * (255/1023))

Notice the missing internal floor to retain significant digits after the decimal place. Or if in a real world situation like the firmware

int rgb = 8;
float pwm_sig = rgb * (1023.0/255.0);
pwm = (int) pwm_sig;
analogWrite(PIN, pwm)
int rgb_output = (int) (pwm_sig * (255.0/1023.0))

Not knowing how the actual code is setup, this is all conjecture… but the broken algorithm provided would make sense as to being the source of a bug.

(The Viking AKA "Holy Crap You're a Giant!") #908

Does anyone know which pins the H801 uses for which light channel on the ESP unit inside?
I have an RGBW amplifier, and just flashed the firmware to an Adafruit Huzzah Breakout board (It WORKS!).

Since I have hardware on hand already, I’m planning to put it to use to run a couple strings of LEDs for the theater. The amplifier is able to run a large number of LEDs, so I’ll likely just run a bunch of strings in parallel off of it and power the Huzzah with a cell phone adapter.

Edit: I see @C_Hobbs’ post above about performing a manual build on one of these. Pins 6, 7 and 8 for RGB.
Any word on which one is white?

(Eric M) #909

So the conversion is actually simpler than that. Well, I started out with a mathematical conversion, but made an adjustment when I noticed “flickering” when adjusting multiple channels at the same time. Thinking that perhaps the process was too taxing on the esp8266 (a total guess), I changed a method that simply remaps the input from one range to another. There is an array that holds the PWM values (64 of them incrementing by 16). It takes the hex input, converts it to an integer and maps it to one of the values in the array. The problem you are seeing is actually converting the PWM value back to what is reported to the user. Since the original hex value that got mapped to one of the 64 PWM values could actually be 4 possibilities, I did do a math conversion there. Again, this is the value that is reported back to the user and not the value of the PWM. They are generally close enough that nobody cares (I guess except for you :p).

Since it seems the current method doesn’t correct the flickering, I’ll probably change it back to my original method which will report to the user the exact value that was input.

@Synthesis, the GPIOs are
R 15
G 13
B 12
W1 14
W2 4

(David) #910

Thanks for the explination! It makes total sense. As far as the colors are concerned, I can’t really tell the difference visually but the bash script I have sampling data from the device can :slight_smile: I’m using the values of the RGB as a sort of switch for an external program I’m running. It tracks the sun and tells the RGB to mimic sunrise/sunset colors. I check the on/off switch of the H801 and if the switch is on and the color it last thought it sent. Basically it checks if smartthings turned the light off and if it is allowed to turn it back on and change the color.

(Dave) #911

This may have been already answered, and if so, my apologies.

I want to turn on both W1 and W2 using CoRE and a contact switch. I can get the controller to turn on, which is W1 but can’t seem to get W2 to turn on as well. I Looked into creating a program under the particular controller I’m using but didn’t see where I could choose W2.

This may need to go to the CoRE forum, if so, I will remove and ask there.

Thanks for any info.

(Eric M) #912

I’ll have to look into why W1 & W2 wouldn’t work using CoRE. Seems like it should.

As for the programs, if you have the latest version of the SmartApp, Device Handler, and Firmware you should see a W1 & W2 option.

(Dale C) #913

The options are indeed there with the latest updates but I think @suprdave04 is looking to control simultaneously the W1 and W2 together. The current version only allows you to select one OR the other and not BOTH when choosing the “Light Strip Color”. Is it a problem to have multiple choices enabled in the “Light Strip Color?”

@suprdave04 I am posting a screen shot of where the W1 and W2 selections is on the bottom of the Light Strip Color option when configuring Programs actions in one of the six programs the SmartLife RGBW LIght (Connect) app. It sounds like you either have the older version or you are looking in the wrong area?

(Dave) #914

thanks @erocm1231 and @dalec … Looks like I was sporting an older version of the device handler and the smart app… Got them both updated and I see what @dalec sees now.

I’ll wait for some more info from @erocm1231 to see if It’s even possible to have both the W1 and W2 turn on simultaneously using CoRE.

For now, I just have both of my White led strips connected to W1. So it’s an easy workaround…

Thanks again for all the help @erocm1231 and @dalec

(Michael Hess) #915

I do this, the delta (triangle) w1 and delta w2 on and off are what I use to specifically turn individual channels on/off/dim as needed. I have three strips that turn w1 on at once, and one device uses w2 with another sensor, then I have a “master” on switch that turns all the w1’s and the w2 on at the same time. There may be a few hundred milliseconds between them, but it’s nearly instant.

(Eric M) #916

Alright, so I just pushed an update (to the H801 - “SmartLifeRGBWController”) that addresses the issue you saw. I’ll push it out to the other device firmwares when I get a chance. I’ve also added the “Auto Off” feature from the Sonoff. Maybe not as useful on the H801, but it was simple to add.

(Dale C) #917

Auto Off? I didn’t know there was an Auto-Off… :flushed: I have been using SmartLighting to do that.

This is great! I am setting it up now on both the SonOff and one of my H801 is in the garage to give me color indication of events plus control the garage lighting. So having the AutoOff was great. For whatever reason I have intermittent issues with my momentary switch input to J3 on that H801 so AutoOff will help .

UPDATE: Ok I’m not showing any change in my GitHub yet. . . . patience Dale. LOL

(Eric M) #918

I don’t think I’ve added it to the device handler yet, but you can set it up in the web interface for the controller if you update the firmware.