i´m trying to control rgbww stripes with the H801 rgbww controller from aliexpress: https://www.aliexpress.com/item/H801-Wi ... 79464.html
As i´m really new to espeasy i will use this thread to ask some questions and keep this first post updated to help others building a similar setup.
User Dev0 is developing a very promising plugin to controll rgb lights. Maybe this thread is a little help for him to get feedback and some documentation to get his plugin up and running.
Ok, lets go
1. Install latest Arduino Ide and prepare for esp8266
http://www.letscontrolit.com/wiki/index ... are_Upload
For the h801 i used this settings:
Board: Generic ESP8266 Module
Flash Mode: DIO
Flash Frequency: 40Mhz
CPU Frequency: 80 MHz
Flash Size: 1M (64K SPIFFS)
Upload Speed: 115200
2. build and flash espeasy with ESPEasy-Plugin-Lights
Download espeasy sources from http://www.letscontrolit.com/downloads/ ... 47_RC8.zip and extract
Download ESPEasy-Plugin-Lights and extract https://github.com/ddtlabs/ESPEasy-Plugin-Lights
Kopie _P123_LIGHTS.ino to ESPEasy_R147_RC8\Source\ESPEasy Folder
Open ESPEasy.ino with Arduino and flash to h801 (1 powered the h801 with 12V on the VCC and Ground Connector and just connected gnd, rx and tx to the ftdi programmer. Short the jumper on the h801 on startup to bring it in bootloader mode)
2a Use precompiled Image from Waldmensch
If you don´t want to compile yourself you can just flash the Image from Waldmensch. Thank you for compiling and uploading Waldmensch.
The Image is based on ESPEasy_R147_RC8 with ESPEasy-Plugin-Lights 1.0.4
You can get the image here https://forum.fhem.de/index.php/topic,6 ... #msg566916
But be careful, it seems that some h801 came with only 512kb Flash. This Image is only for Versions with 1024kb Flash size
3. Setup espeasy for first use
After successful flashing the h801 will open an access point called ESP_0
Connect to it and open browser pointed to 192.168.4.1/setup (i used my android cause laptop didn´t open the setup page)
Set your ssid and password and submit. The board will now connect to your wlan
Open Browser and go to the ip shown in last step or use http://devicename where devicename is the name you put in config (default: newdevice)
4. Setup mqtt credentials
under config set
Protocol: Openhab mqtt
locate controller: use hostname
controller hostname: hostname where your mqtt broker (mosquitto) is running
port: 1883
5 Setup ESPEasy-Plugin-Lights Plugin
Go to Devices and hit Edit button on first task
Set with
Device: Lights
Name: PWM
Delay: 0
IDX / Var: 0
Check "Enable RGB Channels"
Red Gpio: 15
Green Gpio: 13
Blue Gpio: 12
If you have a rgbw stripe check "Enable WW Channel"
WW Gpio: 14
WW Color Temp (Kelvin): 2000 //This depends on your leds but 2000 should be fine for warm white
If you have a rgbww stripe also check "Enable CW Channel"
CW Gpio: 4
CW Color Temp (Kelvin): 6000 //This depends on your leds but 6000 should be fine for cold white
6 Manually send mqtt command to test setup
Open putty and connect to your mosquitto server
Send a testcommand:
Code: Select all
mosquitto_pub -t "/newdevice/cmd" -m "lights,rgb,00ff00"
7 Openhab settings
This are the settings for one h801 in openhab:
Sitemap:
Code: Select all
sitemap demo label="Main Menu"
{
Frame label="Bath Light" {
Slider item=Bath_L_level
Slider item=Bath_L_temp
Colorpicker item=Bath_L_RGB icon="slider"
}
}
Code: Select all
Color Bath_L_RGB "Color Select" <slider>
Dimmer Bath_L_level "White Level [%s %%]"
Dimmer Bath_L_temp "White Temperature [%s %%]"
//String gets update in Rule and sends Command to Device Name, e.G. newdevice
String Bath_L_CMD { mqtt=">[mosquitto:/newdevice/cmd:state:*:default]" }
Code: Select all
import org.eclipse.smarthome.core.library.types.HSBType
rule "Bath Light "
when
Item Bath_L_RGB received update
then
var HSBType hsbValue = Bath_L_RGB.state as HSBType
var String redpwmString = Integer::toHexString(hsbValue.red.intValue*255/100)
var String greenpwmString = Integer::toHexString(hsbValue.green.intValue*255/100)
var String bluepwmString = Integer::toHexString(hsbValue.blue.intValue*255/100)
var String rgb_cmd = ("00"+redpwmString).substring(redpwmString.length()) + ("00"+greenpwmString).substring(greenpwmString.length()) + ("00"+bluepwmString).substring(bluepwmString.length());
rgb_cmd = "lights,rgb," + rgb_cmd + ",1"
Bath_L_CMD.postUpdate(rgb_cmd)
end
rule "Bath Light Level"
when
Item Bath_L_level received update
then
Bath_L_CMD.postUpdate("lights,pct," + (Bath_L_level.state as DecimalType).intValue +",1")
end
rule "Bath Light Temperature"
when
Item Bath_L_temp received update
then
Bath_L_CMD.postUpdate("lights,ct," + ( (2000 + (Bath_L_temp.state as DecimalType).intValue * 40)) + ",1") // Sets The Range of Color Temperature (2000 + 0-100 * 40) gives a range from 2000 to 6000. Change this according your led´s color temperatures or leave defaults
end