You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 31, 2020. It is now read-only.
Thanks for the great resource. As noted, I used the configuration from MJ-SD01 and applied it as is to the Tessan Dimmer (MJ-SD02).
Everything seems to be a perfect mapping. However I noticed that in the "off" state, the LEDs flicker, which I did not notice on the MJ-SD01.
In looking at the configuration, I believe the issue is caused by the lack of nesting of the if statements in the interval:
if (dimmer_vals.is_on()) {
id(dimmer_lvl) = dimmer_vals.get_brightness();
}
if (id(dimmer_lvl) > .19) { id(led2).turn_on(); }
if (id(dimmer_lvl) < .20) { id(led2).turn_off(); }
if (id(dimmer_lvl) > .39) { id(led3).turn_on(); }
if (id(dimmer_lvl) < .40) { id(led3).turn_off(); }
if (id(dimmer_lvl) > .59) { id(led4).turn_on(); }
if (id(dimmer_lvl) < .60) { id(led4).turn_off(); }
if (id(dimmer_lvl) > .79) { id(led5).turn_on(); }
if (id(dimmer_lvl) < .80) { id(led5).turn_off(); }
if (!dimmer_vals.is_on()) {
id(led2).turn_off();
id(led3).turn_off();
id(led4).turn_off();
id(led5).turn_off();
}
Because the if (id(dimmer_lvl) > .19) { id(led2).turn_on(); } statements are not in the if (dimmer_vals.is_on()) block the LED lights are briefly toggled on prior to being turned of in the if (!dimmer_vals.is_on()).
This reorganization addresses the flickering, at least in my case.
if (dimmer_vals.is_on()) {
id(dimmer_lvl) = dimmer_vals.get_brightness();
if (id(dimmer_lvl) > .19) { id(led2).turn_on(); }
if (id(dimmer_lvl) < .20) { id(led2).turn_off(); }
if (id(dimmer_lvl) > .39) { id(led3).turn_on(); }
if (id(dimmer_lvl) < .40) { id(led3).turn_off(); }
if (id(dimmer_lvl) > .59) { id(led4).turn_on(); }
if (id(dimmer_lvl) < .60) { id(led4).turn_off(); }
if (id(dimmer_lvl) > .79) { id(led5).turn_on(); }
if (id(dimmer_lvl) < .80) { id(led5).turn_off(); }
}
if (!dimmer_vals.is_on()) {
id(led2).turn_off();
id(led3).turn_off();
id(led4).turn_off();
id(led5).turn_off();
}
Hope this is helpful.
Again, great resource.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Thanks for the great resource. As noted, I used the configuration from MJ-SD01 and applied it as is to the Tessan Dimmer (MJ-SD02).
Everything seems to be a perfect mapping. However I noticed that in the "off" state, the LEDs flicker, which I did not notice on the MJ-SD01.
In looking at the configuration, I believe the issue is caused by the lack of nesting of the
if
statements in theinterval:
Because the
if (id(dimmer_lvl) > .19) { id(led2).turn_on(); }
statements are not in theif (dimmer_vals.is_on())
block the LED lights are briefly toggled on prior to being turned of in theif (!dimmer_vals.is_on())
.This reorganization addresses the flickering, at least in my case.
Hope this is helpful.
Again, great resource.
The text was updated successfully, but these errors were encountered: