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!
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.
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!
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.
Tasmota 13.2.0 and 13.3.0 both flickers on ESP32 with RobotDyn AC dimmer.
It’s quite strange, that even after years there is no solution for a 50Hz dimmer with a dual core 240MHz CPU.
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).
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.