Skip to content
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

Meteorite - low brightness and white tones issues #15

Closed
chris-nite opened this issue May 29, 2021 · 14 comments
Closed

Meteorite - low brightness and white tones issues #15

chris-nite opened this issue May 29, 2021 · 14 comments

Comments

@chris-nite
Copy link

chris-nite commented May 29, 2021

Hi @syssi , thanks again for your fast help in getting the meteorite up and running with esphome.
Finally a functioning and responsive light! :-)
When using the light today i found out, that when the main light is used with a low brightness and then changing the white tones somewhere to the middle, the shown white tone is very warm or cold (depending if you move the slider a bit to the right or left). Changing tones are happening very aprubtly by the light while on low brightness, while for a very short time, the right (mixed) color is flashing for about half a sec.
There seems to be something off, because if you improve the brightness by quite a bit (let's say half), changing white tones go very smoothly and are correctly mixed (through the ww and cw leds).
Attached you'll find my yaml-file.
Anyone got the same issues on lower brightness levels?

substitutions:
  name: yeelight_light_ceiling10

esphome:
  name: ${name}
  platform: ESP32
  board: esp32doit-devkit-v1
  platformio_options:
    platform: espressif32@3.0.0
    platform_packages: tasmota/framework-arduinoespressif32 @ 3.10006.210420

wifi:
  ssid: xxxx
  password: xxxx
  fast_connect: true

ota:
api:
logger:

output:
  - platform: ledc
    pin: GPIO19
    id: output_warm
    power_supply: power
#    min_power: 0.13
    max_power: 0.82
  - platform: ledc
    pin: GPIO21
    id: output_cold
    power_supply: power
#    min_power: 0.13
    max_power: 0.82

  - platform: ledc
    pin: GPIO23
    id: output_nightlight
    power_supply: power

  - platform: ledc
    pin: GPIO33
    id: output_red
    power_supply: power
  - platform: ledc
    pin: GPIO26
    id: output_green
    power_supply: power
  - platform: ledc
    pin: GPIO27
    id: output_blue
    power_supply: power

power_supply:
  - id: power
    pin: GPIO22
    enable_time: 0s
    keep_on_time: 0s

light:
  - platform: monochromatic
    name: "${name} night light"
    id: night_light
    output: output_nightlight
    gamma_correct: 0
    on_turn_on:
      - light.turn_off: ceiling_light
  - platform: cwww
    name: "${name} ceiling light"
    id: ceiling_light
    cold_white: output_cold
    warm_white: output_warm
    cold_white_color_temperature: 6500 K
    warm_white_color_temperature: 2700 K
    constant_brightness: true
    gamma_correct: 0
    on_turn_on:
      - light.turn_off: night_light
  - platform: rgb
    name: "${name} ambient light"
    red: output_red
    green: output_green
    blue: output_blue
    gamma_correct: 0
    effects:
      # Use default parameters:
      - random:
      # Customize parameters
      - random:
          name: "Slow Random Effect"
          transition_length: 30s
          update_interval: 30s
      - random:
          name: "Fast Random Effect"
          transition_length: 4s
          update_interval: 5s
      - pulse:
          name: "Fast Puse"
          transition_length: 0.5s
          update_interval: 0.5s
      - pulse:
          name: "Slow Puse"
          # transition_length: 1s      # defaults to 1s
          update_interval: 2s
      - strobe:
          name: "Green Strobe"
          colors:
            - state: True
              brightness: 100%
              red: 0%
              green: 100%
              blue: 0%
              duration: 500ms
            - state: False
              duration: 250ms
      - strobe:
          name: "Red Strobe"
          colors:
            - state: True
              brightness: 100%
              red: 100%
              green: 0%
              blue: 0%
              duration: 500ms
            - state: False
              duration: 250ms
      - strobe:
          name: "Blue Strobe"
          colors:
            - state: True
              brightness: 100%
              red: 0%
              green: 0%
              blue: 100%
              duration: 500ms
            - state: False
              duration: 250ms
      - strobe:
          name: "Police Strobe"
          colors:
            - state: True
              brightness: 100%
              red: 0%
              green: 0%
              blue: 100%
              duration: 500ms
            - state: True
              brightness: 100%
              red: 100%
              green: 0%
              blue: 0%
              duration: 500ms
      - flicker:
@chris-nite chris-nite changed the title Meteorite Meteorite - low brightness and white tones issues May 29, 2021
@syssi
Copy link
Owner

syssi commented May 29, 2021

Please remove all gamma_correct: 0 lines, reflash and try again. ;-)

@chris-nite
Copy link
Author

I tried that out and now the light only turns on, when i pull the brightness lever to about 40%. Interestingly the white tones still occur that flashing behavior when pulling it to about 50%. It seems the light tries to mix the warm and cold diodes, suceeds for about half a sec and then falls back to colder or warmer tones.
Might the frequency setting change a thing?

@syssi
Copy link
Owner

syssi commented May 30, 2021

I've disabled (value: 0) the gamma correction in the past because of this behavior / issue: esphome/esphome-core#190

I will try to reproduce the issue at my device to get a better understanding. I must admit I don't use the color temperature slider.

