Finally! A Tasmota WiFi Dimmer with MQTT

hello. congratulations!!! I have the PS16DZ wifi dimmer, it works with the ewelink app and have an esp8285. Do you know if I flash it with tasmota will work too with the " 49-Tuya Dimmer" options?. thanks

I’d probably have to bet money on no as the serial protocol between the two chips are following the TUYA serial API. I did see this on their site but one of the versions said it didn’t work with LED bulbs so I didn’t purchase it yet to reverse engineer it.

Well done and great video! I just ordered one and hope to get it working too (assuming don’t break it while soldering). For the price, this blows the WeMo dimmer out of the water and I find MQTT/Tasmota to be more reliable & easier to manage anyway :smile: Thanks for providing the pre-compiled .bin to get us up and running. It will be extra nice when it gets merged into the official FW.

One last thing I need to tackle is the reset mode. I need to buy me another one instead of having to take it out of production each time to the bench. Need to solder it again, flash the factory firmware back and do some snooping again when I go through the WiFi reset process to see what the other chip is sending over so I can grab those packets and force a “reset 1” to Tasmota. Otherwise there’s no way to change your WiFi info once it is in the wall.

1 Like

I just saw they are running an Amazon Lightning Deal too for $23.79.

To anyone that is using this in Home Assistant, with the big help of wkd2639 on the DrZzs Discord channel we were able to get a better brightness template to help deal with the way Tasmota reports the dimming to HomeAssistant. The previous version would cause some cosmetic errors to show up in your HomeAssistant logs. I’ve updated the template on the GitHub page as well as posting it here.

Change the brightness template entities to match your entity name as well as the topic names.

- platform: mqtt
  name: "TuyaDimTest"
  state_topic: "stat/TuyaDimTest/POWER"
  command_topic: "cmnd/TuyaDimTest/POWER"
  availability_topic: "tele/TuyaDimTest/LWT"
  brightness_state_topic: "stat/TuyaDimTest/RESULT"
  brightness_command_topic: "cmnd/TuyaDimTest/Dimmer"
  brightness_scale: 100
  brightness_value_template: >
    {% if value_json.Dimmer is defined %}
      {{ value_json.Dimmer }}
    {% else %}
      {% if state_attr('light.tuyadimtest','brightness') == none %}
      {% else %}
        {{ state_attr('light.tuyadimtest','brightness') / 255 * 100 }}
      {% endif %}
    {% endif %}
  qos: 1
  payload_on: "ON"
  payload_off: "OFF"
  payload_available: "Online"
  payload_not_available: "Offline"
  retain: false
1 Like

I just got mine in today, soldered and flashed it, and got it talking to my MQTT server. Thanks for the hard work!

Awesome! Thanks for the report back. I’ll have an update to the firmware soon that allows the long press function of 5 seconds to reset the WiFi into AP mode to change the SSID/Password. Currently the long press turns the LED red but doesn’t do anything.

I’d love to move to a nice looking MQTT dimmer like this. I noticed the dimmer is leading-edge (TRIAC). Is this working well for you with LED bulbs?

Awesome job!

I did try it with some cheap run of the mill LED bulbs that say non dimmable and indeed it flips out. I tried a few different brands of bulbs I had of LED that were dimmable and they do work fine. They just have different scales and none of them are linear.

I just got mine a few days ago and I am super excited to flash it. I am going to wait for @digiblur to upload the new version with the 5 second long press implementation.

I have it partially finished and it does trigger Tasmota to reset the device into Wifi Manager AP mode but I’ve run into some issues finding a spot based on scenarios to reset the red LED status to show the WiFi is working again. Hopefully in a few days.

Just finished installing the first one, works great! Thank you!

Just curious if you have thought of a way to deal with the non-standard bezel size? I’m thinking I might just be modifying some decora switch plates to deal with multi-gang installs.

I saw a picture somewhere recently where they made one fit in a 2 gang with a dremel. I’ll see if I can find it, think they shaved a bit off the switch and faceplate. It actually looked pretty good!

Found it.


I asked support if they support 240v no reply yet though :frowning:

Not sure if i should just risk it and buy it direct from them for $31 (amazon wont ship it all the way to OZ - but the distributor will)

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.


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?