BRmesh app bluetooth lights

Heroic - Thank You - Going to try this out over the weekend :slight_smile:

David and all who have helped before on this thankyou! have managed to get my lights talking to HA and can finally ditch the extra BR-mesh app. They re RGBW downlights Have managed to get them working with the RGB side of things well but cant get the 2700K white channel to turn back on if i change the colour on the RGB wheel or colour temp slider. i have to reattach them the BR-mesh to reset to white colour and then home assistant can toggle the white channel on and off. tried to dig into the RGBW code in your code David but was above my skill level to get it working

Cheers for all the help

Hi David, I have been playing with your code a bunch but still struggling to get the RGBW to work properly sorry to hassle you but any ideas on what i could try am very much a newb to all this but keen to learn. Also, any ideas on how to adjust the code so the ESP retains a connection to the lights after a power cycle without having to put the lights back in paring mode would be most helpful
Thanks in advance

1 Like

Hello,

I know this is old but when i upload this code to my esp32, it crashes with a bad heap head.

From what i understand, after the line

pAdvertising->start();

I think its here that the heap is going.
Thanks

Hey,

I fixed this by downgrading my ESP32 Firmware to 2.0.1 from Espressif.

Hello and thank you all for this excellent addon to HA!
I have some Melpo flood lights and am trying to get your code (specifically dsclee1 - Davidā€™s) flashed to an ESP32, but did notice in your code that there was nowhere to enter the MQTT broker user and pass. Since yours is based off of millskyleā€™s work where he has these variables added I was wondering if you had any advice on this. I am looking forward to getting this working :slight_smile:

Thank you again for your work!

Hello again!

I opted to try Millskyleā€™s code and obtained my key using ADB, altered the number of lights and passwords etc. got all the dependencies and went to compile but am getting this for line 395:

Compilation error: cannot convert ā€˜std::stringā€™ {aka ā€˜std::__cxx11::basic_stringā€™} to ā€˜Stringā€™

Any advice would be much appreciated!

Sorry for the noob question but this is all new to me :slight_smile:
Thank you in advance!

1 Like

Same error for me when using Millskyleā€™s code.

I am a PlatformIO noob so Davidā€™s instructions are greek to me. Any help for someone who hasnā€™t done any of this for several years? lol

I have the mqtt broker and all that configured. created a user in HA and (I think) configured the broker correctlyā€¦ maybe Iā€™m doing all of this out of order, I donā€™t know. Iā€™ve gotten a bluetooth proxy working but that wonā€™t control any BRMesh stuff, just my ember mug. Would be great to do both from one chip.

Anherrera! Thank you for replying as it at least confirms I am not the only one getting the same error and/or I am not hallucinating LOL
In the meantime, I have discovered the lights have memory of their last setting when the power is cut, so I simply have a SONOFF switch now on the wire run to turn them on and off with the sun and still use the app to change the colours when needed.
Hopefully someone with some experience in compiling this type of code has an answer :slight_smile:

1 Like

I switched back to trying to use Davidā€™s BRmesh-esp32-mqtt - and I got it to work finally by adding back the MQTT username and password constants as in Millskyleā€™s code then going down to the very bottom and changing

mqtt->begin(MQTT_BROKER_ADDR, 1883);

to

mqtt->begin(MQTT_BROKER_ADDR, 1883, MQTT_BROKER_USER, MQTT_BROKER_PASS);

this is after I had created the ā€˜userā€™ in HA itself with the username/password I want. mqtt addon will automatically let that user in. just call the user whatever as long as itā€™s not admin or homeassistant or addon. I called it mosquito.

in platformIO, basically, build and then upload. then have the light nearby where you or someone else can unplug and plug back in. once youā€™ve finished uploading and have serial console open go ahead and unplug the board and the light. then plug board back in and while the light is blue plug the light back in.

you can see whether the client connected successfully in the add-on logs. itā€™ll say something like this:

2024-09-29 16:15:49: New client connected from 10.0.0.197:63601 as <random_stuff> (p2, c1, k15, u'<USERNAME>').

and then Iā€™ve found that using GitHub - thomasnordquist/MQTT-Explorer: An all-round MQTT client that provides a structured topic overview is incredibly helpful.

Good luck!!! I didnā€™t have to do anything special in PlatformIO (VSCode add on, anyway) to get the project to upload.

1 Like