Finally! A Tasmota WiFi Dimmer with MQTT

This has been something I’ve been looking for quite some time to add to my home. I spent a LOT of time on the reverse engineering, snooping serial communications between the two chips in this dimmer, and incorporating all the necessary changes in Tasmota. I do believe it is all worth it though to see it finally finished! Enjoy!

Thanks to enesbcs at the ESPEasy forums for making me take a second look at the serial comms on this model to get things figured out.

28 Likes

Thanks for posting this. Good to know that this option exists. Video was clear and to the point.

Cheers.

Almost!!! We are getting closer… need one for 240v I hope they bring one out!

It does say on the back 110-250v 50/60hz but then the size might be an issue based on the boxes you have. I’m checking around with the vendor to see if they have other form factors.

1 Like

Awesome great to know, just got to figure out how to get them into Australia then!

Don’t have any wall boxes in Au, but they won’t match any of the other switches will be my issue, but they solve so many other problems!

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. https://amzn.to/2zrGCou

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 %}
        0
      {% 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.

image

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)