-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add YLXD05YL and YLXD01YL support (Mediatek devices) #10
Comments
Bad news: The heart of the white daughterboard is a Mediatek microcontroller. Esphome has ESP8266 and ESP32 support only. Your device aren't Esphome compatible. :-( |
Ah ok, thought that might be the case when I pulled it apart. Thanks anyways |
Do you like to replace the white daughterboard with an esp32? The task isn't easy but possible. |
Interesting, I'd assume a fairly good understanding of the schematics of the board would be needed no? |
Yes. I try to outline the steps to get a better undestanding what needs to be done:
We are ready if you've identified the following pins:
|
Excellent guide, next weekend when I have time I'll start poking around |
Hello Syssi! Thank you for your wonderful work! I have similar light. I've found g, rx, tx, 3v3 and start pins. |
You can identify a PWM signal if you measure the voltage at a GPIO. If you change the brightness the voltage should change. Examples: |
Thank you! Is there way to disable mediatek without displacing it? |
nightlight is very low warm leds. What the nightlight pin does and how to find it? Same with RGB backlight. I'm not familiar with how it works yet. Should it be 3 different pins? |
The nightlight pin is a PWM pin too. It drives the warm white LEDs in a very low brightness range. The RGB backlight are 3 PWM pins one per color. |
I prefer to remove the Mediathek MCU before assembling the ESP32 because it will be hard to remove the power supply from the Mediathek MCU only. |
At some devices a GPIO ist used (Low vs. High) to turn the LED driver on and off. Please check all remaining pins while turning the lamp on and off. Do you see a GPIO flipping between 0 and 3,3V? |
5 pins are always high but they are not connected to 3.3pin 1 pin between warm and nightlight is low when turned off and 1.55V when turned on Also i provided 3,3V to cold and warm LED pins when the light was turned off and the LEDs worked. |
Just keep this in mind. May be the behaviour/state needs to replicated at the esphome firmware.
I don't know.
Good idea. I think you are safe now. :-) |
Finally got it working! Issues and questions so far:
So Mediatek controller of YLXD02YL can be replaced by ESP32. |
Could you provide a photo and your yaml as contribution? |
try these frequency settings to get ride of the noise. `output:
|
I have the same light an was already thinking for a while to try this too. My soldering skills or the tools I where using have been simply not enough for the job. However I manged to restore full functionality except the Bluetooth remote. There you go. https://github.com/jaddel/ESPHome-Configurations/tree/master/Devices/Ceiling%20Yeelight%20YLXD05YL |
@jaddel I've updated my ceiling lamps to esphome |
Thank you, i will try! |
BLE-monitor custom integration now supports Yeelight dimmer and remote! Could you please advice how to set the mediatek controller into pairing mode? power off/on for 5 times doesn't work. |
@lazzzrus The remote control can be used without any encryption key. The encryption key of the dimmer can be retrieved by a modded mihome app version. Do you want to give it a try? (No OEM firmware / Mediatek required) |
i do for sure. Now i've managed to get mediatek back into mihome mod, but no pairing .txt is available yet... |
Thanks. I gave it a try, although one light is YLXD12YL, but pinout seems to be the same, so is the board.
Adjusted GPIOs according to post above and all seems to work just fine I just have issue - there is noticeable delay when I power it on (from AC) - I did read this through: #41 and added default transition, but seems to have no effect. Here is mu light config:
|
I did go ahead and converted also YLXD01YL. |
Personally I don't turn off the AC power to it (removed ac switch altogether) so I wouldn't know how long it takes right now. But I do remember it taking a bit longer than usual when I still did have a regular ac switch |
Same here. My Yeelights are always powered. I will prepare a test bench setup to reproduce the issue. |
@syssi @NopeFinder
|
I guess you can fix the flickering if you don't use |
Thank you @syssi , it was indeed due to this. I moved night light to GPIO14 (D5) and the issue is gone. Now it is almost perfect. The only thing that still happens is - when I power it on via AC, for a very brief moment, it looks like it starts dimmed (or night light starts) and then immediately goes to desired (either restored from flash, or set on boot) color/brightness (with or without transition, depending on how it is set). This isn't as annoying as 1 second delay or flicker, but still - maybe i am just missing something. Below is my config with omitted unnecessary piece of code:
|
I had a chance to do few more tests. It looks like that it is night light that gets triggered for a split second on the boot. If I disconnect GPIO pin that connects the night light, it is not happening. |
If you play with the idea to add a resistor please double check the LED driver board is probably already equipped with a pull-down/pull-up resistor. Please don't destroy your driver board while tinkering! |
I am not sure my skills are good enough to try that. I rather disconnected the night light completely for now as I barely used it anyway. |
Same here. I don't want to instruct you to do dangerous things where I am not 100% sure they are a good idea. |
I will give it a try and try various esp32 or esp8266. I am reading that this may be just the thing for wemos, and others (even clones) may behave differently. So i ordered a few and will report back. |
@avion23 Do you like to add your 5 cents of a professional here? Short summary: This picture describes what we have done: https://user-images.githubusercontent.com/19818061/211223563-126fef62-f918-4a00-a9bb-7778376285ed.jpeg We've replaced a Mediatek microcontroller with an ESP8266. The ESP is attached to a LED driver board and the three colors (RGB) can be controlled using PWM. A fourth PWM signal is used to control a subset of the LEDs as nightlight. The issue: The nightlight flickers on boot-up of the ESP. I assume the output pin of the ESP is floating and causes the flicker. How can we make sure the LED driver isn't equipped with a pull-up/pull-down already? If the resistor is missing I would like to add one to pull the line to a logic level to "turn/keeping off the nightlight if there is no PWM signal". |
It is recommended to use a pullup or pulldown resistor in this application. Based on the assumption that the lines switch an N-Channel MOSFET, it is appropriate to use a pulldown resistor. This is based on my assumption that a high output from the ESP8266 results in the light being turned on. A resistor value in the range of 10k Ohm to 100k Ohm should be suitable. To provide mechanical isolation of the solder joints, consider applying a small amount of adhesive to the lines. |
@stomko11 I've found this article on reddit today: https://static.xtremeownage.com/blog/2023/esphome-on-critical-infrastructure/ It mentions https://static.xtremeownage.com/blog/2023/esphome-on-critical-infrastructure/ |
@syssi this works on switch only, not on pwm. So I would not be able to adjust code to make things work. |
GPIO4 and GPIO5 are the only pins on the ESP8266 that are always high impedance and do not float or are actively pulled during boot. I'd test those if I were you. Will start to play with my YLXD01YLs in the coming days. GPIO15 might be an option as well, but there is conflicting information on its exact behavior during boot. |
I did, however you need 3 PINs - night light, warm white, cold white. |
The setup below works fine for me. One of the pins not being on GPIO4, GPIO5, or GPIO15 leads to a short flash of the respective color during boot. ESP8266 D1 mini clone |
It is that flash that annoyed me on esp2866. And delay on esp32 (got used to it) |
The flash is gone if you use those three pins on the esp8266. Here's an explanation for the flashes during boot if other pins are used: |
Tell me why, when I turn off the light, the lamp (YLXD17YL) does not go out evenly?
|
Solved the problem by adding
|
I converted YLXD01YL - thx! I tore out this "Mediatek" chip with a regular soldering iron, losing a few pads, but fortunately they were unimportant (butcher) :P Everything works, but... in cwww mode, when the brightness is set to 1-30%, flickering occurs. This problem does not occur in "nightlight" mode. I tried different frequencies (9765Hz/20000Hz) but I didn't see any changes. Anyone have an idea how to fix this? My yaml:
|
Hi, |
Replaced MTK board in my YLXD05YL with ESP32-WROOM-32UE and it worked perfectly, however i needed to change pwm frequency for night light pin to 19531Hz, because it produced audible whining noise on 4882Hz and 9765Hz. |
I am very late to the party, but I have successfully replaced mediatek with ESP32-C3 SuperMini. Haven't tried yet to connect dimmer. So far works seamless except dificulties to set ambient light to warm light (pure red/gree/blue works perfectly though). Just in case, attaching my configuration. Which is a composition from configurations posted previously with adaptation for c3 SuperMini, and some minor additions like turn on light on power restore. #Variables
substitutions:
device_name: bedroom-light
friendly_name: Bedroom
esphome:
name: ${device_name}
friendly_name: ${device_name}
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
# Enable Home Assistant API
api:
encryption:
key: ""
logger:
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${device_name} Fallback Hotspot"
password: !secret wifi_ap_password
captive_portal:
output:
- platform: ledc
pin: GPIO00
id: output_warm
frequency: 4882Hz
min_power: 0.07
max_power: 0.92
zero_means_zero: true
- platform: ledc
pin: GPIO01
id: output_cold
frequency: 4882Hz
min_power: 0.07
max_power: 0.92
zero_means_zero: true
- platform: ledc
pin: GPIO02
id: output_nightlight
frequency: 9765Hz
max_power: 0.92
- platform: ledc
pin: GPIO05
id: rgb_red
- platform: ledc
pin: GPIO06
id: rgb_green
- platform: ledc
pin: GPIO7
id: rgb_blue
light:
- platform: monochromatic
name: "${friendly_name} Nightlight"
id: night_light
output: output_nightlight
gamma_correct: 0
restore_mode: ALWAYS_OFF
on_turn_on:
- light.turn_off: ceiling_light
- platform: cwww
name: "${friendly_name}"
id: ceiling_light
cold_white: output_cold
warm_white: output_warm
cold_white_color_temperature: 6000 K
warm_white_color_temperature: 2700 K
gamma_correct: 0
constant_brightness: true
restore_mode: ALWAYS_ON
on_turn_on:
- light.turn_off: night_light
- platform: rgb
name: "${friendly_name} Ambient"
id: ambient_light
red: rgb_red
green: rgb_green
blue: rgb_blue |
Why do you use these two settings, especially for ESP8266?
|
@rufik It should act like a calibration of the brightness setting. Let's assume the LED goes off if you set the brightness to |
Is it possible to assist with flashing the YLXD05YL and YLXD01YL models of the Yeelights?
Photos attached of mainboards.
Thankyou
The text was updated successfully, but these errors were encountered: