First off, glad that light control is working for you. As for fan control, it shouldn’t be too difficult - but I currently don’t have free time to do it, and furthermore - I don’t have a fan to test the changes on. If you’re comfortable with coding, I can point you in the direction of what’s needed to control fans.
So, here is the native code inside the Android app that’s responsible for generating the BLE packets (it’s taken as-is from Ghidra, so mind you - it shouldn’t compile, and might be imperfect otherwise): Java.com.alllink.encodelib.Tool.c · GitHub
And this is the Java code from the app that calls the native code - this can give you some insight into what the different values should be (again - taken straight from jadx-gui decompiler, so not necessarily a valid piece of code): FanLampPro.java · GitHub
You can look at the code in my repo and see how it’s implementing the commands blevbBinding and blevbDimming - you’d need to add similar code to implement fan-related commands (and generate a fan entity in home assistant, in addition to the existing light entity).
Greetings Lev,
and compliments for your nice work.
Unfortunately Lampsmart Pro isn’t the most widespread app for ceiling lamps and fans.
Chinese shops like Temu sell ceiling lamps with fans too that use apps like fanlampro.apk and primarily zhishan.apk. Could you consider reverse-engineering these apps too? Obviously I would be able and willing to provide you with everything you need.
Hi! I have same issues( so I cant pairing my lamp(
[19:32:37][D][lampsmartpro:146]: LampSmartProLight::on_pair called!
[19:32:38][W][component:204]: Component api took a long time for an operation (1.00 s).
[19:32:38][W][component:205]: Components should block for at most 20-30ms.
My HA died and I had to reformat and set up everything again which means, I lost all my HA backups too. Interestingly the paired lamps on the ESP32 device is safe and still paired, by I no longer have access to the ESP32 device from HA. Is there any way I can restore the connection, pulling data from the device?
So i finally got started with it and i got to point 9 where i am stuck at the moment.
I see the ESP home in devices and services. Also i see that it has 1 device. When i open the device i see that it has no entities.
In the point 9 i am supposed to click on edit to open config.yaml. The problem is that i see no edit button and i cant find the config.yaml. Where exactly should i look? Do you maybe mean the file configuration.yaml which sits in the config directory?
Hi,
I’m also unable to pair my light. Want to make sure we are talking about the same kind of devices here.
The light i have is a Neona ourea. Bought it without knowing it is smart. Actually I looked for specs to replace the LED driver by one with Zigbee. While search for the numbers on the driver I found out the there is an app. The one if the green icon shown the image in post 2. When searching for the name only there are different ones. Is that the app you are using as well?
@aronsky I guess you wrote the C++ code in the repo, right?
I never wrote any low level networking code and definitely no bluetooth, but it guess it’s not that easy to reverse engineer the protocol from wireshark logs because of the withening here. I do see something similar to what @jymbob described. But I don’t have an angle to verify that all these constants are the same for my light. Looking at the package structure it looks a bit suspicious that your command codes are one byte only while here it says 16bit. Is that an issue of the decompilation?
It should be possible, but would require developing everything from scratch. If anyone wants to do it, they are welcome to use the info about the protocol in my repo.
got everything to work perfectly i just added the reversed: true, the only thing that I would’ve wanted is to control it directly from the BLE on my home assistant network, thanks so much for this
I was not able to pair my lights, so I thought maybe I can get me a nrf52840 dongle and try to sniff out the connection.
I got it setup with wireshark and I can see packets comming in. However I don’t see my lamp or the phone in the device list.
I tried many times to listen to the channels, sending commands through the phone (iphone) and also through the remote, but no luck catching any packets commanding the lamp.
Could it be that I need to do some decrypting or do I need to listen to the pairing first for some reason?