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 8ad6aafc3d Made the bug report template less application-y. 3 years ago
.github/ISSUE_TEMPLATE Made the bug report template less application-y. 3 years ago
binary_sensor Added a text_sensor, which propagates the current light mode. This is one of "off", "rgb", "white" and "night". 3 years ago
doc Used an if: condition in the example, instead of a lambda, for turning on and off the front panel illumination, based on night mode yes/no. 3 years ago
light Some changes to make the text_sensor work for logic expressions. 3 years ago
output Fixed front panel brightness indicator scale + random color button. 3 years ago
sensor Added a text_sensor, which propagates the current light mode. This is one of "off", "rgb", "white" and "night". 3 years ago
text_sensor Some changes to make the text_sensor work for logic expressions. 3 years ago
.gitignore Moved to a proper ESPHome component structure. 3 years ago
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 3 years ago
LICENSE.md Create LICENSE.md 3 years ago
README.md Updated project status in the README.md. 3 years ago
__init__.py Implemented the I2C messgage to event type parser. 3 years ago
common.h Introduced a HUB component + front panel IRQ handling 3 years ago
front_panel_hal.h Fixed front panel brightness indicator scale + random color button. 3 years ago
light_hal.h What's better than one hub? Two HALs! I split up the HUB component into two separated components with the same kind of function: LightHAL and FrontPanelHAL. 3 years ago

README.md

esphome-yeelight_bs2

Warning: this code is still under development

This code might not yet be production-ready.

At this point, I would call it alpha-quality. Mainly in the sense that the interfaces that have been implemented so far might still change. The new firmware is currently being tested and depending on the actual use cases and issues that we might run into, breaking changes could still be done at some point.

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.

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 up the device and flashing its firmware.

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 an issue and my pull request for a fix was accepted and merged:

https://github.com/OttoWinter/AsyncTCP/pull/4

If you want to try out this fix, straight from my repository, lhen 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.