Elektroda.com
Elektroda.com
X

TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

crash1912 1332 26

  • Hello, I recently bought this DIN power meter, it looks good, does anyone have this model with OpenBK working correctly?
    I have searched a lot in the forum and I have not found anything related to this model, so I open a thread.

    The brand of the device is TOMZN and the model is TOMPD-63LW 63A, apparently it is similar to TOMZN TOML-VA 63A.

    I'm new to this and need some initial help.

    Specs:
    The product can cut off L and N both.
    Rated voltage: 230V; Frequency: 50Hz/60HZ
    1. Remote control ON/OFF at anytime from anywhere by phone.
    2. Review current, voltage, leakage current, total kWh on phone.
    3. Timer function in smartlife TUYA app.
    4. Can set over voltage/under voltage/over current/leakage current in app or can set these by manual.
    5. Under voltage protection 140V-210V (adjustable) (default: 170V).
    6. Over voltage protection 225V-295V (adjustable) (default: 265).
    7. Over current protection 1A-63A (adjustable) (default: 40A).
    8. Reconnect time (delay on time): 1s-500s (default: 30s).
    9. Voltage/current/kW calibration: -9.9%-9.9%.
    10. Action time: 1-30s (default 1s).
    11. Power consumption less than 2W.
    12. White backlight.

    Here are all the images he was able to collect.

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T) TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T) TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T) TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T) TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T) TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T) TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T) TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T) TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    Cool? Ranking DIY
    About Author
    crash1912
    Level 4  
    Offline 
    crash1912 wrote 14 posts with rating 1. Live in city Extremadura. Been with us since 2023 year.
  • Helpful post
    #2
    p.kaczmarek2
    Moderator Smart Home
    I guess it's a TuyaMCU device, so it will work without any problem. Do you know how to do UART data capture in a safe manner? This device is mains powered, so doing capture may be dangerous.

    We could also skip capture and just first do flash 2MB read (backup) and then flash OBK to it and try to configure.... it should also work, just make sure to do a backup. In worst case you can always restore 2MB flash backup.

    Have you checked out the similar topics on our forum? The procedure here should be very similar. The dpIDs may be different, but in general, it should go smoothly.

    Feel free to ask any specific questions, I can also guide you step by step, if that's needed.
  • #3
    DeDaMrAz
    Level 13  

    @crash1912

    Can you take a better picture, maybe of the bottom board? And if possible, maybe include the markings from the LCD controller?
  • #4
    crash1912
    Level 4  

    >>20693586

    Thanks for answering, I'm new to this, I have a moment of mental garbage with a lot of information, openbk, tasmota, esphome... but I'm advancing little by little.
    I don't know how to do UART data capture in a safe manner (sounds interesting to me!), if it's powered by 3.3v power supply and using tx rx pin then I have necessary hardware but I don't know how to proceed.

    If backup is connecting 3.3v, gnd, rx and tx then i think i can do it.
    Surprise for me, I have another TOMPD-63LW unit (I bought 4) and this one allows to disassemble boards much better, it is possible that I can do backup without soldering wires... (or is there another way of backup?)

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    Added after 2 [minutes]:

    >>20693615

    Surprise for me, I bought 4 units and not all same exactly equal boards connection system.
    In this other unit can take better board pictures!

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T) TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T) TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T) TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T) TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)
  • Helpful post
    #5
    p.kaczmarek2
    Moderator Smart Home
    What is under capacitor here:
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)
    This is WB3S bot:
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)
    (Bottom view, not top view!).
    Where is RX1 and TX1 connected, where is GND, where is VDD? Is it broken out on that non populated pin header?
    Where else UART1 leads?
    Are there any other GPIOs routed out?
  • Helpful post
    #6
    DeDaMrAz
    Level 13  

    @crash1912

    There is a similar post you can read - https://www.elektroda.com/rtvforum/viewtopic.php?p=20686225#20686225

    Also, you can check this post on how to do UART capture safely - https://www.elektroda.com/rtvforum/viewtopic.php?p=20667319#20667319

    And you can, of course, search for topics regarding TuyaMCU analyzer and UART capture.

    In general, I think there is a hidden TuyaMCU under the electrolytic cap on one of your pictures which is responsible for reading data and LCD control. And it also communicates with the Wi-Fi (WB3S) module over UART.
  • #7
    p.kaczmarek2
    Moderator Smart Home
    You may be right. I can see UART traces there. They go through resistors.
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)
    That would mean that one would have to desolder them to temporary sever connection for the time of flashing.
    Or.... one could check if the MCU has some kind of RESET pin.
  • #8
    crash1912
    Level 4  

    >>20693745

    With a multimeter, I can't find continuity between TX1, RX1, and any other board connection pin, only VDD and GND. I think I'll need to solder wires on TX1 and RX1...

    Under the capacitor, I can see:
    HC89F0541
    2242R1
    AA5062161


    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    Added after 3 [minutes]:

    >>20693799

    Would that really mean that they would have to be desoldered to temporarily cut the connection when flashing? Soldering directly to TX1, RX1, VDD, GND not enough?
  • Helpful post
    #9
    p.kaczmarek2
    Moderator Smart Home
    crash1912 wrote:

    With a multimeter I can't find continuity between TX1, RX1 and any other board connection pin, only VDD and GND, I think I'll need to solder wires on TX1 and RX1...

    Well, no surprises here, considering that it clearly looks like TX1 and RX1 go through resistors to MCU:
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    crash1912 wrote:

    Under capacitor i can see:
    HC89F0541
    2242R1
    AA5062161

    It's TuyaMCU.
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    crash1912 wrote:

    Would that really mean that they would have to be desoldered to temporarily cut the connection when flashing? Soldering directly to TX1, RX1, VDD, GND not enough?

    Usually yes, but if you look at the HC89F0541 pinout above, you can see that it may have a RST signal at 22 pin of TQFP case. So, it may be possible to disable that MCU for the time of the flashing by grounding it's pin 22. If you do that, then cutting traces may not be required.

    In general, TuyaMCU is a device where WiFi module talks via UART with secondary MCU. The same UART is used for flashing. So, to flash, you need to either:
    a) put MCU in the RESET state (if possible)
    b) temporary cut the traces

    Added after 49 [seconds]:

    crash1912 wrote:
    Soldering directly to TX1, RX1, VDD, GND not enough?

    Just soldering it in case of TuyaMCU is usually not enough, but one can always try...
  • #10
    crash1912
    Level 4  

    You are right, without a bridge between pin 22 and GND, you cannot read/write anything.

    Using a little mini hook, I can create a bridge without soldering. For TX/RX, I held male pins to the board using my hands during backup and flashing (things one can do to avoid soldering... 😅)

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    The backup and flash were successful using bk7231flasher_1.1.1. Now the device has the OpenBK7231T_UA_1.17.221.bin firmware (hopefully this is the correct firmware...). I'm not sure about the difference between UG, UA, or QIO, RBL. I understand that the UART version is better for my case, but I don't know if other flash methods exist (UG, RBL, QIO...).

    Is the extracted firmware generic or does it contain custom data only for my device? Same as MAC address, keys, etc...
    If the backup is safe to share, I can attach it to the main post so that anyone who needs it can use it.

    Okay, now I have OpenBK 1.17.221, great! What is the next step?

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)
  • #11
    p.kaczmarek2
    Moderator Smart Home
    2MB flash can contain your SSID if you paired it.

    Please post if you can, if not, please post only Tuya JSON.

    See how to extract JSON:



    This will tell us which baud rate is your device using.
  • #12
    crash1912
    Level 4  

    The device is new, never used, does not contain any personal data configured for me. If it contains anything, it is from the factory (any device key or anything, I don't know).
    I have attached a backup to this answer. I hope it is correct. I don't know if I must upload it to an external server like Mega, etc.

    The extracted JSON appears incorrectly. I tried to extract this from the original backup before the flash, and now again the same as the video shared by you, both with the same data:
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    And after flash OpenBK(now)

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)
  • #13
    p.kaczmarek2
    Moderator Smart Home
    That's good enough. Well done. So baud rate is the default, slow-speed one. Okay, so let's start with this autoexec.bat:
    
    // start TuyaMCU driver
    startDriver TuyaMCU
    // always force 0x04 WiFi state (paired to cloud), otherwise TuyaMCU might skip some data points
    tuyaMcu_defWiFiState 4
    

    This is autoexec.bat, create it in Web App -> LittleFS tab. Then save and reboot.

    Then open Web App log, and let's see what kind of data will be received. We will need to figure out the meaning of received data.

    Please see similar topic:
    https://www.elektroda.com/rtvforum/topic3959907.html

    Are you able to toggle the relay state on this device (does it even have a relay) from a physical button? If so, also do so, and look at the logs. Which dpID changes when you toggle the relay?

    Added after 1 [minutes]:

    EDIT: I looked at the first post, it seems this device also has some more buttons on case. So, you will need to also test those buttons. See what is being sent via TuyaMCU.

    Also note down the voltage readings, the current reading, etc.

    maybe put a 60W bulb load and then note down the voltage, current and power. Then post here separate Web App log. We will be searching for 60W, etc, in that log.
  • #14
    crash1912
    Level 4  
    Ok now driver is already loaded:
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    Yes, i can toggle relay from physical button.
    In the recording tab, the data is very abundant, these are the minimum that I can capture after relay-off relay-on toggle with a 60w bulb connected(64w according to the meter display).

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    Info:MAIN:Time 6228, idle 252632/s, free 85312, MQTT 0(389), bWifi 1, secondsWithNoPing 6158, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 1 is not mapped
    Info:MAIN:Time 6229, idle 256658/s, free 85312, MQTT 0(389), bWifi 1, secondsWithNoPing 6159, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 6230, idle 243655/s, free 85312, MQTT 0(389), bWifi 1, secondsWithNoPing 6160, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.206 gate=192.168.1.1 mask=255.255.255.0 mac=1c:90:ff:b9:46:9a
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-63,ssid=MyWifi-2G,bssid=xx:xx:xx:xx:xx:xx,channel=1,cipher_type:CCMP
    Info:MAIN:Time 6231, idle 246901/s, free 85312, MQTT 0(389), bWifi 1, secondsWithNoPing 6161, socks 2/38 
    Info:MAIN:Time 6232, idle 259361/s, free 85312, MQTT 0(389), bWifi 1, secondsWithNoPing 6162, socks 2/38 
    Info:MAIN:Time 6233, idle 272051/s, free 85312, MQTT 0(389), bWifi 1, secondsWithNoPing 6163, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:MAIN:Time 6234, idle 251364/s, free 85312, MQTT 0(389), bWifi 1, secondsWithNoPing 6164, socks 2/38 
    Info:MAIN:Time 6235, idle 232144/s, free 85312, MQTT 0(389), bWifi 1, secondsWithNoPing 6165, socks 2/38 
    




    This is same but more extended with more switch button pressed more times

    
    Info:MAIN:Time 6649, idle 254434/s, free 85312, MQTT 0(415), bWifi 1, secondsWithNoPing 6579, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 6650, idle 259462/s, free 85312, MQTT 0(415), bWifi 1, secondsWithNoPing 6580, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.206 gate=192.168.1.1 mask=255.255.255.0 mac=1c:90:ff:b9:46:9a
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-67,ssid=MyWifi-2G,bssid=xx:xx:xx:xx:xx:xx,channel=1,cipher_type:CCMP
    Info:MAIN:Time 6651, idle 247324/s, free 85096, MQTT 0(415), bWifi 1, secondsWithNoPing 6581, socks 3/38 
    Info:MAIN:Time 6652, idle 254689/s, free 85312, MQTT 0(415), bWifi 1, secondsWithNoPing 6582, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 1 is not mapped
    Info:MAIN:Time 6653, idle 258649/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6583, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 6654, idle 241020/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6584, socks 2/38 
    Info:MAIN:Time 6655, idle 249900/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6585, socks 2/38 
    Info:MAIN:Time 6656, idle 257104/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6586, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 8 is not mapped
    Info:MAIN:Time 6657, idle 252450/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6587, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:MAIN:Time 6658, idle 243180/s, free 85096, MQTT 0(416), bWifi 1, secondsWithNoPing 6588, socks 3/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 8 is not mapped
    Info:MAIN:Time 6659, idle 240411/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6589, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:MAIN:Time 6660, idle 521879/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6590, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.206 gate=192.168.1.1 mask=255.255.255.0 mac=1c:90:ff:b9:46:9a
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-67,ssid=MyWifi-2G,bssid=xx:xx:xx:xx:xx:xx,channel=1,cipher_type:CCMP
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 8 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 8 is not mapped
    Info:MAIN:Time 6661, idle 255484/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6591, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 8 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 8 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 8 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 8 is not mapped
    Info:MAIN:Time 6662, idle 231424/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6592, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 8 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:MAIN:Time 6663, idle 192348/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6593, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 8 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 8 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 8 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:MAIN:Time 6664, idle 421966/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6594, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 1 is not mapped
    Info:MAIN:Time 6665, idle 213992/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6595, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 6666, idle 239892/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6596, socks 2/38 
    Info:MAIN:Time 6667, idle 247293/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6597, socks 2/38 
    Info:MAIN:Time 6668, idle 509191/s, free 85312, MQTT 0(416), bWifi 1, secondsWithNoPing 6598, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 6669, idle 255650/s, free 85312, MQTT 0(417), bWifi 1, secondsWithNoPing 6599, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:MAIN:Time 6670, idle 252890/s, free 85312, MQTT 0(417), bWifi 1, secondsWithNoPing 6600, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.206 gate=192.168.1.1 mask=255.255.255.0 mac=1c:90:ff:b9:46:9a
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-67,ssid=MyWifi-2G,bssid=xx:xx:xx:xx:xx:xx,channel=1,cipher_type:CCMP
    Info:MAIN:Time 6671, idle 232644/s, free 76696, MQTT 0(417), bWifi 1, secondsWithNoPing 6601, socks 3/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 1 is not mapped
    Info:MAIN:Time 6672, idle 256023/s, free 85312, MQTT 0(417), bWifi 1, secondsWithNoPing 6602, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 1 is not mapped
    Info:MAIN:Time 6673, idle 239796/s, free 85312, MQTT 0(417), bWifi 1, secondsWithNoPing 6603, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 0 is not mapped
    Info:MAIN:Time 6674, idle 222288/s, free 85312, MQTT 0(417), bWifi 1, secondsWithNoPing 6604, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 1 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 9 with value 0 is not mapped
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Debug:TuyaMCU:TuyaMCU_ApplyMapping: id 16 with value 0 is not mapped
    Info:MAIN:Time 6675, idle 225870/s, free 85312, MQTT 0(417), bWifi 1, secondsWithNoPing 6605, socks 2/38 
    Info:MAIN:Time 6676, idle 230429/s, free 85312, MQTT 0(417), bWifi 1, secondsWithNoPing 6606, socks 2/38 
    Info:MAIN:Time 6677, idle 255862/s, free 85312, MQTT 0(417), bWifi 1, secondsWithNoPing 6607, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 6678, idle 253712/s, free 76696, MQTT 0(417), bWifi 1, secondsWithNoPing 6608, socks 3/38 
    
  • #15
    p.kaczmarek2
    Moderator Smart Home
    There isn't much in the logs, but they seem to suggest that dpID 16 is a boolean, it may be a relay.

    So, now autoexec.bat should look like:
    
    
    // start TuyaMCU driver
    startDriver TuyaMCU
    // always force 0x04 WiFi state (paired to cloud), otherwise TuyaMCU might skip some data points
    tuyaMcu_defWiFiState 4
    // let's choose that channel 1 will be main relay state
    setChannelType 1 toggle
    // label it
    setChannelLabel 1 "Relay"
    // link dpID 16 to channel 1
    linkTuyaMCUOutputToChannel 16 bool 1
    

    PS: when you look at the EAMPDW-TY63 Alternative Firmware: Access Measurement Data with OpenBeken via TuyaMCU topic, it seems they also have dpId 16 used for relay. So maybe configs would be similar...
  • #16
    crash1912
    Level 4  
    Correct, DP16 is a power switch relay! and using configuration from EAMPDW-TY63 now can see more data! but some is wrong...
    OverVoltage, UnderVoltage, Current and Leakage values appears 0, but OverVoltage is 270, UnderVoltage is 200, leakage current is 0 but set cut value is 20, and missing power factor values too.

    In other side, i'm happy viewing power values... but... only change in 2 minutes interval 😶, i understand this shit is possible hardware limited by factory, in lcd screen refresh each 0.5s, oh my god 2 minutes in remote... my first reason to flash was remove this bigger delay. F*ck! 😅
    I have 4 useless units! Ok, okay, I still want to get the best possible configuration so that they can serve other users who don't care so slow and inaccurate refresh values.


    This is configuration applied to autoexec.bat
    
    // start TuyaMCU driver
    startDriver TuyaMCU
    // always force 0x04 WiFi state (paired to cloud), otherwise TuyaMCU might skip some data points
    tuyaMcu_defWiFiState 4
    startDriver NTP
    
    // let's choose that channel 1 will be main relay state
    setChannelType 1 toggle
    // label it
    setChannelLabel 1 "Relay"
    //linkTuyaMCUOutputToChannel 16 1 1
    
    setChannelType 2 Voltage_div10
    setChannelType 3 Power
    setChannelType 4 Current_div1000
    setChannelType 5 EnergyTotal_kWh_div100
    setChannelType 6 toggle
    setChannelLabel 6 "Clear energy"
    setChannelType 7 toggle
    setChannelLabel 7 "Prepayment"
    setChannelType 8 toggle
    setChannelLabel 8 "Mute"
    setChannelType 9 toggle
    setChannelLabel 9 "Trip"
    setChannelType 10 TextField
    setChannelLabel 10 "Set OverVoltage"
    setChannelType 11 TextField
    setChannelLabel 11 "Set UnderVoltage"
    setChannelType 12 TextField
    setChannelLabel 12 "Set Current"
    setChannelType 13 TextField
    setChannelLabel 13 "Set leakage"
    setChannelType 14 ReadOnly
    setChannelLabel 14 "ID "
    // link id 16 to channel 1
    linkTuyaMCUOutputToChannel 16 bool 1
    // link id 1 to channel 5
    linkTuyaMCUOutputToChannel 1 val 5
    // TAC2121C VoltageCurrentPower Packet
    // This will automatically set voltage, power and current
    linkTuyaMCUOutputToChannel 6 RAW_TAC2121C_VCP
    linkTuyaMCUOutputToChannel 12 bool 6
    linkTuyaMCUOutputToChannel 11 bool 7
    linkTuyaMCUOutputToChannel 105 bool 8
    linkTuyaMCUOutputToChannel 106 bool 9
    linkTuyaMCUOutputToChannel 101 2 10
    linkTuyaMCUOutputToChannel 102 2 11
    linkTuyaMCUOutputToChannel 103 2 12
    linkTuyaMCUOutputToChannel 104 2 13
    linkTuyaMCUOutputToChannel 19 3 14
    


    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)
  • #17
    p.kaczmarek2
    Moderator Smart Home
    How does your current web app log looks like? Which dpIDs are working? You've jumped quickly to very advanced config and I am not sure if it's entirely correct.

    Have you tried to use tuyaMcu_sendQueryState command to get full state dumps quicker than default 2 minutes?
  • #18
    crash1912
    Level 4  
    Ok, well I think so too, I've gone too fast :)

    tuyaMcu_sendQueryState force refresh arbitrary? this looks good!! I like this!! Works great!! ¿Can refresh each 5~10s automatically?

    ok, now let's talk about the dpID's. I'm bit confused, when define "linkTuyaMCUOutputToChannel 16 bool 1" 16 is "dpID" and "1" is arbitrary channel?
    By default all channels is free to use? I can set any dpID to any channel choose by me?

    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    Ok, now let's see the current configuration
    
    // start TuyaMCU driver
    startDriver TuyaMCU
    // always force 0x04 WiFi state (paired to cloud), otherwise TuyaMCU might skip some data points
    tuyaMcu_defWiFiState 4
    startDriver NTP
    
    // let's choose that channel 1 will be main relay state
    setChannelType 1 toggle // works fine!
    // label it
    setChannelLabel 1 "Relay"
    
    setChannelType  2 Voltage_div10 // correct value
    setChannelType  3 Power // correct value
    setChannelType  4 Current_div1000 // correct value
    setChannelType  5 EnergyTotal_kWh_div100 // *possibly correct value
    
    setChannelType  6 toggle // i think this doesn't work, on/off apparently doesn't change any function
    setChannelLabel 6 "Clear energy" 
    setChannelType  7 toggle // * i think this works, with this enabled, i cannot turn on main relay (i think possible stored prepay value is 0)
    setChannelLabel 7 "Prepayment" 
    setChannelType  8 toggle // i think this doesn't work, on/off apparently doesn't change any function
    setChannelLabel 8 "Mute" 
    setChannelType  9 toggle // i think this doesn't work, on/off apparently doesn't change any function
    setChannelLabel 9 "Trip" 
    
    setChannelType  10 TextField // shows 0
    setChannelLabel 10 "Set OverVoltage"
    setChannelType  11 TextField // shows 0
    setChannelLabel 11 "Set UnderVoltage"
    setChannelType  12 TextField // shows 0
    setChannelLabel 12 "Set Current"
    setChannelType  13 TextField // shows 0
    setChannelLabel 13 "Set leakage"
    setChannelType  14 ReadOnly // shows 825373492
    setChannelLabel 14 "ID "
    
    // link id 16 to channel 1
    linkTuyaMCUOutputToChannel 16  bool 1 // Main Relay
    
    // link id 1 to channel 5
    linkTuyaMCUOutputToChannel 1   val  5 // possibly correct value
    
    // TAC2121C VoltageCurrentPower Packet
    // This will automatically set voltage, power and current
    linkTuyaMCUOutputToChannel 6   RAW_TAC2121C_VCP // how works this?
    
    linkTuyaMCUOutputToChannel 12  bool 6 // unknown
    linkTuyaMCUOutputToChannel 11  bool 7 // i think possible prepay switch
    linkTuyaMCUOutputToChannel 105 bool 8 // unknown
    linkTuyaMCUOutputToChannel 106 bool 9 // unknown
    linkTuyaMCUOutputToChannel 101 2    10 // unknown
    linkTuyaMCUOutputToChannel 102 2    11 // unknown
    linkTuyaMCUOutputToChannel 103 2    12 // unknown
    linkTuyaMCUOutputToChannel 104 2    13 // unknown
    linkTuyaMCUOutputToChannel 19  3    14 // unknown
    


    This log contains multiple tuyaMcu_sendQueryState:

    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 13 03 00 04 31 32 33 34 F5 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 19, dataType 3-DP_TYPE_STRING and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 825373492
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 11 00 00 04 04 01 00 14 3F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 67174420
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 12 00 00 0C 01 01 00 28 03 01 01 0E 04 01 00 C8 41 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 18, dataType 0-DP_TYPE_RAW and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 0A 22 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 10
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0F 02 00 04 00 00 00 00 26 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 15, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 06 00 00 08 09 5D 00 01 04 00 00 3E CC 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 11, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 13 03 00 04 31 32 33 34 F5 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 19, dataType 3-DP_TYPE_STRING and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 825373492
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 11 00 00 04 04 01 00 14 3F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 67174420
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 12 00 00 0C 01 01 00 28 03 01 01 0E 04 01 00 C8 41 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 18, dataType 0-DP_TYPE_RAW and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 0A 22 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 10
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0F 02 00 04 00 00 00 00 26 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 15, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 06 00 00 08 09 54 00 01 04 00 00 3D C2 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 11, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 13 03 00 04 31 32 33 34 F5 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 19, dataType 3-DP_TYPE_STRING and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 825373492
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 11 00 00 04 04 01 00 14 3F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 67174420
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 12 00 00 0C 01 01 00 28 03 01 01 0E 04 01 00 C8 41 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 18, dataType 0-DP_TYPE_RAW and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 0A 22 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 10
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0F 02 00 04 00 00 00 00 26 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 15, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 06 00 00 08 09 5E 00 01 04 00 00 3E CD 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 11, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 0A 22 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 10
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 11, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0F 02 00 04 00 00 00 00 26 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 15, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 06 00 00 08 09 5E 00 01 04 00 00 3E CD 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 03 00 00 05 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 3 (WiFiState) with 7 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    

    Last lines is auto rearm, previously i pressed "Test leakage" physical button, after 30s device rearm automatically. I think dpID9 can be leakage button, if i press this button multiple times, i can see this in log:
    
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    



    Command trigger area is this, right?
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)
  • #19
    p.kaczmarek2
    Moderator Smart Home
    Repeating event can be used to do some action periodically:
    
    // NOTE: addRepeatingEvent [RepeatTime] [RepeatCount]
    // code below will forever toggle relay every 15 seconds
    addRepeatingEvent 15 -1 POWER TOGGLE
    

    Another example:
    
    // NOTE: addRepeatingEvent [RepeatTime] [RepeatCount]
    addChangeHandler Channel1 != 0 addRepeatingEvent 2 1 setChannel 1 0
    

    Read more at:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/scriptExamples.md

    Channels are like variables, you can use them anyway you want, as long as you keep the scripts consistent. You can use any channel you choose for a given dpID.

    dpIDs are constant and they are forced by TuyaMCU.
    
    linkTuyaMCUOutputToChannel	[dpId]  [varType] [channelID] [bDPCache-Optional]
    

    Please check syntax at:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md

    You can trigger commands manually in two places:
    - in Command tool in native GUI
    - in Web App Log in the Web App
    You can also script commands in autoexec.bat to run automatically. It's also possible to enter commands in short startup command field.


    I can see some potential problems in your script:
    
    // linkTuyaMCUOutputToChannel	[dpId]  [varType] [channelID] 
    linkTuyaMCUOutputToChannel 12  bool 6 // unknown
    

    I can't see dpID 12 anywhere in your logs. Does it even exist?

    It also seems there is more data in custom formats. Some of them would require my help with coding. For example:
    
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 18, dataType 0-DP_TYPE_RAW and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 0A 22 
    

    What dpId 18 could be? It seems I need to add option to print those 12 bytes so we can start guessing.
  • #20
    crash1912
    Level 4  
    Repeating event is wonderful, i added "addRepeatingEvent 10 -1 tuyaMcu_sendQueryState" and works amazing.




    Possible stupid question: if channels are like variable and dpID's are same as constant forced... can bad channel configured overwrites any dpID accidentally?
    In other words, if currently exists dpID... 1 and using "variable" channel allocated to channel 1, channel 1 can be overwrite accidentally?

    Is possible dump all dpIDs and Channels currently available same as var_dump in other programming languages?


    Ok, in other order i removed potential problems in my script (script was copied from other thread of EAMPDW-TY63), now i cleaned autoexec.bat for start from more clean scenary.
    Now my autoexec.bat is:
    
    // start TuyaMCU driver
    startDriver TuyaMCU
    // always force 0x04 WiFi state (paired to cloud), otherwise TuyaMCU might skip some data points
    tuyaMcu_defWiFiState 4
    startDriver NTP
    
    // let's choose that channel 1 will be main relay state
    setChannelType 1 toggle
    // label it
    setChannelLabel 1 "Relay"
    
    setChannelType 2 Voltage_div10
    setChannelType 3 Power
    setChannelType 4 Current_div1000
    setChannelType 5 EnergyTotal_kWh_div100
    
    setChannelType 7 toggle
    setChannelLabel 7 "Prepayment"
    
    // link id 16 to channel 1
    linkTuyaMCUOutputToChannel 16 bool 1
    
    // link id 1 to channel 5
    linkTuyaMCUOutputToChannel 1 val 5
    
    // TAC2121C VoltageCurrentPower Packet
    // This will automatically set voltage, power and current
    linkTuyaMCUOutputToChannel 6 RAW_TAC2121C_VCP
    
    linkTuyaMCUOutputToChannel 11 bool 7
    
    // NOTE: addRepeatingEvent [RepeatTime] [RepeatCount]
    // code below will forever toggle relay every 15 seconds
    addRepeatingEvent 10 -1 tuyaMcu_sendQueryState 
    


    How works linkTuyaMCUOutputToChannel 6 RAW_TAC2121C_VCP? What does exactly? removing this, i can see channels 2,3,4,5 with "0" values.

    I have a question, after remove all autoexec.bat, in main screen buttons is not removing, all fields keep here without values. ¿How to remove this without hard reset?
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)


    Lastly, I don't know what dpid 18 could be... what can i do to help find out?
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 11, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 7 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:MAIN:Time 62001, idle 251741/s, free 84008, MQTT 0(3875), bWifi 1, secondsWithNoPing 61932, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 62002, idle 201864/s, free 84008, MQTT 0(3875), bWifi 1, secondsWithNoPing 61933, socks 2/38 
    Info:MAIN:Time 62003, idle 259825/s, free 84008, MQTT 0(3875), bWifi 1, secondsWithNoPing 61934, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MAIN:Time 62004, idle 255803/s, free 84008, MQTT 0(3875), bWifi 1, secondsWithNoPing 61935, socks 2/38 
    Info:MAIN:Time 62007, idle 254885/s, free 84008, MQTT 0(3875), bWifi 1, secondsWithNoPing 61938, socks 2/38 
    Info:MAIN:Time 62008, idle 262710/s, free 84008, MQTT 0(3875), bWifi 1, secondsWithNoPing 61939, socks 2/38 
    Info:MAIN:Time 62009, idle 260007/s, free 84008, MQTT 0(3875), bWifi 1, secondsWithNoPing 61940, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 62010, idle 258408/s, free 84008, MQTT 0(3875), bWifi 1, secondsWithNoPing 61941, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.206 gate=192.168.1.1 mask=255.255.255.0 mac=1c:90:ff:b9:46:9a
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-62,ssid=MyWifi-2G,bssid=xx:xx:xx:xx:xx:xx,channel=1,cipher_type:CCMP
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 1 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 13 03 00 04 31 32 33 34 F5 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 19, dataType 3-DP_TYPE_STRING and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 825373492
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 11 00 00 04 04 01 00 14 3F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 67174420
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 12 00 00 0C 01 01 00 28 03 01 01 0E 04 01 00 C8 41 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 18, dataType 0-DP_TYPE_RAW and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 0C 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 12
    Info:GEN:No change in channel 5 (still set to 12) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0F 02 00 04 00 00 00 00 26 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 15, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 06 00 00 08 09 52 00 00 28 00 00 00 A6 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:GEN:CHANNEL_Set channel 2 has changed to 2386 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 2386 to channel 2 
    Info:GEN:CHANNEL_Set channel 4 has changed to 40 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 40 to channel 4 
    Info:GEN:CHANNEL_Set channel 3 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 3 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 11, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 7 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:MAIN:Time 62011, idle 253219/s, free 83704, MQTT 0(3875), bWifi 1, secondsWithNoPing 61942, socks 2/38 
    Info:MAIN:Time 62015, idle 255881/s, free 84008, MQTT 0(3876), bWifi 1, secondsWithNoPing 61946, socks 2/38 
    Info:MAIN:Time 62016, idle 253184/s, free 84008, MQTT 0(3876), bWifi 1, secondsWithNoPing 61947, socks 2/38 
    Info:MAIN:Time 62017, idle 256761/s, free 84008, MQTT 0(3876), bWifi 1, secondsWithNoPing 61948, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:MAIN:Time 62018, idle 257176/s, free 83792, MQTT 0(3876), bWifi 1, secondsWithNoPing 61949, socks 3/38 
    Info:MAIN:Time 62019, idle 231573/s, free 84008, MQTT 0(3876), bWifi 1, secondsWithNoPing 61950, socks 2/38 
    Info:MAIN:Time 62020, idle 285013/s, free 84008, MQTT 0(3876), bWifi 1, secondsWithNoPing 61951, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.206 gate=192.168.1.1 mask=255.255.255.0 mac=1c:90:ff:b9:46:9a
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-59,ssid=MyWifi-2G,bssid=xx:xx:xx:xx:xx:xx,channel=1,cipher_type:CCMP
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 1 (still set to 1) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 13 03 00 04 31 32 33 34 F5 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 19, dataType 3-DP_TYPE_STRING and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 825373492
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 11 00 00 04 04 01 00 14 3F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 67174420
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 12 00 00 0C 01 01 00 28 03 01 01 0E 04 01 00 C8 41 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 18, dataType 0-DP_TYPE_RAW and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 0C 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 12
    Info:GEN:No change in channel 5 (still set to 12) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0F 02 00 04 00 00 00 00 26 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 15, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 06 00 00 08 09 4C 00 01 4A 00 00 4C 0F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:GEN:CHANNEL_Set channel 2 has changed to 2380 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 2380 to channel 2 
    Info:GEN:CHANNEL_Set channel 4 has changed to 330 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 330 to channel 4 
    Info:GEN:CHANNEL_Set channel 3 has changed to 76 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 76 to channel 3 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 11, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 7 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:MAIN:Time 62021, idle 254773/s, free 84008, MQTT 0(3876), bWifi 1, secondsWithNoPing 61952, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 62022, idle 175597/s, free 84008, MQTT 0(3876), bWifi 1, secondsWithNoPing 61953, socks 2/38 
    Info:MAIN:Time 62023, idle 269891/s, free 84008, MQTT 0(3876), bWifi 1, secondsWithNoPing 61954, socks 2/38 
    Info:MAIN:Time 62024, idle 256023/s, free 84008, MQTT 0(3876), bWifi 1, secondsWithNoPing 61955, socks 2/38 
    Info:MAIN:Time 62025, idle 252315/s, free 84008, MQTT 0(3876), bWifi 1, secondsWithNoPing 61956, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 62026, idle 255235/s, free 84008, MQTT 0(3876), bWifi 1, secondsWithNoPing 61957, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 62028, idle 255022/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61959, socks 2/38 
    Info:MAIN:Time 62029, idle 261014/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61960, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 62030, idle 262344/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61961, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.206 gate=192.168.1.1 mask=255.255.255.0 mac=1c:90:ff:b9:46:9a
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-58,ssid=MyWifi-2G,bssid=xx:xx:xx:xx:xx:xx,channel=1,cipher_type:CCMP
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 1 (still set to 1) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 13 03 00 04 31 32 33 34 F5 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 19, dataType 3-DP_TYPE_STRING and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 825373492
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 11 00 00 04 04 01 00 14 3F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 67174420
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 12 00 00 0C 01 01 00 28 03 01 01 0E 04 01 00 C8 41 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 18, dataType 0-DP_TYPE_RAW and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 0C 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 12
    Info:GEN:No change in channel 5 (still set to 12) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0F 02 00 04 00 00 00 00 26 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 15, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 06 00 00 08 09 48 00 01 5E 00 00 48 1B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:GEN:CHANNEL_Set channel 2 has changed to 2376 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 2376 to channel 2 
    Info:GEN:CHANNEL_Set channel 4 has changed to 350 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 350 to channel 4 
    Info:GEN:CHANNEL_Set channel 3 has changed to 72 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 72 to channel 3 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 11, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 7 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:MAIN:Time 62031, idle 252380/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61962, socks 2/38 
    Info:MAIN:Time 62032, idle 184815/s, free 75400, MQTT 0(3877), bWifi 1, secondsWithNoPing 61963, socks 3/38 
    Info:MAIN:Time 62033, idle 265836/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61964, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 62034, idle 260490/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61965, socks 2/38 
    Info:MAIN:Time 62035, idle 258381/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61966, socks 2/38 
    Info:MAIN:Time 62037, idle 530968/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61968, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 62038, idle 267223/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61969, socks 2/38 
    Info:MAIN:Time 62039, idle 263547/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61970, socks 2/38 
    Info:MAIN:Time 62040, idle 259322/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61971, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.206 gate=192.168.1.1 mask=255.255.255.0 mac=1c:90:ff:b9:46:9a
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-57,ssid=MyWifi-2G,bssid=xx:xx:xx:xx:xx:xx,channel=1,cipher_type:CCMP
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 1 (still set to 1) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 13 03 00 04 31 32 33 34 F5 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 19, dataType 3-DP_TYPE_STRING and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 825373492
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 11 00 00 04 04 01 00 14 3F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 67174420
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 12 00 00 0C 01 01 00 28 03 01 01 0E 04 01 00 C8 41 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 18, dataType 0-DP_TYPE_RAW and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 0C 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 12
    Info:GEN:No change in channel 5 (still set to 12) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0F 02 00 04 00 00 00 00 26 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 15, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 06 00 00 08 09 51 00 01 40 00 00 48 06 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:GEN:CHANNEL_Set channel 2 has changed to 2385 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 2385 to channel 2 
    Info:GEN:CHANNEL_Set channel 4 has changed to 320 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 320 to channel 4 
    Info:GEN:No change in channel 3 (still set to 72) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 11, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 7 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:MAIN:Time 62041, idle 282274/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61972, socks 2/38 
    Info:MAIN:Time 62043, idle 257623/s, free 84008, MQTT 0(3877), bWifi 1, secondsWithNoPing 61974, socks 2/38 
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 62044, idle 263821/s, free 84008, MQTT 0(3878), bWifi 1, secondsWithNoPing 61975, socks 2/38 
    Info:MAIN:Time 62045, idle 259735/s, free 84008, MQTT 0(3878), bWifi 1, secondsWithNoPing 61976, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 62046, idle 267121/s, free 84008, MQTT 0(3878), bWifi 1, secondsWithNoPing 61977, socks 2/38 
    Info:MAIN:Time 62047, idle 257009/s, free 84008, MQTT 0(3878), bWifi 1, secondsWithNoPing 61978, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 08 2B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 8
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MAIN:Time 62048, idle 262548/s, free 83816, MQTT 0(3878), bWifi 1, secondsWithNoPing 61979, socks 3/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:CHANNEL_Set channel 1 has changed to 1 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 1 to channel 1 
    Info:NTP:Seconds since Jan 1 1900 = 3901610319
    Info:NTP:Unix time  : 1692621519
    Info:NTP:Local Time : 2023/08/21 12:38:39
    Info:MAIN:Time 62049, idle 243723/s, free 84008, MQTT 0(3878), bWifi 1, secondsWithNoPing 61980, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 62050, idle 231608/s, free 84008, MQTT 0(3878), bWifi 1, secondsWithNoPing 61981, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.1.206 gate=192.168.1.1 mask=255.255.255.0 mac=1c:90:ff:b9:46:9a
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-57,ssid=MyWifi-2G,bssid=xx:xx:xx:xx:xx:xx,channel=1,cipher_type:CCMP
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 1 (still set to 1) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 13 03 00 04 31 32 33 34 F5 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 19, dataType 3-DP_TYPE_STRING and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 825373492
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 11 00 00 04 04 01 00 14 3F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 67174420
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 10 12 00 00 0C 01 01 00 28 03 01 01 0E 04 01 00 C8 41 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 23 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 18, dataType 0-DP_TYPE_RAW and 12 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 0C 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 12
    Info:GEN:No change in channel 5 (still set to 12) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0F 02 00 04 00 00 00 00 26 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 15, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 06 00 00 08 09 4E 00 01 0E 00 00 41 CA 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:GEN:CHANNEL_Set channel 2 has changed to 2382 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 2382 to channel 2 
    Info:GEN:CHANNEL_Set channel 4 has changed to 270 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 270 to channel 4 
    Info:GEN:CHANNEL_Set channel 3 has changed to 65 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 65 to channel 3 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 11, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 7 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:MAIN:Time 62051, idle 258218/s, free 84008, MQTT 0(3878), bWifi 1, secondsWithNoPing 61982, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 09 05 00 04 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 9, dataType 5-DP_TYPE_BITMAP and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 0 to channel 1 
    Info:MAIN:Time 62052, idle 178909/s, free 84008, MQTT 0(3878), bWifi 1, secondsWithNoPing 61983, socks 2/38 
    Info:MAIN:Time 62056, idle 261273/s, free 84008, MQTT 0(3878), bWifi 1, secondsWithNoPing 61987, socks 2/38 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 62058, idle 260566/s, free 84008, MQTT 0(3878), bWifi 1, secondsWithNoPing 61989, socks 2/38 
    Info:MAIN:Time 62059, idle 262307/s, free 84008, MQTT 0(3878), bWifi 1, secondsWithNoPing 61990, socks 2/38 
    


    I have compiled a list with all the values that this device handles, with the fixed values included. I hope it can help
    
    Switches: 
    Power Switch: Channel 1
    Prepayment switch: Channel 7 (probably, although the prepaid balance cannot be changed, the function test is difficult)
    Leakage test switch: unknown Channel
    
    Read only data:
    Voltage:      Channel 2
    Power(w):     Channel 3
    Current(a):   Channel 4
    Current(kWh): Channel 5
    Prepayment balance energy(kwh): unknown Channel
    Power factor Φ: Unknown channel 
    
    Over-voltage protection status: boolean
    Under-voltage protection status: boolean
    Over current protection status: boolean
    Leakage protection status: boolean
    
    Read+Write configuration sections:
    (id)   : Val  | Description (unit)
    (bt)   : 15   | Screen bright time (S)
    (At)   : off  | Display interval delay time (S)
    (Pt)   : 10   | Power-on delay time (S)
    
    (UH)   : 270  | Over-voltage protection value (V)
    (UHr)  : 265  | Over-voltage recovery value (V)
    (UHrt) : 30   | Over-voltage recovery delay time (S)
    (UHtt) : 1    | Over-voltage protection action time (S)
    
    (UL)   : 200  | Under-voltage protection value (V)
    (ULr)  : 210  | Under-voltage recovery value (V)
    (UHrt) : 30   | Under-voltage recovery delay time (S)
    (ULtt) : 1    | Under-voltage protection action time (S)
    
    (CH)   : 40.0 | Over-current protection value (A)
    (CHrt) : 30   | Over-current recovery delay time (S)
    (CHtt) : 3    | Over-current protection action time (S)
    
    (CC)   : off  | Continuous over current faults times (1-20)
    (LC)   : 20   | Leakage protection value (mA)
    (LCrt) : 30   | Leakage recoery delay time (S)
    (LCC)  : off  | Continuous leakage faults times (1-20)
    (UAd┘) : 0.3  | Voltage calibration (%)
    (CAd┘) : -2.4 | Current calibration: (%)
    (PAd┘) : -1.0 | Kw calibration (%)
    (CtHr) : 10   | unknown
    
  • #21
    crash1912
    Level 4  
    I found this exploring tuya cloud for developers and using other TOMZN TOMPD-63-LW with original firmware:


    
    Get: https://openapi.tuyaeu.com/v2.0/cloud/thing/xxxxxxxxxxxxxxxxxx/shadow/properties:
    {
      "result": {
        "properties": [
          {
            "code": "total_forward_energy",
            "custom_name": "",
            "dp_id": 1,
            "time": 1692038649484,
            "value": 1
          },
          {
            "code": "phase_a",
            "custom_name": "",
            "dp_id": 6,
            "time": 1692038796391,
            "value": "CUYAAB4AAAA="
          },
          {
            "code": "fault",
            "custom_name": "",
            "dp_id": 9,
            "time": 1692038677750,
            "value": 0
          },
          {
            "code": "switch_prepayment",
            "custom_name": "",
            "dp_id": 11,
            "time": 1692038649484,
            "value": false
          },
          {
            "code": "clear_energy",
            "custom_name": "",
            "dp_id": 12,
            "time": 1692034716410,
            "value": false
          },
          {
            "code": "balance_energy",
            "custom_name": "",
            "dp_id": 13,
            "time": 1692038649484,
            "value": 0
          },
          {
            "code": "charge_energy",
            "custom_name": "",
            "dp_id": 14,
            "time": 1692034716410,
            "value": 0
          },
          {
            "code": "leakage_current",
            "custom_name": "",
            "dp_id": 15,
            "time": 1692038649484,
            "value": 0
          },
          {
            "code": "switch",
            "custom_name": "",
            "dp_id": 16,
            "time": 1692038677663,
            "value": true
          },
          {
            "code": "alarm_set_1",
            "custom_name": "",
            "dp_id": 17,
            "time": 1692038791940,
            "value": "BAEAFA=="
          },
          {
            "code": "alarm_set_2",
            "custom_name": "",
            "dp_id": 18,
            "time": 1692038792040,
            "value": "AQEAKAMBAQ4EAQDI"
          },
          {
            "code": "breaker_id",
            "custom_name": "",
            "dp_id": 19,
            "time": 1692038649484,
            "value": "1234"
          },
          {
            "code": "leakagecurr_test",
            "custom_name": "",
            "dp_id": 21,
            "time": 1692034716410,
            "value": false
          },
          {
            "code": "clr_all_energy",
            "custom_name": "",
            "dp_id": 101,
            "time": 1692034716410,
            "value": false
          }
        ]
      },
      "success": true,
      "t": 1692038827465,
      "tid": "xxxxxxxxxxxxxxxxxxxxxxxx"
    }
    


    
    GET: https://openapi.tuyaeu.com/v1.0/iot-03/devices/xxxxxxxxxxxxxxxxxxxxxx/specification
    {
      "result": {
        "category": "dlq",
        "functions": [
          {
            "code": "switch_prepayment",
            "desc": "{}",
            "name": "预付费功能开关",
            "type": "Boolean",
            "values": "{}"
          },
          {
            "code": "energy_reset",
            "desc": "{\"range\":[\"empty\"]}",
            "name": "电量清零",
            "type": "Enum",
            "values": "{\"range\":[\"empty\"]}"
          },
          {
            "code": "charge_energy",
            "desc": "{\"unit\":\"kW·h\",\"min\":0,\"max\":99999,\"scale\":1,\"step\":1}",
            "name": "电量充值",
            "type": "Integer",
            "values": "{\"unit\":\"kW·h\",\"min\":0,\"max\":99999,\"scale\":1,\"step\":1}"
          },
          {
            "code": "switch",
            "desc": "{}",
            "name": "断路器开关",
            "type": "Boolean",
            "values": "{}"
          },
          {
            "code": "alarm_set_1",
            "desc": "{}",
            "name": "告警设置1",
            "type": "Raw",
            "values": "{}"
          },
          {
            "code": "alarm_set_2",
            "desc": "{}",
            "name": "告警设置2",
            "type": "Raw",
            "values": "{}"
          },
          {
            "code": "leakagecurr_test",
            "desc": "{}",
            "name": "剩余电流测试",
            "type": "Boolean",
            "values": "{}"
          }
        ],
        "status": [
          {
            "code": "total_forward_energy",
            "name": "正向总有功电量",
            "type": "Integer",
            "values": "{\"unit\":\"kW·h\",\"min\":0,\"max\":99999999,\"scale\":2,\"step\":1}"
          },
          {
            "code": "phase_a",
            "name": "上报A相电压,电流及功率",
            "type": "Raw",
            "values": "{}"
          },
          {
            "code": "fault",
            "name": "故障告警",
            "type": "Bitmap",
            "values": "{\"label\":[\"short_circuit_alarm\",\"surge_alarm\",\"overload_alarm\",\"leakagecurr_alarm\",\"temp_dif_fault\",\"fire_alarm\",\"high_power_alarm\",\"self_test_alarm\",\"ov_cr\",\"unbalance_alarm\",\"ov_vol\",\"undervoltage_alarm\",\"miss_phase_alarm\",\"outage_alarm\",\"magnetism_alarm\",\"credit_alarm\",\"no_balance_alarm\"]}"
          },
          {
            "code": "switch_prepayment",
            "name": "预付费功能开关",
            "type": "Boolean",
            "values": "{}"
          },
          {
            "code": "energy_reset",
            "name": "电量清零",
            "type": "Enum",
            "values": "{\"range\":[\"empty\"]}"
          },
          {
            "code": "balance_energy",
            "name": "剩余可用电量",
            "type": "Integer",
            "values": "{\"unit\":\"kW·h\",\"min\":0,\"max\":999999,\"scale\":1,\"step\":1}"
          },
          {
            "code": "charge_energy",
            "name": "电量充值",
            "type": "Integer",
            "values": "{\"unit\":\"kW·h\",\"min\":0,\"max\":99999,\"scale\":1,\"step\":1}"
          },
          {
            "code": "leakage_current",
            "name": "剩余电流",
            "type": "Integer",
            "values": "{\"unit\":\"mA\",\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"
          },
          {
            "code": "switch",
            "name": "断路器开关",
            "type": "Boolean",
            "values": "{}"
          },
          {
            "code": "alarm_set_1",
            "name": "告警设置1",
            "type": "Raw",
            "values": "{}"
          },
          {
            "code": "alarm_set_2",
            "name": "告警设置2",
            "type": "Raw",
            "values": "{}"
          },
          {
            "code": "breaker_number",
            "name": "断路器设备号",
            "type": "String",
            "values": "{\"maxlen\":255}"
          },
          {
            "code": "leakagecurr_test",
            "name": "剩余电流测试",
            "type": "Boolean",
            "values": "{}"
          }
        ]
      },
      "success": true,
      "t": 1692038746683,
      "tid": "xxxxxxxxxxxxxxxxxx"
      



    
      {
      "result": {
        "category": "dlq",
        "functions": [
          {
            "code": "switch_prepayment",
            "desc": "switch prepayment",
            "name": "switch prepayment",
            "type": "Boolean",
            "values": "{}"
          },
          {
            "code": "energy_reset",
            "desc": "energy reset",
            "name": "energy reset",
            "type": "Enum",
            "values": "{\"range\":[\"empty\"]}"
          },
          {
            "code": "charge_energy",
            "desc": "charge energy",
            "name": "charge energy",
            "type": "Integer",
            "values": "{\"unit\":\"kW·h\",\"min\":0,\"max\":99999,\"scale\":1,\"step\":1}"
          },
          {
            "code": "switch",
            "desc": "switch",
            "name": "switch",
            "type": "Boolean",
            "values": "{}"
          },
          {
            "code": "alarm_set_1",
            "desc": "alarm set 1",
            "name": "alarm set 1",
            "type": "Raw",
            "values": "{}"
          },
          {
            "code": "alarm_set_2",
            "desc": "alarm set 2",
            "name": "alarm set 2",
            "type": "Raw",
            "values": "{}"
          },
          {
            "code": "leakagecurr_test",
            "desc": "leakagecurr test",
            "name": "leakagecurr test",
            "type": "Boolean",
            "values": "{}"
          }
        ]
      },
      "success": true,
      "t": 1692038775203,
      "tid": "xxxxxxxxxxxxxxxxxx"
    }
    


    And model query, I think there is much needed information here:
    
    https://openapi.tuyaeu.com/v2.0/cloud/thing/xxxxxxxxxxxxxxx/model
    {
    	"modelId": "000004scus",
    	"services": [
    		{
    			"actions": [],
    			"code": "",
    			"description": "",
    			"events": [],
    			"name": "默认服务",
    			"properties": [
    				{
    					"abilityId": 1,
    					"accessMode": "ro",
    					"code": "total_forward_energy",
    					"description": "",
    					"extensions": {
    						"iconName": "icon-dp_lightning",
    						"attribute": "1152"
    					},
    					"name": "正向总有功电量",
    					"typeSpec": {
    						"max": 99999999,
    						"min": 0,
    						"scale": 2,
    						"step": 1,
    						"type": "value",
    						"typeDefaultValue": 0,
    						"unit": "kW·h"
    					}
    				},
    				{
    					"abilityId": 6,
    					"accessMode": "ro",
    					"code": "phase_a",
    					"description": "1,A相电压,电流及功率\n2,大端模式,HEX格式,共8个字节\n3,单位精度:电压,2字节,单位0.1V。电流,3字节,单位 0.001A 。A相有功功率,3字节,单位0.0001kW\n4,报文格式\n举例:08 80 00 03 E8 00 27 10 表示A相217.6V,A相电流1.000A,A相功率10.000KW\n5,通信逻辑:\n1)用户进面板,主动查询。用户进入面板,面板马上下发0x08到电表,电表上报数据到云平台,面板拿到数据,然后展示。 注:最新WIFI支持。   \n2)电表基于一定周期上报数据。建议:在WIFI模式时,15秒上报一次。NB模式时,1个小时上报一次。",
    					"extensions": {
    						"iconName": "icon-dp_lightning",
    						"attribute": "1152"
    					},
    					"name": "A相电压,电流及功率",
    					"typeSpec": {
    						"maxlen": 128,
    						"type": "raw"
    					}
    				},
    				{
    					"abilityId": 9,
    					"accessMode": "ro",
    					"code": "fault",
    					"description": "1,告警\n2,大端模式,HEX,4字节\n3,报文格式\n按照完整4个字节,对应的告警位上报告警;bit位,1表示有告警,0表示无告警;如果没用的告警位,补0。高位无定义,也补0;\n举例:0X00 00 00 09,表示当前发生了漏电自检不正常告警和短路告警,无其它告警。\n4,通信逻辑\n只要有1个告警发生,就完整4个字节上报给面板;只要有1个告警关闭,就完整4个字节上报给面板,更新面板显示。",
    					"extensions": {
    						"iconName": "icon-baojing",
    						"attribute": "1152"
    					},
    					"name": "故障告警",
    					"typeSpec": {
    						"label": [
    							"short_circuit_alarm",
    							"surge_alarm",
    							"overload_alarm",
    							"leakagecurr_alarm",
    							"temp_dif_fault",
    							"fire_alarm",
    							"high_power_alarm",
    							"self_test_alarm",
    							"ov_cr",
    							"unbalance_alarm",
    							"ov_vol",
    							"undervoltage_alarm",
    							"miss_phase_alarm",
    							"outage_alarm",
    							"magnetism_alarm",
    							"credit_alarm",
    							"no_balance_alarm"
    						],
    						"maxlen": 17,
    						"type": "bitmap",
    						"typeDefaultValue": 0
    					}
    				},
    				{
    					"abilityId": 11,
    					"accessMode": "rw",
    					"code": "switch_prepayment",
    					"description": "",
    					"extensions": {
    						"iconName": "icon-dp_money",
    						"attribute": "1152"
    					},
    					"name": "预付费功能开关",
    					"typeSpec": {
    						"type": "bool",
    						"typeDefaultValue": false
    					}
    				},
    				{
    					"abilityId": 12,
    					"accessMode": "rw",
    					"code": "clear_energy",
    					"description": "",
    					"extensions": {
    						"iconName": "icon-dp_lightning",
    						"attribute": "1152"
    					},
    					"name": "电量清零",
    					"typeSpec": {
    						"type": "bool",
    						"typeDefaultValue": false
    					}
    				},
    				{
    					"abilityId": 13,
    					"accessMode": "ro",
    					"code": "balance_energy",
    					"description": "",
    					"extensions": {
    						"iconName": "icon-dp_lightning",
    						"attribute": "1152"
    					},
    					"name": "剩余可用电量显示",
    					"typeSpec": {
    						"max": 999999,
    						"min": 0,
    						"scale": 1,
    						"step": 1,
    						"type": "value",
    						"typeDefaultValue": 0,
    						"unit": "kW·h"
    					}
    				},
    				{
    					"abilityId": 14,
    					"accessMode": "rw",
    					"code": "charge_energy",
    					"description": "",
    					"extensions": {
    						"iconName": "icon-dp_money",
    						"attribute": "1152"
    					},
    					"name": "电量充值",
    					"typeSpec": {
    						"max": 99999,
    						"min": 0,
    						"scale": 1,
    						"step": 1,
    						"type": "value",
    						"typeDefaultValue": 0,
    						"unit": "kW·h"
    					}
    				},
    				{
    					"abilityId": 15,
    					"accessMode": "ro",
    					"code": "leakage_current",
    					"description": "",
    					"extensions": {
    						"iconName": "icon-power1",
    						"attribute": "1152"
    					},
    					"name": "剩余电流显示",
    					"typeSpec": {
    						"max": 1000,
    						"min": 0,
    						"scale": 0,
    						"step": 1,
    						"type": "value",
    						"typeDefaultValue": 0,
    						"unit": "mA"
    					}
    				},
    				{
    					"abilityId": 16,
    					"accessMode": "rw",
    					"code": "switch",
    					"description": "",
    					"extensions": {
    						"iconName": "icon-dp_power2",
    						"attribute": "1152"
    					},
    					"name": "断路器开关",
    					"typeSpec": {
    						"type": "bool",
    						"typeDefaultValue": false
    					}
    				},
    				{
    					"abilityId": 17,
    					"accessMode": "rw",
    					"code": "alarm_set_1",
    					"description": "1,告警阈值使能控制及设置2  \n2,HEX格式,大端模式, 总告警的数量*4字节= 设置告警总长度。\n3,报文格式\n每个告警由4个字节组成,第1个字节(表示该告警存在);第2个字节(发生此告警时,断路器控制模式(0X01拉闸,0X00不动作只告警);第3、4字节:设置告警阈值\n举例:0X01 01 00 00 03 01 00 14,表示该断路器支持短路告警,发生该告警时,自动跳闸,阀值补0。支持过载告警,发生该告警时,拉闸动作,动作阀值20KW。无其它告警。\n4,通信逻辑\nA,配网成功后,按照上面的格式,主动上报给云平台,面板知道哪些告警是断路器当前支持的。设置不成功,重新配网再上报。\nB,断路器上电时,也上报一次。\nC,面板根据协议下发告警设置。",
    					"extensions": {
    						"iconName": "icon-dp_warming",
    						"attribute": "1152"
    					},
    					"name": "告警设置1",
    					"typeSpec": {
    						"maxlen": 128,
    						"type": "raw"
    					}
    				},
    				{
    					"abilityId": 18,
    					"accessMode": "rw",
    					"code": "alarm_set_2",
    					"description": "1,告警阈值使能控制及设置2  \n2,HEX格式,大端模式\n3,报文格式\n每个告警由4个字节组成,第1个字节(表示该告警存在);第2个字节(发生此告警时,断路器控制模式(0X01拉闸,0X00不动作只告警);第3、4字节:设置告警阈值\n举例:0X01 01 00 3C 03 01 00 F5,表示该断路器支持过流告警,发生该告警时,拉闸动作,动作阀值60A。支持过压告警,发生该告警时,拉闸动作,动作阀值245V\n4,通信逻辑\nA,配网成功后,按照上面的格式,主动上报给云平台,面板知道哪些告警是断路器当前支持的。设置不成功,重新配网再上报。\nB,断路器上电时,也上报一次。\nC,面板根据协议下发告警设置。",
    					"extensions": {
    						"iconName": "icon-dp_warming",
    						"attribute": "1152"
    					},
    					"name": "告警设置2",
    					"typeSpec": {
    						"maxlen": 128,
    						"type": "raw"
    					}
    				},
    				{
    					"abilityId": 19,
    					"accessMode": "ro",
    					"code": "breaker_id",
    					"description": "1,设备号\n2,大端模式,字符串型\n3,单位精度\n4,报文格式\n5,通信逻辑\nA,配网时上报三次,以确保上报成功。如果配对成功,面板有显示设备号。\nB,如果配对成功,面板没有显示设备号,需要移除设备,再配置一遍。\nC,每次断路器上电,也上报一次。",
    					"extensions": {
    						"iconName": "icon-dp_mode",
    						"attribute": "1152"
    					},
    					"name": "设备号显示",
    					"typeSpec": {
    						"maxlen": 255,
    						"type": "string",
    						"typeDefaultValue": ""
    					}
    				},
    				{
    					"abilityId": 21,
    					"accessMode": "rw",
    					"code": "leakagecurr_test",
    					"description": "",
    					"extensions": {
    						"iconName": "icon-dp_lightning",
    						"attribute": "1152"
    					},
    					"name": "剩余电流测试",
    					"typeSpec": {
    						"type": "bool",
    						"typeDefaultValue": false
    					}
    				},
    				{
    					"abilityId": 101,
    					"accessMode": "wr",
    					"code": "clr_all_energy",
    					"description": "Clear all energy",
    					"name": "清电量",
    					"typeSpec": {
    						"type": "bool",
    						"typeDefaultValue": false
    					}
    				}
    			]
    		}
    	]
    }
    
  • #22
    p.kaczmarek2
    Moderator Smart Home
    crash1912 wrote:

    Possible stupid question: if channels are like variable and dpID's are same as constant forced... can bad channel configured overwrites any dpID accidentally?
    In other words, if currently exists dpID... 1 and using "variable" channel allocated to channel 1, channel 1 can be overwrite accidentally?

    You can't break TuyaMCU that way, but it may cause wrong readings.
    crash1912 wrote:

    Is possible dump all dpIDs and Channels currently available same as var_dump in other programming languages?

    The best I can suggest at the moment is tuyaMcu_sendQueryState.


    crash1912 wrote:

    How works linkTuyaMCUOutputToChannel 6 RAW_TAC2121C_VCP? What does exactly? removing this, i can see channels 2,3,4,5 with "0" values.

    This is a special type that parses given packet binary data and splits it into separate voltage, current and power channels. In that case, single dpID contains all those 3 values.


    crash1912 wrote:

    I have a question, after remove all autoexec.bat, in main screen buttons is not removing, all fields keep here without values. ¿How to remove this without hard reset?
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    You are correct. You still have channel types set in Web App.

    crash1912 wrote:

    Lastly, I don't know what dpid 18 could be... what can i do to help find out?

    It looks like it is raw bytes type, I might need to add ability to dumps this data to console so we can analyze it.
  • #23
    crash1912
    Level 4  
    If you like, i can share online device with you for testing purposes, we only need to coincide in the moment
  • #24
    crash1912
    Level 4  
    p.kaczmarek2 wrote:

    crash1912 wrote:

    I have a question, after remove all autoexec.bat, in main screen buttons is not removing, all fields keep here without values. ¿How to remove this without hard reset?
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

    You are correct. You still have channel types set in Web App.

    ¿How to remove this buttons previously created by autoexec.bat when autoexec.bat now is clean but buttons still appears without hard reset?
    I can see that cleaning autoexec.bat is not enough.


    crash1912 wrote:

    Lastly, I don't know what dpid 18 could be... what can i do to help find out?

    It looks like it is raw bytes type, I might need to add ability to dumps this data to console so we can analyze it.[/quote]
    Can i do anything for help?
  • #25
    p.kaczmarek2
    Moderator Smart Home
    I will add ability to dump this to console soon.
    Regarding buttons, I think you need to set Channel Type to none here;
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)
    Please try and let me know if it helps.
  • #26
    crash1912
    Level 4  
    p.kaczmarek2 wrote:
    I will add ability to dump this to console soon.
    Regarding buttons, I think you need to set Channel Type to none here;
    TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)
    Please try and let me know if it helps.

    It works, now set all to default and main interface is clean.

    If you want, i can open ports of device for realtime testing if you need to collecting data
  • #27
    fakuivan
    Level 1  
    >>20707655

    I'm working on a similar breaker but the schema id is different from this one, it's a slightly different model. I'm curious as to how you got access to the API. I've already flashed mine with esphome, do I need to flash it back to tuya if I want to get that info from the API? Can you link to a guide for doing that?

    So far I've been posting my findings here in case someone is interested: https://github.com/tuya-cloudcutter/tuya-cloudcutter.github.io/issues/72