RobotDyn AC Dimmer

Has anyone got experience with these?
RobotDyn AC Dimmer Module

I have a D1 mini on the way too so wil be learning Arduino and sketches to get this going, i have a few examples to draw on, mainly this guy,https://arduinodiy.wordpress.com/2018/01/23/dimming-an-ac-lamp-via-mqtt/

This will be the last step in getting all my lights in the house controlled through HA and for less than $10 AUD it’s a damn sight cheaper than most human operated rotary dimmer units off the shelf!

1 Like

anyone tried these type of ac dimmer with tasmota or esphome ?

1 Like

I’m also waiting for ESPHOME so far without a result

Anyone got a working code? Can’t find anything on the net according to get this wiring with home assistant and a esp. The information on ESPHome isn’t available.

Hope anyone succeed in getting this working.

1 Like

I’m find something like this and it’s looks good but I don’t tested it jet. Enjoy :wink:

Anyone got it to work with espHome/Tasmota yet?

Found this, im gonna try

I just switched over my dimmer devices (used with Wemos D1) from ESPAlexa to HA. I tried the beta ESPHome setup with them and really didn’t like the results. Inconsistent brightness, flickering, poor long transitions, and several other issues.

I had perfected the PWM/ISR function using hw_timer when I initially set these devices up years ago, so I really wanted to go back to my original code and have them communicate with HA using Mosquitto MQTT. I finally got that completed and uploaded onto Github!

Some cool features:

Works with Arduino OTA (a major feat - yet only a small line of code - to get OTA working with hw_timer and interrupts)!

User define 1-99% min/max brightness… works great with my LED bulbs!

Works with HA transitions… love my morning sunrise and bedtime sunset!

Retained brightness when toggling (HA will send brightness as 0 when toggling a light on, your code will remember your last brightness and reset it for you). Plus set up retained message in yaml to recover last state on reboot.

One file, all your devices… just change the deviceID variable, choose your named device in your Arduino port list, then update each device one by one. Super easy! (NOTE - I’ve seen comments that using httpUpdate is better, but I preferred OTA… not sure why exporting a file, then uploading using http is better than choosing the device in port and uploading straight from the IDE.)

I’m back to my old, smooth transition, zero flickering on LED bulbs, and consistent brightness results. So happy! I hope my efforts can help other out!

I have made it working with esp32 controller running esphome.

ESP HOME CONFIG
esphome:

  name: panel-7
  includes:
    - my_custom_component.h
  libraries:
    - RBDdimmer

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
mqtt:
  broker: 192.168.100.16
  username: mohammad
  password: ******

logger:
  level: VERBOSE
  logs:
    mqtt.component: DEBUG
    mqtt.client: ERROR

# Enable Home Assistant API
api:

ota:
  password: "***********"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Panel-7 Fallback Hotspot"
    password: "********"

captive_portal:

custom_component:
- lambda: |-
    auto my_custom = new MyCustomComponent();
    return {my_custom};

home assistant config

fan:
  - platform: mqtt
    command_topic: "c01/panel_1/output/dimmer1"
    payload_off: "OFF"
    payload_on: "ON"
    name: "Living Room Fan"
    unique_id: "my_fan_001"
    speed_range_min: 1
    speed_range_max: 100
    percentage_command_topic: "c01/panel_1/output/dimmer1/speed"
    percentage_state_topic: "c01/panel_1/output/dimmer1/speed/state"
    state_topic: "c01/panel_1/output/dimmer1/state"

my_custom_component.h

#include "esphome.h"

#include "RBDdimmer.h"

#define outputPin  26

#define zerocross  23

int speed=0;

dimmerLamp dimmer(outputPin,zerocross);

class MyCustomComponent : public Component, public CustomMQTTDevice {

 public:

  void setup() override {

    dimmer.begin(NORMAL_MODE, ON);

    dimmer.setPower(35);

    // This will be called once to set up the component

    // think of it as the setup() call in Arduino

    subscribe("c01/panel_1/output/dimmer1", &MyCustomComponent::on_message_switch);

    subscribe("c01/panel_1/output/dimmer1/speed", &MyCustomComponent::on_message_speed);

    // also supports JSON messages

    //subscribe_json("the/json/topic", &MyCustomComponent::on_json_message);

  }

  void on_message_switch(const std::string &payload) {

    if (payload == "ON") {

      dimmer.setState(ON);

      publish("c01/panel_1/output/dimmer1/state", "ON");

    } else {

      dimmer.setState(OFF);

      publish("c01/panel_1/output/dimmer1/state", "OFF");

    }

  }

  void on_message_speed(const std::string &payload) {

      speed = atoi( payload.c_str() );

      dimmer.setState(ON);

      publish("c01/panel_1/output/dimmer1/state", "ON");

      dimmer.setPower(speed);

      publish("c01/panel_1/output/dimmer1/speed/state", payload);

  }

};
1 Like

Used a minikit to drive a quad dimmer module using the ac_dimmer platform but I got a very non-linear response on LED fixtures with flickering at certain dim levels. Modifying the intensity of a channels or turning it on/off affected the lights on the other channels. When I did a bench try using a single LED fixture, it worked fine – so I has a disappoint.

I’m also experiencing flickering … did you ever find a solution to this dimmer ?

Ever found a solution for ‘FLIKKERING’ on tasmota (ESP8266 / EPS12F ) ?

Thanks

Can you reproduce the flickering with esphome?

Update to TASMOTA 13.2.0 solved the issue

Tasmota 13.2.0 and 13.3.0 both flickers on ESP32 with RobotDyn AC dimmer. :frowning:
It’s quite strange, that even after years there is no solution for a 50Hz dimmer with a dual core 240MHz CPU.

Is it a tasmota issue or hardware issue?

Tasmota issue. On ESP32 it flickers, on ESP8266 it crashes/restarts after a few minutes (tried with 3 different boards). Tasmota v13.3.0

Even Sonof D1 dimmer has a standalone microcontroller for the zero-cross based dimming, which communicates with the ESP8266 through serial (see: Sonoff D1 Dimmer released - #6 by robbz23 lower right chip). I’ve configured an ESP8266 bord as a Sonoff D1 dimmer and I can see the serial commands it sends out, next step will be to make an ATtiny85 based project that “converts” these serial commands to dimming, like this: Voltage controlled dimmer with an ATtiny85 - Exhibition / Gallery - Arduino Forum but with serial instead of 0-5V control (PWM on ESP has flickering on it’s own also, in my experience).

But now I run out of time. :confused:

Can you reproduce the flickering/crashes with esphome?

I haven’t tried ESPHome yet, I had no time to work anything hardware related in the past month. I hope I will get back to this dimmer issue in the next month.