BRMesh control via ESPHome binding

Hi all,

I wanted to share a modification of a modification that will allow me to control RGBW from lights that use the BRMesh app.

I have a ton of RGB bulbs and use the Wiz binding for 25+ bulbs as well as another 40 for Tuya local control. Now i am integrating RGBW lights that use the BRMesh app from amazon or aliexpress.

This is done via the ESP Home binding and using some modified code from some great folks in the Home Assistant community who got this working.

BrMesh topic on HA

I know enough to be dangerous and got the ESPHome flashed from the GIT repository here with a little help from chatgpt to help me modify the code to allow Openhab to call the White channel through a bit of a hack as the White channel is not exposed.

I modified the code where if the HSB is 0,0,XXX it will send the white channel activation. Otherwise it will use the standard RGB layout.

Editing the fastcon_light.cpp with chatgpt gave me this option

 // Determine if it's a "white-only" command
bool is_white_only = false;

// Extract RGB values (0.0 – 1.0)
float r = values.get_red();
float g = values.get_green();
float b = values.get_blue();

// If explicitly WHITE mode OR RGB equal → treat as white
if (values.get_color_mode() == light::ColorMode::WHITE ||
    (fabs(r - g) < 0.001f && fabs(g - b) < 0.001f)) {
  is_white_only = true;
}

Now i have a Bluetooth mesh network of 2 and hopefully many more.

There are some disadvantages here… its one way only communication. I dont know if BRmesh can be queried for status. Also it works well but you need to space out commands. The payload works very similair to the tuya scene payload.

Just wanted to share.. i learned a lot and if anyone else is interested please take a look and see what you can contribute to this project.

1 Like