This is a custom component for Home Assistant that allows the control of the Yeelight bedside Lamp via bluetooth. (Contrary to the wifi version, those lamps only have bluetooth control).
Originally based on the work by Teemu Rytilahti python-yeelightbt, it has been completely re-written to improve stability and only focuses on the integration with HA.
- Download the
hass-yeelight_bt.zip
file from the latest release. - Unpack the release and copy the
custom_components/yeelight_bt
directory into thecustom_components
directory of your Home Assistant installation. - install bluepy in the HA virtual environment
- Add the
yeelight_bt
lights as described in next section.
While not being part yet of the default repos, just add this github as a repo in hacs and you will be able to install the component from HACS.
This component use the bluepy
python library to access bluetooth.
In case you are getting "No such file or directory" error for bluepy-helper, you have to go into bluepy's directory and run make there.
If it is not already done, the blupy-helper program will need permissions to acces bluetooth as a regular user. It can be done by doing the following:
sudo setcap cap_net_admin,cap_net_raw+eip /PATH-TO-HA-VENV/PATH-TO-BLUEPY-LIB/bluepy-helper
In Configuration/Integrations click on the + button, select Yeelight bluetooth
and configure the name and mac address on the form.
The light is automatically added and a device is created.
-
For each lamp, create a light with the
yeelight_bt
platform and configure thename
andmac
address.Example:
light: - platform: yeelight_bt name: Bedside lamp mac: 'f8:24:41:xx:xx:xx' - platform: yeelight_bt name: Other lamp mac: 'f8:24:41:xx:xx:xx'
-
Restart Home Assistant.
- Re-implement bluetooth backend for stability and optimal responsivness for yeelight
- Add component to HACS for easy install
- Allow configuration through the integration UI
- Enable discovery of lamps in UI? (Not sure if possible)
- Look into setting up effect and flow (low priority)
- Allow pairing process with new device
- Support for candela light? (I do not have a device, so might need help from someone with one...)
- Scale temperature range so that it matches HA UI
In order to getmore information on what is going on, the debugging flag can be enabled by placing in the configuration.yaml
of Home assistant:
logger:
default: error
logs:
custom_components.yeelight_bt: debug