Thanks. That does appear to be an identical chip. It’s very weird. I can’t figure out if my lights are particularly picky, or if they’re running a different firmware, or what else could be going on.
@aronsky is working with me over on github but nothing I do seems to make a difference. It works from my phone, and doesn’t from the ESP32
Depends how noob is noob. Before I came across this I hadn’t had any reason to set up ESPHome in HA. I’ve played with ESP boards for various things before but if you haven’t this is pretty daunting.
Prerequisites:
Home assistant installed
ESPHome addon installed
some form of ESP32-based development board (I’m using a nodeMCU ESP32S)
a USB lead to connect the ESP dev board to a computer
Chrome/Edge browser (supports USB device interactions)
There might be some driver stuff you need too so that your computer can talk over USB serial to the device. Sorry, can’t remember. This page might help
Steps
Open ESPHome from Home Assistant on a computer
Plug in your ESP USB device
Click “New device”
Give it a name
Click “Connect”
Select the port (here it’s /dev/ttyUSB0)
Wait a while (and it is a while especially the first time) for the ESPHome firmware to build in the background, then upload to your device. If this step doesn’t work, you may need to check out the link above for pointers
Once you’ve got a device installed, it should appear as “online” in the ESPHome dashboard
Click “Install” - you should be able to install wirelessly if your ESP board is online
Once it’s installed, go to Settings → Devices and Integrations
Add the newly-discovered ESPHome device (if not appearing, add the ESPHome integration)
Put your board near the light you want to control
Open Developer Tools → Services in Home Assistant
Search for ‘pair’ to find the pairing service
Put your light in pairing mode (here that’s switch it off, then on again)
Click “Call service” (within 5 seconds of powering on)
Hopefully, that’s your light paired!
You can now toggle your light on and off and set brightness and temperature using Home Assistant
I do appreciate the irony that I’m writing this all out, having failed to get it working myself, but I don’t think that’s because of anything I’ve written above. My lights just seem to be uncooperative.
Yeah, I’m currently waiting for the builders to get out of the way later this week so I can sit directly under the offending light for 30 minutes and do some proper testing!
Hey guys, quick and simple question (I hope) - what if my base codes are different for my lamp ?
How can I easily alter the code from Aronsky and pass it to ESPHome - without publishing a new repo on Github and linking ESP to it ?
Currently I use HA with a RPi3, how would I go about it to make an integration that would use the internal bluetooth of the RPi? As I have no prior experience with ESP and would like to avoid any extra cables.
I tried sniffing out the commands via HCI on android to be able to send out these command via a RPi to the controller provided with the light, however the commands were really not readable. Anyone any luck with using the RPi combined with the included controller?
Basically, you have to figure out how to send BLE advertisement packets in Home Assistant. Once you can do that, all it should take is go through the code of my component, see how the packets are built, and send similar packets from Home Assistant.
Thanks all for the help, especially aronsky for the repository and jymbob for the tutorial.
I got my ESP up and running and the logs are working.
However, I am unable to pair with my lights (after turning off and on and pairing within 5 seconds). I looked into the logs within ESPHome in Home assistant and get the following when running the service:
[00:01:54][D][lampsmartpro:146]: LampSmartProLight::on_pair called!
[00:01:55][W][component:204]: Component api took a long time for an operation (1.00 s).
[00:01:55][W][component:205]: Components should block for at most 20-30ms.
I’m using the NodeMCU-32S board and the LampSmartPro app is working perfectly fine. A different light than previously mentioned in topic is used. @jymbob , I followed your tutorial, but saw you were having a simillar issue as I have. Did you manage to solve the issue?
Not yet. We’re in the middle of building works so I haven’t had a huge amount of time to fiddle with this. That should be finishing in the next week or so, so I might be able to get back to it then.
Hi everyone, thanks for the awesome work @aronsky, and for the really helpful noob guide, @jymbob!
It helped me thus far, and after figuring out that my ESP32 was not installing because my USB cable was a power cable and not a data cable, I finally got the ESP online!