[ESP8266] WiFi Neo light dimmer NAS-DM01W with TuyaMCU

Some time ago I discussed WiFi light switches NAS-SC01W-1/NAS-SC01W-3 , I showed how to change their firmware and specified the pinouts of their non-standard WiFi module (ESP8266-MZ-V1). Now it's time for a dimmer from the same series. Here I will also provide the necessary information for those who want to change the batch for it. This time briefly, the specifics themselves, as a similar situation has already been discussed in the forum.
Dimmer NAS-.DM01W
This product can also be purchased on Polish mail order services. It costs about PLN 100 (25$), but thanks to shipping from our country we can receive it literally in 2 days.
Let's see for a start what is included in the kit:



It seems there is only manual attached, they didn't even give the screws! Anyway, let's look inside:





Here we have:
- WiFi module ESP8266-MZ-V1 Neo
- touch button controller BS813A-1
- microcontroller (in the role of TuyaMCU) SB10 F8G A0TISK 1938
- PCB designation: NAS-DM01W0-T-V4 20190530
The microcontroller from TuyaMCU connects to ESP8266 via UART. It will not be possible to upload firmware without cutting the paths or putting TuyaMCU in RESET state.
Here you can also deal differently with cutting TuyaMCU from WiFi module for programming time - you can solder R50 and R51 - see PCB photos.

https://www.elektroda.pl/rtvforum/topic3933329.html
Detailed topic about dimmer and Tasmot: https://www.elektroda.pl/rtvforum/topic3825966.html#19575303
If you don't want to cut the tracks/solder the MCU to upload the batch, then you should try Tuya Convert:
https://www.elektroda.pl/rtvforum/topic3769864.html
TuyaMCU communication with WiFi module
The TuyaMCU transmits variables to itself with the WiFi module via the UART, using a special protocol for this:
https://developer.tuya.com/en/docs/iot/tuya-c...-serial-port-access-protocol?id=K9hhi0xxtn9cb
TuyaMCU variables are identified by their ID, and in order to add support for this switch to Tasmota we need to know what is available under which ID:
https://tasmota.github.io/docs/TuyaMCU/
Specially for you, I collected the communication of this switch with TuyaMCU (I just "tapped" with the UART adapter first the RX-TX line, looking from the WiFi modules, and then TX-RX) and decoded it with a tool specially written for this (but about that another time).
Here are the results:

There are two important variables:
- Bool type, ID 1 - status of the On/Off switch
- Value type, ID 2 - brightness level (range from 0 to 1000)
I still detected variables with IDs 3 and 4, but I didn't detect how they could be used.
The ID of this device is {"p": "pkf6ggaaofgot9bk", "v": "1.0.0", "m":0}
Some sample packets overheard from TuyaMCU
Here's some information for the curious or for those wanting to e.g. program the ESP to control the dimmer yourself.
Package that sets the state of the switch to ON:
55AA030700050101000101125

Package that sets the brightness to 10% (100 with a maximum value of 1000):
55AA0307000802020004000000647D

The "welcome" package (TuyaMCU "greets" the WiFi module and presents its ID):
55AA0301002A7B2270223A22706B6636676761616F66676F7439626B222C2276223A22312E302E30222C226D223A307D1B

Summary This was a slightly shorter topic than usual, but Tasmota has been discussed on the forum more than once, the TuyaMCU protocol also has its own separate topic, the dimmer on Tasmota and TuyaMCU I have also already presented, and the twin switch also based on ESP8266-MZ-V1 module I showed less than a month ago.
On the other hand, the original Tuya application I have already discussed from two years ago.
Although, I hope that the information shown here will be useful to someone - what I have provided here should be enough to make this product cloud-free.
I will just remind here that in the case of TuyaMCU, it is the additional MCU that usually takes care of everything and the WiFi module only sends (or receives) commands to it. This is why we are only interested in the IDs of the variables and their types, we are not looking here as usual for "which pin is the relay on".
If, on the other hand, you hit something no longer on ESP but on BK, you can refer to this topic:
Dimmer EDM-01AA-EU 300W on BK7231 and TuyaMCU - configuration .
Comments
Why does an additional MCU sit in this case? After all, there are dimmers and ESP embraces everything. [Read more]