You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Maurice Makaay c0507e642b In RGB mode, brightness level 1 now triggers a night light mode that actually uses the RGB settings. So this makes it possible to have a night light in a specific color, instead of only the default night light setting. In white light mode, this default is used, so color temperature does not affect the night light color. 3 years ago
doc Update FLASHING.md 3 years ago
.gitignore Moved to a proper ESPHome component structure. 3 years ago
README.md Added development warning to README.md. 3 years ago
__init__.py Moved to a proper ESPHome component structure. 3 years ago
color_night_light.h In RGB mode, brightness level 1 now triggers a night light mode that actually uses the RGB settings. So this makes it possible to have a night light in a specific color, instead of only the default night light setting. In white light mode, this default is used, so color temperature does not affect the night light color. 3 years ago
color_off.h Transitioning to off works too now. Transitioning to on needs some more work (it is now instant, but that won't be hard to implement correctly). 3 years ago
color_rgb_light.h New light transition code implemented and it works beautifully! Transitions between RGB colors and RGB to and from white light now look smooth. Some more code cleanup in the next step, but already loving how this is coming together now. 3 years ago
color_translator.h Transitioning to off works too now. Transitioning to on needs some more work (it is now instant, but that won't be hard to implement correctly). 3 years ago
color_white_light.h New light transition code implemented and it works beautifully! Transitions between RGB colors and RGB to and from white light now look smooth. Some more code cleanup in the next step, but already loving how this is coming together now. 3 years ago
common.h New light transition code implemented and it works beautifully! Transitions between RGB colors and RGB to and from white light now look smooth. Some more code cleanup in the next step, but already loving how this is coming together now. 3 years ago
light.h Fixed transitioning behavior when a new transitioning is started to the same end color of a transitioning that is already in progress (can be triggered from Home Assistant by double clicking on a target color in the RGB color circle). 3 years ago
light.py Started my own derived LightState class to get more control over the light's transitioning behavior. 3 years ago

README.md

esphome-yeelight_bs2

Warning: this code is still under heavy development

This code is not yet production-ready. Most of the work goes into reverse engineering the original firmware and coming up with ways to re-implement a device firmware based on ESPHome.

The main focus for now lies on driving the LED circuitry, to make sure that the light quality meets that of the original firmware. While I thought this would be the easy part, it turned out to be quite a beast, since driving the LEDs is quite different from a regular RGBWW-style light.

The light functionality is getting close to completion. After this, I will work on implementing the front panel buttons. The hard work for this was already done: reverse engineering the protocol that is used to talk to the main board. Therefore, finishing up the firmware should not take much time once I get to this point.

With those two out of the way, we can move towards a stable release of the firmware. I have some more ideas to work on, but those can and will be extensions to the stable release code.

Is it safe to install this firmware on my device?

As long as you keep a backup of the original Yeelight firmware, this is quite safe :-)

I have two lamps that both are running the latest development firmware and they are functioning very well as far as the light feature is concerned. I sometimes see API disconnection issues, but those can all be traced back to the underlying frameworks. For the most prevalent issue, I did some debugging and wrote a fix (it is mentioned below).

For each commit of the code, I will do my best to commit it in a working state. Once a first completed stable release is cooked up, I will tag production releases of the code to make it easier to pick the safe version for production purposes.

Installation

Create a folder named custom_components in the folder where your device's yaml configuration file is stored. Then clone the the Github repo into a subfolder yeelight_bs2. For example on the command line:

# mkdir custom_components
# cd custom_components
# git clone https://github.com/mmakaay/esphome-yeelight_bs2 yeelight_bs2

Your folder structure should now look like:

config
├── yourdevice.yaml
├── custom_components/
│   ├── yeelight_bs2/
│   .   ├── README.md
.   .   ├── yeelight_bs2_light_output.h
.   .   .

Then add the required configuration to your device's yaml configuration file. For an example file, take a look at doc/example.yaml in this repository.

On a Rapsbery Pi with HomeAssistant and ESPHome as a plugin, the directory should be:

/config/esphome/custom_components/yeelight_bs2/

config
├── epshome
│   ├── yourdevice.yaml
│   ├── custom_components/
|   .   ├── yeelight_bs2/
│   .   .    ├── README.md
.   .   .    ├── yeelight_bs2_light_output.h
.   .   .    .

See doc/FLASHING.md for hints for opening and flashing the light.

Issue: the device keeps losing its connection to Home Assistant

This is not a problem with the device or the custom firmware, but a problem in the upstream library "AsyncTCP". I did identify the issue and have a proposed fix for it. The issue was reported at:

https://github.com/me-no-dev/AsyncTCP/issues/116

If you want to try out this change, then create a libs folder in the folder where your device's yaml configuration file is stored, and clone the following repository into that folder:

https://github.com/mmakaay/AsyncTCP

For example on the command line:

# mkdir libs
# cd libs
# git clone://github.com/mmakaay/AsyncTCP

Then add a pointer to this folder from within your device's yaml configuration file, using the lib_extra_dirs option. Provide it with the absolute path to your libs folder. The relevant part of the config change looks like this:

esphome:
  platformio_options:
    lib_extra_dirs: /config/libs

This way, the repository version of the library will override the version of the library that is bundled with ESPHome. Build the device firmware and flash the device like you would normally do.