Could you try to play around with the frequency setting? I think it could improve the situation (especially if driving the light with more brightness is working fine).

@syssi
Copy link
Owner

syssi commented May 30, 2021

Take a look at this issue for some additional informations:

#8

I think the usability of every supported device / esp32 driven yeelight can optimized easily by playing around with gamma_correct, min_power, max_power and the frequency setting. May be some custom code is required to fix/improve the lower brightness limit (brightness=1).

@chris-nite
Copy link
Author

I'm sorry, that i didn't give you a response yet. I really appreciate your support and will try out your suggestions on the coming weekend. Can i freely test out these settings like frequency/power etc. on the device itself without the risk of destroying it?

@syssi
Copy link
Owner

syssi commented Aug 27, 2021

Did you find better settings to improve the configuration?

@rafasanz
Copy link

rafasanz commented Oct 10, 2022

With the actual yaml if light is under 13-15% can happen few situations:

  • under 13% always turn off
  • on 14% leds on are always white cold (sometimes flickering)
  • on 15% normal function for cold and warm light

I have uncomment line 29 & 35 and now it's looking that everything is working fine.

But now, when i turn off, for example from 100% to 0% (off) starts to shutting down, but on some level (close to 13%) makes something strange. It's like flickering little bit time and after that goes off.
In example => 100%----------50%-----------30%-------15%----20%----0% an example what ceiling does (not changing temperature color of light)

Thanks and nice work!!

@ultrazauberer
Copy link

I just want to say I have the same issue with the stock firmware. Changing the color of the white Mainlight on low brightness causes color flickering. Feels like the old light bulbs in the office.

So the ESPhome firmware could fix this problem according to the last post?

Also on of my yeelight arwen 550 forgets all the settings and the link to my Xiaomi account. But I barely use this lamp. Could ESPhome here also improve the behavior?

@syssi
Copy link
Owner

syssi commented Mar 28, 2023

Also on of my yeelight arwen 550 forgets all the settings and the link to my Xiaomi account. But I barely use this lamp. Could ESPhome here also improve the behavior?

There is an EEPROM on the daughter board to store some key material and may be account numbers. This EEPROM isn't used if you flash the ESPHome based firmware so the chance is high to improve the usability/stability of your device.

@ultrazauberer
Copy link

Also on of my yeelight arwen 550 forgets all the settings and the link to my Xiaomi account. But I barely use this lamp. Could ESPhome here also improve the behavior?

There is an EEPROM on the daughter board to store some key material and may be account numbers. This EEPROM isn't used if you flash the ESPHome based firmware so the chance is high to improve the usability/stability of your device.

Thanks for you fast respond. I will definitely try it. Something is coming to my mind:
If I use ESPhome on the yeelight, could I connect a DHT22 and read humidity and temperature (one big disadvantage: I guess only when the lamp is on)?

@syssi
Copy link
Owner

syssi commented Mar 28, 2023

If I use ESPhome on the yeelight, could I connect a DHT22 and read humidity and temperature (one big disadvantage: I guess only when the lamp is on)?

Yes, the number of possibilities is huge here. :-) In best case the device is powered always.

@PsychoRS
Copy link

PsychoRS commented Nov 7, 2023

Hi, I think I've found the solution to 100% replicate the stock firmware behaviour.

First of all, I've recalculated min_power and max_power using the voltage info here. So, with my i-dont-know-if-correct-but-it-works calculations, max_power for the warm output must be 0.77 (if 0 is 0 and 1 is 3.3v, so 2.55v must be 0.77), and 0.76 for the cold output.

So:

output:
  - platform: ledc
    pin: GPIO19
    id: output_warm
    power_supply: power
    min_power: 0.13
    max_power: 0.77
    frequency: 1220Hz
  - platform: ledc
    pin: GPIO21
    id: output_cold
    power_supply: power
    frequency: 1220Hz
    min_power: 0.13
    max_power: 0.76

With this settings, my brightness slider is working perfect (no more turning off at 12-13%, no more "no more brightness from 9x% up". Then I found that, with that settings, if you turn off the light when at low brightness, it flicks strangely, as @rafasanz said.

The solution? For me was just using the zero_means_zero parameter.

So:

output:
  - platform: ledc
    pin: GPIO19
    id: output_warm
    power_supply: power
    min_power: 0.13
    max_power: 0.77
    frequency: 1220Hz
    zero_means_zero: true
  - platform: ledc
    pin: GPIO21
    id: output_cold
    power_supply: power
    frequency: 1220Hz
    zero_means_zero: true
    min_power: 0.13
    max_power: 0.76

With this configuration, my Meteorite is finally working as with the standard firmware. No more flickering, no more turning off around 13-15% brightness, no more max brightness at around 90%.

Please, try it and feel free @syssi to use this yaml for the repo.

PS: I don't know if frequency: 1220Hz has anything to do with this, must test it later.

@syssi
Copy link
Owner

syssi commented Nov 7, 2023

Awesome! I will give it a try!

syssi added a commit that referenced this issue Sep 13, 2024
@syssi
Copy link
Owner

syssi commented Sep 13, 2024

The frequency doesn't make a difference. I've added the improved limits to the example configuration.

@syssi syssi closed this as completed Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants