Page 4 of 6

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Thursday 27 October 2016 7:31
by ledfreak3d
Hi you mean the rgbw plugin yes i can make you a bin file but you can also just compile it in the arduino ide

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Thursday 27 October 2016 20:38
by deennoo
Even wolph made a script to use it with original fw to !

Easy to set, fast to drive solution.

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Tuesday 01 November 2016 16:54
by Reley
Somehow, I am not able to flash it via an Arduino...

I keep getting the following error...

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

According to the leds, it trys to do something, but I get the error...

Any tips?

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Tuesday 01 November 2016 17:14
by wolph
Try lowering the baud rate, whenever I get that error it's usually due to a baud rate that's too high or not enough power to the chip.

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Tuesday 01 November 2016 19:52
by Reley
Unfortunately that does not change anything...
Even with 12v connected to the normal ports, no change...
I leave J3 connected... connected tx > rx and vice versa.. still no luck

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Tuesday 01 November 2016 20:40
by MadBanana
Hi

My H801 has TX & RX transposed so I need to connect TX to TX and RX to RX. Do you get any out our on the serial monitor when you reset the device without the flash jumper shorted?

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Wednesday 02 November 2016 9:40
by Reley
I have tried it again today with a Linux (Debian) machine.. exactly the same error...
I have tried several baud settings...
I have played with the tx/rx wires

I am lost... :p

Now waiting for a USB/FTDI adapter... maybe that will help..

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Thursday 03 November 2016 22:28
by ledfreak3d
flashing the h801 is not a big problem
but cant get the white side to work
does it need something to be modified ?

rgb works great

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Friday 04 November 2016 7:59
by MadBanana
Hi ledfreak3d

Which port on the H801 are you using? Mine works fine on W2.

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Friday 04 November 2016 10:32
by ledfreak3d
have leds connected to all ports but for some reason white never works tried mapping it to other pins but same problem

is there a change needed to a script to get the milight plugin working correctly ?
rgb works fine

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Friday 04 November 2016 15:06
by Reley
ledfreak3d, how did you flash it?

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Friday 04 November 2016 15:40
by ledfreak3d
the normal way arduino ide
that's the only way you can get the milight plugin in there
plugin works fine rgb is working but none of the white are

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Saturday 05 November 2016 16:43
by MadBanana
ledfreak3d - just checked mine with Domoticz and the same as you, white doesn't work. I'd only previously used it by sending this ..

http://192.168.1.92/control?cmd=PWMFADE,3,500,5 - which lights the strip white, attached to W2

Not sure what to do in Domoticz though, RGB on the wheel works fine.

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Sunday 06 November 2016 21:12
by Derik
mmm Orded a H801...
Perhaps someone have a good how to?
Youtube or something else?

Or are there perhaps other boards that can control RGBW strips?

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Monday 07 November 2016 8:38
by ledfreak3d
the h801 works pretty good for all sorts of things and its cheap
the only weird thing with the h801 is that the programming ports it not connected to serial 0
one of the lines I think its rx but not 100% sure is connected to serial 1

so ive modded mine
else in some cases it wont talk back after programming

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Monday 07 November 2016 8:47
by deennoo
MadBanana wrote:ledfreak3d - just checked mine with Domoticz and the same as you, white doesn't work. I'd only previously used it by sending this ..

http://192.168.1.92/control?cmd=PWMFADE,3,500,5 - which lights the strip white, attached to W2

Not sure what to do in Domoticz though, RGB on the wheel works fine.
below my way to drive W1 & W2

First create a dummy LightWave RF dimmer
espeasy dimmer.PNG
espeasy dimmer.PNG (59.07 KiB) Viewed 6067 times
second made a script_device_w1.lua script, or use LUA editor on Domoticz (don't forget to save as de device one)

Code: Select all

commandArray = {}
DomDevice = 'PWM_W1_LED_H801_ESPEASYFW'; --your dymmy LightWave RF Dimmer
IP = '192.168.0.196'; --change for your h801 ip
PIN = "4"; -- for w1 pin
if devicechanged[DomDevice] then
   if(devicechanged[DomDevice]=='Off') then 
     DomValue = 0;
   else
     DomValue = otherdevices_svalues[DomDevice];   
   CalcValue = (DomValue-1) * 33;
   end
   if CalcValue==nil then CalcValue=0 end
   runcommand = "curl 'http://" .. IP .. "/control?cmd=PWM,"  ..PIN.. "," .. CalcValue .. "'";
   os.execute(runcommand);
   print("PWM value= "..CalcValue);
end
return commandArray
Et Voila, that not my creation, source can be found on this thread, and on controlit website.

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Monday 07 November 2016 22:38
by MadBanana
Thank you Deennoo, that's worked for me!

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Monday 07 November 2016 23:06
by DarkFoxDK
deennoo wrote:
MadBanana wrote:ledfreak3d

Code: Select all

...
   runcommand = "curl 'http://" .. IP .. "/control?cmd=PWM,"  ..PIN.. "," .. CalcValue .. "'";
...
How does os.execute curl compare to the OpenURL command in speed?
Edit: Should've just tested it. It's much faster. Script below updated.


This is my current script for driving my ESPEasy lights, including a way to simulate white on RGB-only strips. It also uses a curve to get higher resolution at the lower end, where the brightness changes are more noticeable.

Code: Select all

local lights = {
  ['Stuereol Spots'] = {ip = '192.168.33.61', pin = '14', rgb = false},
  ['Stuereol Skab'] = {ip = '192.168.33.61', pin = '4', rgb = false},
  ['Vitrineskab'] = {ip = '192.168.33.62', pin = '13', rgb = false},
  ['Kontorreol'] = {ip = '192.168.33.64', pin = '13', rgb = false},
  ['Skrivebord'] = {ip = '192.168.33.67', pin = '14', rgb = false},
  ['Sengelys'] = {ip = '192.168.33.66', pin = '14', rgb = false},
  ['Kontorhylde W'] = {ip = '192.168.33.67', red = '15', grn = '13', blu = '12', rgb = true},
  ['Stuereol W'] = {ip = '192.168.33.61', red = '15', grn = '13', blu = '12', rgb = true},
  ['Seng W'] = {ip = '192.168.33.66', red = '15', grn = '13', blu = '12', rgb = true}
}

function setlight (ip, pin, dvalue)
    os.execute("curl 'http://" .. ip.. "/control?cmd=PWM,".. pin .."," .. tostring(dvalue) .. ",128'")
end

commandArray = {}

for deviceName,deviceValue in pairs(devicechanged) do
    if (lights[deviceName]) then
        if (deviceValue == 'Off') then
            dvalue = 0
        elseif (deviceValue == 'On') then
            dvalue = 1024
        else
            inputValue = tonumber(otherdevices_svalues[deviceName])
            
            curve = 1.5848931924611
            normalizedCurVal  =  (inputValue - 1.0) / 99.0
            rangedValue =  (math.pow(normalizedCurVal, curve) * 1023.0) + 1.0
            
            dvalue = math.ceil(rangedValue)
        end
    
        if (lights[deviceName]['rgb']) then
            setlight(lights[deviceName]["ip"], lights[deviceName]["red"], dvalue)
            setlight(lights[deviceName]["ip"], lights[deviceName]["grn"], dvalue)
            setlight(lights[deviceName]["ip"], lights[deviceName]["blu"], dvalue)
        else
            setlight(lights[deviceName]["ip"], lights[deviceName]["pin"], dvalue)
        end
    end
end
return commandArray
2nd edit: Cleaned up the code a bit.

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Tuesday 08 November 2016 17:38
by cherowley
I was going to add code to the espeasy plugin to emulate a white milight device so wouldn't have to use scripts/user vars etc.

BUT found the milight hardware device in domoticz is very strange - changing the device mode from rgb to rgbw to white etc incorrectly creates new devices but the main problem is simply creating a milight hardware device and changing its mode to white results in a dimmer that doesn't work (doesn't send udp packets)! You have to change the mode to rgbw and rgb then back to white first?! Even then depending on the sequence it may end up sending different udp packets as the slider is adjusted. Also, only 32 steps for the milight dimmer...

Shame as it would have meant I could have got rid of my script to handle the white channel and also the uservar to work around the on "feature" of not sending the level...

commandArray = {};
IP = '192.168.2.165';
Port = '80';
GPIO = 3; -- r=0,g=1,b=2,w=3
DomDevice = 'Kitchen White Lights'

if devicechanged[DomDevice] then
if(devicechanged[DomDevice]=='Off') then
print("Turning OFF" .. DomDevice)
commandArray['OpenURL']="http://" .. IP .. ":" .. Port .. "/control?cmd=PWMFADE," .. tostring(GPIO) .. ",0,1"
elseif (devicechanged[DomDevice]=='On') then
print("Turning On with value : " .. tostring(uservariables[DomDevice]))
otherdevices_svalues[DomDevice] = tostring(uservariables[DomDevice])
commandArray['OpenURL']="http://" .. IP .. ":" .. Port .. "/control?cmd=PWMFADE," .. tostring(GPIO) .. "," .. tostring(tostring(uservariables[DomDevice]*10+23)) .. ",1"
else
print("Value sent from domoticz is : " .. otherdevices_svalues[DomDevice])
uservariables[DomDevice] = otherdevices_svalues[DomDevice]
commandArray['OpenURL']="http://" .. IP .. ":" .. Port .. "/control?cmd=PWMFADE," .. tostring(GPIO) .. "," .. tostring(tostring(uservariables[DomDevice]*10+23)) .. ",1"
commandArray['Variable:'..DomDevice] = uservariables[DomDevice]
end
end;
return commandArray

Re: [ESP8266] Commercial H801 WiFi RGB-dimmer topic

Posted: Friday 11 November 2016 15:49
by ledfreak3d
I still use quinors lua code for most of my dimmers because it has a realy nice dim function
would be great if that could be implemented for rgb and white control in esp easy under domoticz