Martin Jerry / Tessan Dimmer Automation Help [SOLVED]

I have the same problem. Did you find a solution for it?

I have about 10+ of these dimmers in my home so this was very helpful, thanks to everyone contributing here.
Regarding getting the red led to turn on when the light is off, I’m no programmer but I got it working, but not ideally.
First I defined GPI04 in the output: section

  - platform: gpio
    pin: GPIO4
    id: redled
    inverted: true

and then in the interval: section, I added id(redled).turn_off(); and id(redled).turn_on;

interval:
  - interval: 250ms
    # https://esphome.io/guides/automations.html#interval
    then:
      - lambda: |-
          auto dimmer_vals = id(dimmer).current_values;
          if (dimmer_vals.is_on()) {
            id(redled).turn_off();
            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(); }
          } else {
            id(led2).turn_off();
            id(led3).turn_off();
            id(led4).turn_off();
            id(led5).turn_off();
            id(redled).turn_on();
          }

This appears to be working fine. However, I don’t have the blinking status light anymore when the switch is not connected, since it’s always solid red when the switch is off.

I’m not sure how to get this working.
I see in this configuration they got it to work by specifying platform: status_led under light: section

light:
  - platform: status_led
    id: ledred
    pin:
      number: GPIO4
      inverted: True

But this doesn’t work when I try putting it this under light: in the config discussed here.
Any idea what may be wrong?
I would love to get the status led function as well as the red led when the switch is turned off in the config built here.

Nope. Recently moved these back to Tasmota. Much less of a delay.

I know this is a bit old, but this thread was super helpful for me in updating my Martin Jerry dimmer switches to esphome from Tasmota, so I figured I’d drop a comment in case it helps anyone.

Regarding the delay when turning off the dimmer, I found this is a direct result of the value used for pwm_min_power. Essentially, if you lower the pwm_min_power value, you will lower the delay you are experiencing.

Logically, it makes sense as the “power off” sequence is likely going through a fixed dimming process before turning off the light. If you have a higher pwm_min_power value, then the light will simply not dim any further during the “power off” sequence once the dimming value has gone below pwm_min_power threshold.

Thank you for posting this, I changed the pwm_min_power setting from 15% to 5% and I no longer have the delay.

  device_name: office-lights # hostname & entity_id
  friendly_name: Office Lights # Displayed in HA frontend
  pwm_min_power: 5% # keep dimming functional at lowest levels
  no_delay: 0s # transition when changing dimmer_lvl & relay delay
  transition_length: 0s # transition when turning on/off
  long_press_min: .4s # minimum time to activate long-press action
  long_press_max: 2s # maximum time to activate long-press action
  long_press_up: 100% # long press brightness
  long_press_down: 20% # long press brightness
  long_press_main: 50% # long press brightness