[ESP8266] Commercial H801 WiFi RGB-dimmer topic

Everything about esp8266 and more.
User avatar
ledfreak3d
Posts: 79
Joined: Sunday 01 November 2015 16:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

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

Post by ledfreak3d » Thursday 27 October 2016 7:31

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: 923
Joined: Wednesday 10 December 2014 14:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

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

Post by deennoo » Thursday 27 October 2016 20:38

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 / ESP8266 / MQTT / BLE
http://domo-attitude.fr

Reley
Posts: 11
Joined: Wednesday 03 August 2016 8:25
Target OS: Raspberry Pi
Domoticz version: 3.4834
Location: Netherlands
Contact:

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

Post by Reley » Tuesday 01 November 2016 17:54

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: 18
Joined: Sunday 13 September 2015 16:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by wolph » Tuesday 01 November 2016 18:14

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: 11
Joined: Wednesday 03 August 2016 8:25
Target OS: Raspberry Pi
Domoticz version: 3.4834
Location: Netherlands
Contact:

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

Post by Reley » Tuesday 01 November 2016 20:52

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: 28
Joined: Thursday 13 October 2016 21:45
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Kent, England
Contact:

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

Post by MadBanana » Tuesday 01 November 2016 21:40

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: 11
Joined: Wednesday 03 August 2016 8:25
Target OS: Raspberry Pi
Domoticz version: 3.4834
Location: Netherlands
Contact:

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

Post by Reley » Wednesday 02 November 2016 10:40

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: 79
Joined: Sunday 01 November 2015 16:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

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

Post by ledfreak3d » Thursday 03 November 2016 23:28

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: 28
Joined: Thursday 13 October 2016 21:45
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Kent, England
Contact:

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

Post by MadBanana » Friday 04 November 2016 8:59

Hi ledfreak3d

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

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

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

Post by ledfreak3d » Friday 04 November 2016 11:32

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: 11
Joined: Wednesday 03 August 2016 8:25
Target OS: Raspberry Pi
Domoticz version: 3.4834
Location: Netherlands
Contact:

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

Post by Reley » Friday 04 November 2016 16:06

ledfreak3d, how did you flash it?

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

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

Post by ledfreak3d » Friday 04 November 2016 16:40

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: 28
Joined: Thursday 13 October 2016 21:45
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Kent, England
Contact:

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

Post by MadBanana » Saturday 05 November 2016 17:43

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.

User avatar
Derik
Posts: 2079
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

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

Post by Derik » Sunday 06 November 2016 22:12

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: 79
Joined: Sunday 01 November 2015 16:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

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

Post by ledfreak3d » Monday 07 November 2016 9:38

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: 923
Joined: Wednesday 10 December 2014 14:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

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

Post by deennoo » Monday 07 November 2016 9:47

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 2830 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 / ESP8266 / MQTT / BLE
http://domo-attitude.fr

MadBanana
Posts: 28
Joined: Thursday 13 October 2016 21:45
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Kent, England
Contact:

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

Post by MadBanana » Monday 07 November 2016 23:38

Thank you Deennoo, that's worked for me!

DarkFoxDK
Posts: 30
Joined: Saturday 02 January 2016 3:22
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

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

Post by DarkFoxDK » Tuesday 08 November 2016 0:06

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: 83
Joined: Tuesday 24 February 2015 16:54
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by cherowley » Tuesday 08 November 2016 18:38

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: 79
Joined: Sunday 01 November 2015 16:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

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

Post by ledfreak3d » Friday 11 November 2016 16:49

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: Bing [Bot] and 3 guests