[ESP8266] Commercial H801 WiFi RGB-dimmer topic

Everything about esp8266 and more.

Moderator: leecollings

User avatar
ledfreak3d
Posts: 98
Joined: Sunday 01 November 2015 15:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

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

Post 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
Unleashe the magic smoke ;)
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

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

Post by deennoo »

Even wolph made a script to use it with original fw to !

Easy to set, fast to drive solution.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Reley
Posts: 13
Joined: Wednesday 03 August 2016 8:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Netherlands
Contact:

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

Post 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?
User avatar
wolph
Posts: 16
Joined: Sunday 13 September 2015 16:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
Reley
Posts: 13
Joined: Wednesday 03 August 2016 8:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Netherlands
Contact:

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

Post 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
MadBanana
Posts: 25
Joined: Thursday 13 October 2016 21:45
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Kent, England
Contact:

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

Post 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?
Reley
Posts: 13
Joined: Wednesday 03 August 2016 8:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Netherlands
Contact:

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

Post 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..
User avatar
ledfreak3d
Posts: 98
Joined: Sunday 01 November 2015 15:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

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

Post 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
Unleashe the magic smoke ;)
MadBanana
Posts: 25
Joined: Thursday 13 October 2016 21:45
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Kent, England
Contact:

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

Post by MadBanana »

Hi ledfreak3d

Which port on the H801 are you using? Mine works fine on W2.
User avatar
ledfreak3d
Posts: 98
Joined: Sunday 01 November 2015 15:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

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

Post 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
Unleashe the magic smoke ;)
Reley
Posts: 13
Joined: Wednesday 03 August 2016 8:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Netherlands
Contact:

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

Post by Reley »

ledfreak3d, how did you flash it?
User avatar
ledfreak3d
Posts: 98
Joined: Sunday 01 November 2015 15:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

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

Post 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
Unleashe the magic smoke ;)
MadBanana
Posts: 25
Joined: Thursday 13 October 2016 21:45
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Kent, England
Contact:

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

Post 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.
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

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

Post 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?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
ledfreak3d
Posts: 98
Joined: Sunday 01 November 2015 15:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

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

Post 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
Unleashe the magic smoke ;)
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

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

Post 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 5852 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.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
MadBanana
Posts: 25
Joined: Thursday 13 October 2016 21:45
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Kent, England
Contact:

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

Post by MadBanana »

Thank you Deennoo, that's worked for me!
DarkFoxDK
Posts: 26
Joined: Saturday 02 January 2016 2:22
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

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

Post 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.
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
User avatar
ledfreak3d
Posts: 98
Joined: Sunday 01 November 2015 15:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

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

Post 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
Unleashe the magic smoke ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests