Closed jumblies closed 4 years ago
This seems to apply to the strobe effect as well, which as far as I rememeber, used to flash in the selected colour.
It seems like a recent change causes it to simply ignore the primary colour.
@DarkFox Can you remember how long ago it worked so we can look at the diff?
Today I'm going to see if I can revert esphome to a different version and try it.
To me the lambdas are confusing because I suck at C++ and I don't know what I can pass to lambda functions, but I extrapolated the code from esphome and came up with this crude flicker which does respect color. I'm sure something similar can be done with strobe.
It unfortunately fixes brightness at 70%. If I could figure out how to pass brightness to the lambda, then I could make the cubic random variation do +/- each iteration (as opposed to my simpleton reset to .7 each update)
globals:
- id: global_brightness
type: double
restore_value: no
initial_value: '0.7'
...
- lambda:
name: randomflicker
update_interval: 200 ms
lambda: |-
auto call = id(h801_2_rgb).turn_on();
float r = random_float() * 2.0f - 1.0f;
r = r * r * r;
call.set_transition_length(r);
static double br=id(global_brightness);
call.set_brightness(br + r/10);
call.set_publish(false);
call.set_save(false);
call.perform();
Unfortunately I haven't been keeping up with every update, but I'm fairly certain that it worked before 1.12.1, so it broke at some point after that.
@DarkFox I am unable to find any info on specifying version in order to revert and look at working code. I'll see if I can find the diff on the light effects.
Do you have any idea how to pass a light state to a global var? I don't know how to get access to the class members so bring their data into my lambda.
Fortunately, there are only 3 commits to this file so maybe it won't be too painful to track down: https://github.com/esphome/esphome/commits/dev/esphome/components/light/base_light_effects.h
@OttoWinter This applies to all lights, not just addressable. It's a pity, as I was using the strobe effect with different colors for notifications, but now I've got a choice of white or white.
Martin, as a temporary workaround, you can use lambda functions which do respect the primary color. I've looked at the temolated src and esphome but I'm not sophisticated enough to figure out where it is set to white
On Sep 15, 2019 14:19, "Martin Eberhardt" notifications@github.com wrote:
@OttoWinter https://github.com/OttoWinter This applies to all lights, not just addressable. It's a pity, as I was using the strobe effect with different colors for notifications, but now I've got a choice of white or white.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/esphome/issues/issues/562?email_source=notifications&email_token=AFYVXP7U5ROUAPBTFDT2TSTQJZ4B5A5CNFSM4IITU4LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6XWESA#issuecomment-531587656, or mute the thread https://github.com/notifications/unsubscribe-auth/AFYVXPZOMBZETATMFIQWAHTQJZ4B5ANCNFSM4IITU4LA .
Operating environment/Installation (Hass.io/Docker/pip/etc.):
Docker - RPi3B
ESP (ESP32/ESP8266, Board/Sonoff):
H801/ESP8266 https://esphome.io/cookbook/h801.html?highlight=h801 Affected component:
https://esphome.io/components/light/index.html#light-effects
Description of problem: When on flicker light effect, ESP does not respect primary color and turns to white. Any change to primary color is ignored on flicker. The light does flicker, but always white. Have tried setup for RGB and RGBW with same effect.
Per the docs : "This effect “hovers” around the active color of the light and flickers each color channel a bit."
but it doesn't use active color at all. Logs reflect color changes but output color is the same. This effect “hovers” around the active color of the light and flickers each color channel a bit. Problem-relevant YAML-configuration entries:
Logs (if applicable):
Additional information and things you've tried: Checked wiring. Used 2 different H801 units with same result. Standard colors work fine.