Finally! A Tasmota WiFi Dimmer with MQTT

Finally had some time to get this set up. The flashing worked first try and overall process went very smoothly thanks to @digiblur for the great video! I did experience some odd behavior and wanted to ask if anyone has ideas.
After installation, my dimmable led bulbs (which work perfectly fine with the non-smart dimmer) would randomly flash/flicker to full brightness and back regardless of the brightness setting on the switch. Testing again with some regular incandescent bulbs worked 100% fine so I’m guessing the issue is my current led bulbs. Is there a particular brand of dimmable led bulb (daylight color, B12 socket) that is known for not flickering?

On the back of the box, it does say 100v-250v AC 50/60hz. I’ll snag a picture of the specs as it is kind of hard to see on the video.

2 Likes

Thanks for the kind words on the setup process!

I haven’t had this with the two particular bulbs I have in it that are some GE bulbs that mention they are dimmable. I have tested with some generic bulbs from Home Depot that say dimmable on them. How often does the flickering happen?

I do have this particular issue with some Edison style filament 5000k bulbs in my kitchen that state they are dimmable. They are using a Zwave dimmer that I bought a year ago or so. They seem to surge at times which is weird. I spent quite a bit of time reading up on the many issues with dimming LEDs as there really isn’t a standard out there. I’ll have to test one of these bulbs in the dimmer and see what happens.

Thanks for the reply. It’s kind of like lightning during a storm… no regularity with the timing and when it happens, it’s really bright. I ordered some dimmable Phillips bulbs from Home Depot and they should be in by the weekend. Hopefully they will fix the flickering.:crossed_fingers: Either way I’ll definitely report back after I try them out.

@digiblur Maybe there’s a way where the min duty cycle could be configured (HTTP/MQTT) so that the dimmer will always illuminate the bulb correctly?

Min duty cycle? Like changing the range?

There isn’t much in the way of configuration to change on the dimmer. There’s two micro controllers involved here. The ESP8266 where Tasmota or the Stock Tuya firmware lives is more like a glorified middle man. All it does it handle the 2 way communications back and forth for WiFi. If the firmware was dead, the switch would still function at the faceplate itself, dimming, on/off, etc. Of course it wouldn’t send out states or receive commands via WiFi though. If there is anything you want to change of the switch itself, you’d need to modify the firmware on the secondary microcontroller as it does all the dimming, faceplate LED control, etc.

Hey there! Are you ok with wi fi devices? I have talked to my provider, they said, that for correct working router you needed not to have more than 15 devices at local network. I have aroud 10-13 and there is only 2 “smart home” device (aqara hub, camera). How many devices do you have? Is your network stable with bunch of wi fi switches?

I have around 45 devices between 5gh and 2.4. Utilization is low according to the 2 access points. Think the most I have had on my network was about 60 or so devices with additional people over for get togethers. No issues especially when I have Ubiquiti UniFi access points. If I get into a crunch I can always add a third access point.

15 devices? I don’t think I have had 15 in a long time. We aren’t talking about 60 tablets trying to watch Netflix at one time.

WiFi is my go to honestly. Zwave is a mess and slow and even fails to work at times in my some what rural area due to some sort of interference. Wifi just works, cheaper, easier to troubleshoot, no device hopping, plus I can control it all with the code on the Esp chips. Win win.

Cool, thank you for info. Will have a look to wi fi devices too.

I guess I was thinking if there was a way to have the ESP8266 make an offset to the dimmer scale that it would maybe be able to play a bit of telephone game with the other MCU’s. Is there a place in the code I can see the communication going back and forth between the three controllers?

Hmm…I guess you could but then the scale would be wrong on the actual switch though. If that would be okay, then yeah the scale can be changed.

So what I was hoping was that the ESP8266 was the middle-man between the dimmer MCU (the one controlling TRIAC) and the UI MCU (the once handling faceplate). Looks like this isn’t the case?

You don’t relay the interaction between the dimmer and faceplate. You just get messages from one of these controllers and process in TuyaPacketProcess() and push messages with SetDevicePower(), correct?

No, because even when I was first troubleshooting and such with so custom code to capture stuff the faceplate was still working.

The TuyaPacketProcess is to capture any packets that come from the dimming MCU and update Tasmota so it can push them out to the appropriate channels such as MQTT, GUI, etc.

SetDevicePower is a send from Tasmota to tell the dimming MCU to shut down the power to the light much like if the user pushed the button.

There is another dimmer I’m working on that has more of the functionality you are looking for as Tasmota will have to control 5 status LEDs, the Power LED, and receive the up/down & on/off toggles and push the commands to the dimmer MCU, from what I can tell the protocol is one way. Hard to work on this one was I let the magic smoke out of one unit already. MartinJerry dimmer.

My original bulbs were indeed the cause of the lightning-like flickering. The new Phillips bulbs are working perfectly and 100% flicker free!

1 Like

Sorry for the delay, I had some things to work out but this bin should work for you. I tested the code on mine and it goes into AP mode with the 5 second hold. I do have to cycle power on the unit to get the red LED to go off. I’m working on the last cosmetic piece of flipping this LED status back over.

https://github.com/digiblur/TuyaDimmer-Tasmota/raw/master/TuyaDimmer_Tasmota_6216b.bin

Awesome! I decided to install mine last week because I couldn’t wait and everything is working great! Also, I know some people were having issues with LED bulbs, I have “dimable” non-smart led bulbs and everything seems to work just as it did with previous dumb dimmer switch. I believe mine are the Utilitech (Lowes) brand and they seem to work fine. They are also pretty cheap for anyone looking to make the switch.

Good news! The commit for this was merged into the Tasmota development branch!

i just bought this tuya dimmer

in my house i have a suno dimmer by legrand

I would like to ask if is it possible to change the original tuya ,leaving the touch and changing to a fisical dimmer.
Regards

I bet it uses the same protocol that is supported in the main branch of Tasmota now, have you tried the firmware?

Yes… It has tasmota firmware already, but what i want to do is change the touch for a Analogue style rotary dimmer switch. I would like to know if it is possible