H801 Wi-Fi RGBW LED Controller with MQTT (ESP8266)

H801 RGBWW Controller

I picked a couple of these up from Aliexpress earlier in the year, I had been planning to DIY something similar but when I spotted these Aiboo H801 RGBWW units for only £8.35 each there didn’t seem much point.  They support the three RGB channels as well as two white channels, up to 96W per channel and can run on 5 to 24V. ESP8266 controlled with 8Mbit of flash.

Red is on GPIO15
Green is on GPIO13
Blue is on GPIO12
White 1 (W1) is on GPIO14
White 2 (W2) is on GPIO4

There are two on board LEDs, a red one on GPIO5 and a green on GPIO 1.

Connections are via nice plug in screw terminals but something to watch out for, on one of the units I got the sticker labelling the inputs and outputs had been put on the wrong way round.

As usual I wasn’t interested in the default firmware or software as I needed something with MQTT support so I could control it from Node-RED. Opening up the case (just 4 screws) I was pleased to see an unpopulated header for the required connections, even better it was labelled. I soldered a 4 pin header on that and a two pin one on the one marked J3 (GPIO0 and ground for flash programming mode), shorted J3 with a jumper, powered on and tried to flash some code… no go… turns out the RX and TX are labelled backwards according to common convention and you actually need to connect RX to RX and TX to TX on your USB TTL adapter!

Programming, RX & TX are labelled in reverse. J3 needs to be shorted to go in to flash programming mode.

Early on I used this firmware for them but have since switched to TASMOTA which I am now standardising on as much as possible, it’s primarily for the Sonoff range but does have support for the H801 built in as well. It’s a doddle to flash with PlatformIO and then you just connect to the web interface and set the module type to H801.

To control the outputs via MQTT using TASMOTA you would send a payload with a PWM value between 0 and 1023 to an MQTT topic of the format “cmnd/H801/pwmx” where H801 is the name you have given your unit and pwmx corresponds to the below:

pwm1 for W1
pwm2 for W2
pwm3 for Blue
pwm4 for Green
pwm5 for Red

To use standard RGB values just multiply each colour value by 4 and send to the topics for the red, green and blue PWM outputs.

Using Node-RED it is easy to create a flow to make a colour picker. The colour picked node is set to output RGB and the function node is just multiplying each RGB value by 4 and sending to the individual topics for each colour.

Node-RED Flow


Node-RED Colour Picker


Here is the flow to copy and paste into Node-RED:

[{"id":"6d80818b.d00e7","type":"ui_colour_picker","z":"b667b1f1.bf821","name":"","label":"","group":"8f79c3e1.e4c48","format":"rgb","outformat":"object","showSwatch":false,"showPicker":true,"showValue":false,"showAlpha":false,"order":0,"width":"4","height":"2","passthru":true,"topic":"","x":390,"y":2880,"wires":[["2e1c8397.2a398c"]]},{"id":"2e1c8397.2a398c","type":"function","z":"b667b1f1.bf821","name":"","func":"msg1 = {payload: msg.payload.r * 4};\nmsg2 = {payload: msg.payload.g * 4};\nmsg3 = {payload: msg.payload.b * 4};\n\nreturn [msg1,msg2,msg3];","outputs":"3","noerr":0,"x":550,"y":2880,"wires":[["bfefa63b.a461a8"],["613649d7.7c6888"],["536e112c.16c1c"]]},{"id":"bfefa63b.a461a8","type":"mqtt out","z":"b667b1f1.bf821","name":"","topic":"cmnd/ESP_RGB_2/pwm5","qos":"","retain":"","broker":"32a2fac0.cd5d06","x":770,"y":2840,"wires":[]},{"id":"613649d7.7c6888","type":"mqtt out","z":"b667b1f1.bf821","name":"","topic":"cmnd/ESP_RGB_2/pwm4","qos":"","retain":"","broker":"32a2fac0.cd5d06","x":770,"y":2880,"wires":[]},{"id":"536e112c.16c1c","type":"mqtt out","z":"b667b1f1.bf821","name":"","topic":"cmnd/ESP_RGB_2/pwm3","qos":"","retain":"","broker":"32a2fac0.cd5d06","x":770,"y":2920,"wires":[]},{"id":"8f79c3e1.e4c48","type":"ui_group","z":"","name":"H801","tab":"978d3f00.2ffa4","order":1,"disp":true,"width":"6"},{"id":"32a2fac0.cd5d06","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"15","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"978d3f00.2ffa4","type":"ui_tab","z":"","name":"Test","icon":"dashboard","order":4}]

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.