syssi / esphome-yeelight-ceiling-light

ESPHome custom firmware for some Yeelight Ceiling Lights
Apache License 2.0
149 stars 22 forks source link

Yeelight Light Strip1S on/off button does not work #70

Closed doe1097 closed 10 months ago

doe1097 commented 1 year ago

Hi, I successfully flashed a 1S light strip which was literally buried in a closet for the past two years, thank you! The light strip now works with Homeassistant, but with the new firmware the hardware on/off button stopped working. Is this a known issue or did I accidentally break the button, when I (forcefully) opened the case?

Best, H.

syssi commented 1 year ago

The button isn't implemented yet. Could you try to identify the GPIO attached to the button?

doe1097 commented 1 year ago

Sure. Can I do this by using the Log (and how)? I set the logger component to level: DEBUG, but when I press the button nothing shows up in the logs.

syssi commented 1 year ago

You have two options:

  1. Unplug the LED strip and use a multimeter:Measure the resistance between GND and all GPIOs. Press the button and measure the resistance again. Pressing the button should change the resistance of the dedicated GPIO. If you don't see an effect (if you press the button) repeat the experiment. This time measure the resistance between VCC and all GPIOs.
  2. Extend your YAML by a binary sensor per GPIO (see https://esphome.io/components/binary_sensor/gpio.html). Avoid the already mentioned GPIOs at the YAML. Start the ESP, press the button multiple times. You should see some feedback in the logs now.
doe1097 commented 1 year ago

Looks like GPIO19 is what we are looking for

image

syssi commented 1 year ago

Good job! I will provide some glue code soon to toggle the light entity per button press.

syssi commented 10 months ago

I've extended the YAML configuration. See https://github.com/syssi/esphome-yeelight-ceiling-light/commit/6546f196f42a2ecef8d2b7757bb680acf8b25af9

Please give it a try!