Add Ledvance Smart+ BT Bluetooth

Good news! I got the Ledvance Bluetooth bulbs integrated into Homeassistant on a Raspberry Pi with a modified version of GitHub - dominikberse/homeassistant-bluetooth-mesh: Allows to use bluetooth mesh devices directly from homeassistant.

Long story short, I had to switch back to the older BlueZ Version 5.55 from the Debian Bullseye package repository. I also had to make a few other small changes to make it work more reliably (e.g. lights did not work after restarting the Docker container). The working version with my changes is also on GitHub: GitHub - olipink/homeassistant-bluetooth-mesh: Allows to use bluetooth mesh devices directly from homeassistant

From there on, it was basically just following the steps in the setup instructions. I.e. clone repository, build and run the Docker container, docker compose exec <container_name> /bin/bash into the docker container, and then provision the devices:

  1. python3 gateway.py scan
  2. Create entry in the config.yaml.
  3. python3 gateway.py prov --uuid <uuid> add
  4. python3 gateway.py prov --uuid <uuid> config
  5. python3 gateway.py or restart the container

Further notes:

  • To make sure that the bulb runs the right firmware, I’d recommend to first pair it in the Ledvance Bluetooth app, then remove/reset it
  • Make sure you are using a recent Linux kernel version (check with uname -a). I am using the 6.10 kernel from the latest Raspberry Pi OS release. I did not get it to work with Kernel 5.10.
  • In some cases, provisioning failed with a bad-pdu message. This is returned for all sorts of different errors. In some cases, it helps to add --reload to the provision commands, e.g. python3 gateway.py --reload prov --uuid <uuid> add
  • Apart from BlueZ 5.55 from the package sources, I also tested versions 5.58 and 5.62 and got it to work. For 5.62, I had to add --reload to the provision commands.
  • If you are having trouble and want to rule out hardware or configuration issues, you might want to try provisioning with meshctl and/or mesh-cfgclient first. In case of the latter, you will have to build it from source. The version from the package repository will get you stuck with a “Failed to generate UUID array” error when trying to provision: BlueZ seems to be very picky about the device UUIDs, and the UUIDs of the Ledvance SMART+ bulbs are apparently not considered valid. Remove all occurrences of || !l_uuid_is_valid(uuid) from mesh-cfgclient.c and it will work.