logo elektroda
logo elektroda
X
logo elektroda

Dewin RMDT-1PNL 63 Smart Circuit Breaker OpenBK7231 MQTT Setup

lubopetrov 303 30
ADVERTISEMENT
  • #1 21560758
    lubopetrov
    Level 2  
    I'm trying to make it work Dewin Smart Circuit Breaker I purchased from Amazon with my Home Assistant without Tuya cloud. I used the firmware OpenBK7231IN_QIO_1.18.102.bin suggested by BK7231 UART to flash it. After that I was able to add the device to my Home Assistant, but I only see general info and I don't see functionality related to power consumption neither ON/OFF switch in my Home Assistant Dashboard. What I'm doing wrong?
    Screenshot of BK7231 Easy UART Flasher with BK7231N board and OpenBK7231N_QIO_1.18.102.bin firmware selected, currently idle.
    Configuration panel for espresso_breaker device with a list of setup options.
    Status panel of espresso_breaker device showing firmware version, IP address, Wi-Fi signal, SSID, temperature, and uptime.
    White DEWIN WiFi relay 1P-I-63, 1-63A with a button and signal light.
    WiFi circuit breaker by DEWIN, model RMDT-1PNL 63, rated for 63A and 230V operation.
    AI: After flashing the firmware, how did you configure the Dewin Smart Circuit Breaker in OpenBK7231 (e.g., did you set up the correct template, assign pins, or configure any settings for relays and power monitoring)?
    No. I'm not sure how to do it.
    AI: How did you add the device to Home Assistant—are you using MQTT, HTTP integration, or another method?
    MQTT
  • ADVERTISEMENT
  • #2 21561187
    p.kaczmarek2
    Moderator Smart Home
    You need to configure that device after flashing. Either manually guess or try to import the template. It will not work without this step.

    Try:


    Helpful post? Buy me a coffee.
  • #3 21566333
    lubopetrov
    Level 2  
    I followed the instructions of the video but the message says Sorry, no meaningful pins data found. How to proceed?
    BK7231 Easy UART Flasher window showing no meaningful pins data found message after analyzing a Tuya device binary.
  • #4 21566334
    p.kaczmarek2
    Moderator Smart Home
    Maybe it's TuyaMCU device. How the PCB looks like?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 21566755
    lubopetrov
    Level 2  
    Here are the photos of the board.
    CB3S module mounted on a circuit board with attached wires.
    Electronic module with components, capacitors, wires, and a relay.
    Printed circuit board with electronic components, visible ICs, capacitors, resistors, and an inductor.
  • #6 21566792
    p.kaczmarek2
    Moderator Smart Home
    Helpful post? Buy me a coffee.
  • #7 21571332
    lubopetrov
    Level 2  
    First I would like to thank you for your help. Can you please help me to finish with this flash.
    So far I was able to achieve the following:
    Got some of the data from tuya dev site.

    -From running the script:
    Code: JSON
    Log in, to see the code


    -Standard Instructions Set:
    switch_prepayment Boolean
    "{true,false}"
    clear_energy Boolean
    "{true,false}"
    charge_energy Integer
    {
    "unit": "kW·h",
    "min": 0,
    "max": 999999,
    "scale": 2,
    "step": 1
    }
    switch Boolean
    "{true,false}"
    alarm_set_1 Raw
    {}
    alarm_set_2 Raw
    {}
    countdown_1 Integer
    {
    "unit": "s",
    "min": 0,
    "max": 86400,
    "scale": 0,
    "step": 1
    }
    cycle_time String
    {
    "maxlen": 255
    }
    random_time String
    {}
    
    [b]-Standard Status Set:[/b]
    total_forward_energy Integer
    {
    "unit": "kW·h",
    "min": 0,
    "max": 99999999,
    "scale": 2,
    "step": 1
    }
    phase_a Raw
    {}
    fault Bitmap
    {
    "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"
    ]
    }
    switch_prepayment Boolean
    "{true,false}"
    energy_reset Enum
    {
    "range": [
    "empty"
    ]
    }
    balance_energy Integer
    {
    "unit": "kW·h",
    "min": 0,
    "max": 99999999,
    "scale": 2,
    "step": 1
    }
    charge_energy Integer
    {
    "unit": "kW·h",
    "min": 0,
    "max": 999999,
    "scale": 2,
    "step": 1
    }
    switch Boolean
    "{true,false}"
    alarm_set_1 Raw
    {}
    alarm_set_2 Raw
    {}
    countdown_1 Integer
    {
    "unit": "s",
    "min": 0,
    "max": 86400,
    "scale": 0,
    "step": 1
    }
    cycle_time String
    {
    "maxlen": 255
    }
    random_time String
    {}
    

    I cannot retract anything from https://eu.iot.tuya.com/cloud/explorer because I'm getting message that my account has expired.
    Here is my device id: bfe887d3d3b94ffed6snhu
  • #8 21571984
    p.kaczmarek2
    Moderator Smart Home
    Sure, this may be enough data to flash this device. They didn't specify the format of phase A:
    
    phase_a Raw
    {}
    

    but we can try to use just existing ones, this may not be a problem.

    So, I assume you flashed OBK already? Did you try to run the TuyaMCU driver as shown in the TuyaMCU guide? Are heartbeats received? Are you able to request TuyaMCU state? How DP list on OBK looks like (usage is described in the TuyaMCU guide)?
    Helpful post? Buy me a coffee.
  • #9 21572105
    lubopetrov
    Level 2  
    >>21571984
    I'm sorry. I'm not really good at this. I tried to follow the instructions of multiple guides and at this point not sure how to continue. I have 2 of those breakers. One I flashed, but don't know how to continue and the other one that I extracted the information from. Can you please guide me thru the procedure to adjust the setting of the flashed given the extracted data from the other.
    Thanks.
  • #10 21572159
    p.kaczmarek2
    Moderator Smart Home
    Your screenshot on post https://www.elektroda.com/rtvforum/viewtopic.php?p=21566333#21566333 shows baud 9600. Let's try TuyaMCU at baud 9600.

    So, let's do it step by step. I assume you have OBK flashed. So now, just like in:
    p.kaczmarek2 wrote:

    First:
    p.kaczmarek2 wrote:

    6. Start the driver and check is there a communication
    Now it's time to setup a basic autoexec.bat in OBK:



    Here is a starting config:
    
    // Start TuyaMCu driver
    startDriver TuyaMCU
    // set TuyaMCU baud rate
    //tuyaMcu_setBaudRate 115200
    // set TuyaMCU default wifi state 0x04, which means "paired",
    // because some TuyaMCU MCUs will not report all data
    // unless they think they are connected to cloud
    tuyaMcu_defWiFiState 4
    

    The tuyaMcu_setBaudRate is commented out, please remove comment if needed. This should give you basic TuyaMCU heartbeats and communication in the OpenBeken Web App Log. This should also make tuyaMcu_sendQueryState work.
    Do not forget the tuyaMcu_defWiFiState 4 line. By default, OBK sends "paired" state (0x04) only when MQTT is on, but some devices always require the WiFi state to be "paired" (0x04) before sending data. This will control the WiFi LED of the MCU and even may control buzzer. Some devices will send buzzer audio signals when not paired.

    Then save, reboot, check Web App log - copy content of Web App log here (remove SSID if present). We will check if log shows heartbeat of TuyaMCU received?


    Then try command (in web app commandline): tuyaMcu_sendQueryState and show us output.

    You can also do next step already.
    p.kaczmarek2 wrote:

    There is command called DP.
    Screenshot of JSON with dpID data
    In order for it to work, you need to enable the following flag: flag 46.
    This will store last values of dpIDs in hex and allow you accessing them in JSON.

    After some time, maybe also do first tuyaMcu_sendQueryState again, and copy us text from DP command. Check on my screenshot how to enter it - you do it by device URL. It will show seen data points.
    Helpful post? Buy me a coffee.
  • #11 21572211
    lubopetrov
    Level 2  
    >>21572159
    I executed tuyaMcu_sendQueryState
    Here is the log:
    
    Info:TuyaMCU:Consumed 30 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 02 60 28 01 22 00 30 14 1C 5E 23 61 08 00 00 43 28 01 A2 01 00 08 20 28 01 C0 00 00 FF 
    Info:MAIN:Time 80, idle 193490/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 10, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.30.25 gate=192.168.30.1 mask=255.255.255.0 mac=38:2c:e5:77:f7:df
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-64,ssid=xxxxxxx,bssid=22:61:b4:14:a9:a8,channel=6,cipher_type:CCMP
    Info:TuyaMCU:Consumed 30 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 02 60 28 01 22 00 00 14 1C 5E 22 61 08 00 00 43 28 01 A2 01 00 08 20 28 01 C0 00 00 F6 
    Info:MAIN:Time 81, idle 179590/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 11, socks 2/38 
    Info:CMD:[WebApp Cmd 'loglevel 3' Result] OK
    Info:MAIN:Time 82, idle 190185/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 12, socks 2/38 
    Info:TuyaMCU:Consumed 30 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 02 60 28 01 22 00 00 10 8F 28 01 E2 01 00 08 43 28 01 A2 01 00 08 20 28 01 C0 00 00 F6 
    Info:MAIN:Time 84, idle 193467/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 14, socks 2/38 
    Info:MAIN:Time 85, idle 184941/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 15, socks 2/38 
    Info:MAIN:Time 86, idle 204404/s, free 62792, MQTT 1(1), bWifi 1, secondsWithNoPing 16, socks 3/38 
    Info:MAIN:Time 87, idle 189495/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 17, socks 2/38 
    Info:MAIN:Time 89, idle 184831/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 19, socks 2/38 
    Info:TuyaMCU:Consumed 36 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 01 00 00 00 F8 28 02 60 28 01 22 00 00 14 1C 5E 22 61 08 00 00 43 28 01 A2 01 10 08 20 28 01 C0 00 00 FF 
    Info:MAIN:Time 90, idle 190726/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 20, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.30.25 gate=192.168.30.1 mask=255.255.255.0 mac=38:2c:e5:77:f7:df
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-65,ssid=xxxxxxx,bssid=22:61:b4:14:a9:a8,channel=6,cipher_type:CCMP
    Info:MAIN:Time 91, idle 185971/s, free 62784, MQTT 1(1), bWifi 1, secondsWithNoPing 21, socks 3/38 
    Info:MAIN:Time 92, idle 188592/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 22, socks 2/38 
    Info:MAIN:Time 93, idle 189724/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 23, socks 2/38 
    Info:TuyaMCU:Consumed 30 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 02 60 28 01 22 00 30 14 FC 28 01 E2 01 00 08 43 28 01 A2 01 00 08 20 28 01 C0 00 00 FF 
    Info:MAIN:Time 95, idle 187144/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 25, socks 2/38 
    Info:TuyaMCU:Consumed 30 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 02 60 28 01 22 00 30 14 1C 5E 22 61 08 00 00 43 28 01 A2 01 00 08 20 28 01 C0 00 00 FF 
    Info:MAIN:Time 96, idle 189348/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 26, socks 2/38 
    Info:TuyaMCU:Consumed 30 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 02 60 28 01 22 00 00 14 FC 28 01 E2 01 00 08 43 28 01 A2 01 00 08 20 28 01 C0 00 00 FF 
    Info:MAIN:Time 97, idle 185630/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 27, socks 2/38 
    Info:MAIN:Time 99, idle 187286/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 29, socks 2/38 
    Info:MAIN:Time 100, idle 194414/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 30, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.30.25 gate=192.168.30.1 mask=255.255.255.0 mac=38:2c:e5:77:f7:df
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-65,ssid=xxxxxxx,bssid=22:61:b4:14:a9:a8,channel=6,cipher_type:CCMP
    Info:MAIN:Time 101, idle 184274/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 31, socks 2/38 
    Info:MAIN:Time 102, idle 190062/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 32, socks 2/38 
    Info:MAIN:Time 103, idle 187374/s, free 62784, MQTT 1(1), bWifi 1, secondsWithNoPing 33, socks 3/38 
    Info:MAIN:Time 104, idle 188592/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 34, socks 2/38 
    Info:MAIN:Time 105, idle 182779/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 35, socks 2/38 
    Info:TuyaMCU:Consumed 30 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 02 60 28 01 22 00 00 10 8F 28 01 E2 01 10 08 43 28 01 A2 01 00 10 CA 28 01 C0 00 00 FF 
    Info:MAIN:Time 106, idle 186441/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 36, socks 2/38 
    Info:TuyaMCU:Consumed 30 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 02 60 28 01 22 00 00 14 1C 5E 22 61 08 00 00 43 28 01 A2 01 00 08 20 28 01 C0 00 00 F6 
    Info:TuyaMCU:Consumed 30 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 02 60 28 01 22 00 30 14 7C 61 27 61 08 00 00 43 28 01 A2 01 00 08 20 28 01 C0 00 00 F6 
    Info:MAIN:Time 108, idle 192834/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 38, socks 2/38 
    Info:TuyaMCU:Consumed 30 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 02 60 28 01 22 00 00 14 1C 5E 22 61 08 00 00 43 28 01 A2 01 00 10 CA 28 01 C0 00 00 F6 
    Info:MAIN:Time 109, idle 190954/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 39, socks 2/38 
    Info:TuyaMCU:Consumed 30 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 02 60 28 01 22 00 30 14 1C 61 27 61 08 00 00 43 28 01 A2 01 00 08 20 28 01 C0 00 00 F6 
    Info:MAIN:Time 110, idle 189372/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 40, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.30.25 gate=192.168.30.1 mask=255.255.255.0 mac=38:2c:e5:77:f7:df
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-64,ssid=xxxxxxx,bssid=22:61:b4:14:a9:a8,channel=6,cipher_type:CCMP
    Info:MAIN:Time 111, idle 181000/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 41, socks 2/38 
    Info:MAIN:Time 112, idle 190696/s, free 71400, MQTT 1(1), bWifi 1, secondsWithNoPing 42, socks 2/38
    
     [size=9]Added after 3 [minutes]:[/size]
    
    Info:CMD:[WebApp Cmd 'tuyaMcu_sendQueryState' Result] OK
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 6F 04 00 01 00 82 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 111 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 09 05 00 01 00 1D 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 9 type 5-bitmap len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 11 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 13 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 00 18 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 1 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 0C 06 00 00 08 00 00 00 00 00 00 00 00 23 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 19
    Info:TuyaMCU:ParseState: id 6 type 0-raw len 8
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 0C 01 00 01 00 1C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 12 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 16 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 12 00 00 04 01 01 02 76 A1 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 18 type 0-raw len 4
    Info:TuyaMCU:ParseState: int32 16843382
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 6B 02 00 04 00 00 00 0A 8C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 107 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 10
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 66 02 00 04 00 00 00 05 82 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 102 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 5
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 68 01 00 01 01 79 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 104 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 69 02 00 04 00 00 00 00 80 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 105 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 14 6A 03 00 10 45 77 41 41 41 41 41 41 41 41 41 41 41 41 3D 3D DC 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 27
    Info:TuyaMCU:ParseState: id 106 type 3-str len 16
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 6D 03 00 04 41 41 41 41 89 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 109 type 3-str len 4
    Info:TuyaMCU:ParseState: int32 1094795585
    Info:TuyaMCU:Consumed 30 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 02 60 28 01 22 00 00 14 FC 28 01 E2 01 00 08 43 28 01 A2 01 00 08 20 28 01 C0 00 00 FF 
    Info:MAIN:Time 912, idle 181401/s, free 68120, MQTT 1(1), bWifi 1, secondsWithNoPing 842, socks 5/38 
    Info:MAIN:Time 913, idle 190413/s, free 68336, MQTT 1(1), bWifi 1, secondsWithNoPing 843, socks 4/38 
    Info:MAIN:Time 914, idle 187569/s, free 68336, MQTT 1(1), bWifi 1, secondsWithNoPing 844, socks 4/38 
    Info:MAIN:Time 916, idle 195156/s, free 68320, MQTT 1(1), bWifi 1, secondsWithNoPing 846, socks 4/38 
    Info:MAIN:Time 917, idle 189979/s, free 68320, MQTT 1(1), bWifi 1, secondsWithNoPing 847, socks 4/38 
    Info:MAIN:Time 918, idle 186090/s, free 68320, MQTT 1(1), bWifi 1, secondsWithNoPing 848, socks 4/38 
    Info:MAIN:Time 920, idle 185949/s, free 68336, MQTT 1(1), bWifi 1, secondsWithNoPing 850, socks 4/38 
    Info:GEN:dhcp=0 ip=192.168.30.25 gate=192.168.30.1 mask=255.255.255.0 mac=38:2c:e5:77:f7:df
    
  • ADVERTISEMENT
  • #12 21572256
    p.kaczmarek2
    Moderator Smart Home
    So some data is received... TuyaMCU works, more or less.

    Btw, please edit post and put log in [ code ] tag, so it's more readable.

    Now, can you also try that DP command , enable that flag, and enter it in URL, as shown on my screenshot in previous post?

    Then copy paste all DP data here to forum, use syntax = json tag so it's more readable.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #13 21572265
    lubopetrov
    Level 2  
    >>21572256
    I apologize for not using the correct format in my posts.
    I don't understand "Now, can you also try that DP command." How to achieve this?
    Thank you for your patience with me.
  • #14 21572288
    p.kaczmarek2
    Moderator Smart Home
    p.kaczmarek2 wrote:

    There is command called DP.
    Screenshot of JSON with dpID data
    In order for it to work, you need to enable the following flag: flag 46.
    This will store last values of dpIDs in hex and allow you accessing them in JSON.
    After some time, maybe also do first tuyaMcu_sendQueryState again, and copy us text from DP command. Check on my screenshot how to enter it - you do it by device URL. It will show seen data points.

    1. In order for it to work, you need to enable the following flag: flag 46. (Config -> Configure General/Flags -> Enable flag 46, albo enable Flag 47 to get more data)
    Two checkboxes labeled Flag 46 - [TuyaMCU] Store raw data and Flag 47 - [TuyaMCU] Store ALL data, both unchecked.
    2. Use tuyaMcu_sendQueryState command in web app console once or twice to get more device state data
    3. As on screenshot, enter URL with your device IP, for example:
    
    http://192.168.0.163/cm?cmnd=DP
    

    Change 192.168.0.163 to your IP
    4. Copy results here to forum with syntax json tag
    Helpful post? Buy me a coffee.
  • #15 21572305
    lubopetrov
    Level 2  
    
    [
      {
        "id": 104,
        "type": 1,
        "data": 1
      },
      {
        "id": 102,
        "type": 2,
        "data": 5
      },
      {
        "id": 107,
        "type": 2,
        "data": 10
      },
      {
        "id": 18,
        "type": 0,
        "data": "01010276"
      }
    ]
    
  • #16 21572334
    p.kaczmarek2
    Moderator Smart Home
    That's all? I also would like to see a sample of dpID 9, which contains voltage, current and power.
    
    "Phase A","9":
    

    Can you try running device a bit longer, maybe execute tuyaMcu_sendQueryState several times, to get more data? And then give DP output again?

    Btw this is strange:
    
    
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 9 type 5-bitmap len 1
    Info:TuyaMCU:ParseState: byte 0
    

    So dpId 9 is raw bytes or bitmap? Huh
    Helpful post? Buy me a coffee.
  • #17 21572342
    lubopetrov
    Level 2  
    >>21572334
    Right now this device is connected only to the USB of the programmer. I guess this is why we don't see anything else. Should I connect it to my grid? Can I already remove the wires for the programmer?
    I don't see much in my home assistant. I'm submitting few screenshots here:
    Control panel screen for an IoT device named espresso_breaker showing firmware version, IP address, Wi-Fi signal strength, SSID, temperature, and uptime.
    Screenshot of a device configuration panel with various setting options and dropdown fields.
    LittleFS file management user interface with autoexec.bat file editor and file operation buttons.
    Configuration webpage for espresso_breaker software listing BK7231N pin setup with dropdown menus.
    Do I need to change something else?
  • #18 21572371
    p.kaczmarek2
    Moderator Smart Home
    You are correct, you won't get measurements without powering it fully. Disconnect it from programmer, desolder wires, and once it's disconnected, connect it to grid and recheck.

    Hopefully we will not have to reflash it again, so programmer wires should not be needed.

    The next step is to check full DP data and then I can start writing autoexec.bat for you.
    Helpful post? Buy me a coffee.
  • #19 21574074
    lubopetrov
    Level 2  
    Here is the latest. I connected the breaker to my grid. On the other side I have light bulb. I checked the physical button works as expected, but I cannot toggle the power via web interface. Also I don't see anything related to power to appear.
    Here is the log:
    
    Info:MAIN:Time 303, idle 192143/s, free 70800, MQTT 1(1), bWifi 1, secondsWithNoPing 233, socks 2/38 
    Info:MAIN:Time 304, idle 184915/s, free 70800, MQTT 1(1), bWifi 1, secondsWithNoPing 234, socks 2/38 
    Info:MAIN:Time 305, idle 374960/s, free 70800, MQTT 1(1), bWifi 1, secondsWithNoPing 235, socks 2/38 
    Info:MAIN:Time 306, idle 189818/s, free 70800, MQTT 1(1), bWifi 1, secondsWithNoPing 236, socks 2/38 
    Info:CMD:[WebApp Cmd 'tuyaMcu_sendQueryState' Result] OK
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 6F 04 00 01 00 82 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 111 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 09 05 00 01 00 1D 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 9 type 5-bitmap len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 11 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 13 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 00 18 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 1 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 0C 06 00 00 08 09 32 00 00 00 00 00 00 5E 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 19
    Info:TuyaMCU:ParseState: id 6 type 0-raw len 8
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 0C 01 00 01 00 1C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 12 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 10 01 00 01 00 20 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 16 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 12 00 00 04 01 01 02 76 A1 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 18 type 0-raw len 4
    Info:TuyaMCU:ParseState: int32 16843382
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 6B 02 00 04 00 00 00 0A 8C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 107 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 10
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 66 02 00 04 00 00 00 05 82 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 102 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 5
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 68 01 00 01 01 79 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 104 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 69 02 00 04 00 00 00 00 80 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 105 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 14 6A 03 00 10 45 77 41 41 41 41 41 41 41 41 41 41 41 41 3D 3D DC 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 27
    Info:TuyaMCU:ParseState: id 106 type 3-str len 16
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 6D 03 00 04 41 41 41 41 89 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 109 type 3-str len 4
    Info:TuyaMCU:ParseState: int32 1094795585
    Info:MAIN:Time 307, idle 160286/s, free 70584, MQTT 1(1), bWifi 1, secondsWithNoPing 237, socks 3/38 
    Info:TuyaMCU:Consumed 15 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 01 22 00 42 09 00 00 60 28 01 E0 00 00 F8 
    Info:MAIN:Time 308, idle 167810/s, free 70800, MQTT 1(1), bWifi 1, secondsWithNoPing 238, socks 2/38 
    Info:MAIN:Time 309, idle 192888/s, free 70800, MQTT 1(1), bWifi 1, secondsWithNoPing 239, socks 2/38 
    Info:MAIN:Time 310, idle 186729/s, free 70800, MQTT 1(1), bWifi 1, secondsWithNoPing 240, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.30.25 gate=192.168.30.1 mask=255.255.255.0 mac=38:2c:e5:77:f7:df
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-66,ssid=xxxxxxx,bssid=22:61:b4:14:a9:a8,channel=6,cipher_type:CCMP
    Info:MAIN:Time 311, idle 190404/s, free 70800, MQTT 1(1), bWifi 1, secondsWithNoPing 241, socks 2/38 
    Info:MAIN:Time 312, idle 187569/s, free 70800, MQTT 1(1), bWifi 1, secondsWithNoPing 242, socks 2/38 
    Info:MAIN:Time 313, idle 190168/s, free 70800, MQTT 1(1), bWifi 1, secondsWithNoPing 243, socks 2/38 
    
  • #20 21574373
    p.kaczmarek2
    Moderator Smart Home
    It won't appear unless we configure it first.

    Ah, I misread, dpID 6 is PhaseA:
    
    Info:TuyaMCU:Received: 55 AA 03 07 00 0C 06 00 00 08 09 32 00 00 00 00 00 00 5E 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 19
    Info:TuyaMCU:ParseState: id 6 type 0-raw len 8
    

    So it has 8 bytes payload...
    This is header, type and length: 55 AA 03 07 00 0C 06 00 00 08
    This is payload:
    09 32 00 00
    00 00 00 00
    This is checksum:
    5E

    0932 hex is 2354, which should mean 235.4 volts. Other values are 0, so 0 current...

    Are you really sure there is a bulb?


    For now, maybe try:
    
    // Start TuyaMCu driver
    startDriver TuyaMCU
    // set TuyaMCU baud rate
    //tuyaMcu_setBaudRate 115200
    // set TuyaMCU default wifi state 0x04, which means "paired",
    // because some TuyaMCU MCUs will not report all data
    // unless they think they are connected to cloud
    tuyaMcu_defWiFiState 4
    
    setChannelType 1 toggle
    setChannelType 2 toggle
    // linkTuyaMCUOutputToChannel dpId verType tgChannel
    linkTuyaMCUOutputToChannel 12 bool 1
    linkTuyaMCUOutputToChannel 16 bool  2
    

    Do any of new button toggles output on or off?

    Those IDs (12 and 16) are present in your OBK log, but are missing from json with data point names...
    Helpful post? Buy me a coffee.
  • #21 21574417
    lubopetrov
    Level 2  
    >>21574373
    Ok. Toggle 2 is turning On/Off the bulb. But I don't understand why I see toggle 1? Do we need it? Still no power consumption related data. And yes the light is LED bulb for now.
    Screenshot of the espresso_breaker device control panel with two toggles, both set to OFF.
    Do I need to have this in startup?
    Configuration screen for the startup command of a smart home device named espresso_breaker.

    Here is the current output
    
    Info:MAIN:Time 802, idle 191987/s, free 70800, MQTT 1(1), bWifi 1, secondsWithNoPing 732, socks 2/38 
    Info:CMD:[WebApp Cmd 'tuyaMcu_sendQueryState' Result] OK
    Info:TuyaMCU:Consumed 3 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 28 07 C0 
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 6F 04 00 01 01 83 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 111 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 09 05 00 01 00 1D 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 9 type 5-bitmap len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 11 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 13 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 00 18 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 1 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 0C 06 00 00 08 09 26 00 00 33 00 00 0E 93 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 19
    Info:TuyaMCU:ParseState: id 6 type 0-raw len 8
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 0C 01 00 01 00 1C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 12 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:GEN:No change in channel 1 (still set to 0) - ignoring
    
    Warn:EnergyMeter:Skipping packet with bad checksum 01 wanted 3E
    Info:MAIN:Time 803, idle 176133/s, free 70608, MQTT 1(1), bWifi 1, secondsWithNoPing 733, socks 2/38 
    Info:TuyaMCU:Consumed 4 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 01 02 76 A1 
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 6B 02 00 04 00 00 00 0A 8C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 107 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 10
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 66 02 00 04 00 00 00 05 82 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 102 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 5
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 68 01 00 01 01 79 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 104 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 69 02 00 04 00 00 00 00 80 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 105 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Warn:EnergyMeter:Skipping packet with bad checksum 06 wanted 0B
    Info:MAIN:Time 804, idle 169558/s, free 70232, MQTT 1(1), bWifi 1, secondsWithNoPing 734, socks 2/38 
    Info:MAIN:Time 805, idle 187085/s, free 58840, MQTT 1(1), bWifi 1, secondsWithNoPing 735, socks 3/38 
    Info:MAIN:Time 806, idle 193334/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 736, socks 2/38 
    Info:MAIN:Time 807, idle 187870/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 737, socks 2/38 
    Info:MAIN:Time 808, idle 191935/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 738, socks 2/38 
    Info:MAIN:Time 809, idle 192856/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 739, socks 2/38 
    Info:MAIN:Time 810, idle 189302/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 740, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.30.25 gate=192.168.30.1 mask=255.255.255.0 mac=38:2c:e5:77:f7:df
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-67,ssid=xxxxxxx,bssid=22:61:b4:14:a9:a8,channel=6,cipher_type:CCMP
    Info:MAIN:Time 811, idle 188849/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 741, socks 2/38 
    Info:MAIN:Time 812, idle 191121/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 742, socks 2/38 
    Info:MAIN:Time 813, idle 194555/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 743, socks 2/38 
    Info:MAIN:Time 814, idle 194807/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 744, socks 2/38 
    Info:MAIN:Time 815, idle 189400/s, free 61928, MQTT 1(1), bWifi 1, secondsWithNoPing 745, socks 3/38 
    Info:MAIN:Time 816, idle 205220/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 746, socks 2/38 
    Info:MAIN:Time 817, idle 192619/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 747, socks 2/38 
    Info:MAIN:Time 818, idle 193434/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 748, socks 2/38 
    Info:MAIN:Time 819, idle 191711/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 749, socks 2/38 
    Info:MAIN:Time 820, idle 190467/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 750, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.30.25 gate=192.168.30.1 mask=255.255.255.0 mac=38:2c:e5:77:f7:df
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-64,ssid=xxxxxxx,bssid=22:61:b4:14:a9:a8,channel=6,cipher_type:CCMP
    Info:MAIN:Time 821, idle 201337/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 751, socks 2/38 
    Info:MAIN:Time 822, idle 194136/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 752, socks 2/38 
    Info:MAIN:Time 823, idle 193103/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 753, socks 2/38 
    Info:MAIN:Time 824, idle 193453/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 754, socks 2/38 
    Info:MAIN:Time 825, idle 188817/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 755, socks 2/38 
    Info:MAIN:Time 826, idle 194373/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 756, socks 2/38 
    Info:MAIN:Time 827, idle 190823/s, free 70536, MQTT 1(1), bWifi 1, secondsWithNoPing 757, socks 2/38 
    
    
  • #22 21574447
    p.kaczmarek2
    Moderator Smart Home
    I added two toggles because I didn't know which dpID is which.

    You don't need BL0942 driver start. It can only cause problems. The power metering is done by TuyaMCU via autoexec.bat.

    I see you posted... new dpID 6 sample.
    Let's see.
    Header:
    55 AA 03 07 00 0C 06 00 00 08
    Payload:
    09 26 -> 234.2 voltage
    00 00 33 -> 51 ? 51 mA?
    00 00 0E -> 14 ? 14 W?
    Checksum:
    93
    However I am not sure. Can you tell me what is the expected power (in watts) of bulb you connected?
    Helpful post? Buy me a coffee.
  • #23 21574570
    lubopetrov
    Level 2  
    >>21574447
    According to the label is 15w
    How do I remove toggle 1? I removed setChannelType 1 toggle from autoexec.bat but it is still showing on UI. And how to set the correct output for wattage and voltage?
  • #24 21574681
    p.kaczmarek2
    Moderator Smart Home
    You need to open "Web App" and then in channel types dropdown change it back to default.

    So, let's try next autoexec bat. Make sure to have latest obk.

    
    
    // Start TuyaMCu driver
    startDriver TuyaMCU
    // set TuyaMCU baud rate
    //tuyaMcu_setBaudRate 115200
    // set TuyaMCU default wifi state 0x04, which means "paired",
    // because some TuyaMCU MCUs will not report all data
    // unless they think they are connected to cloud
    tuyaMcu_defWiFiState 4
    
    setChannelType 2 toggle
    // linkTuyaMCUOutputToChannel dpId verType tgChannel
    linkTuyaMCUOutputToChannel 16 bool  2
    // set voltage, current ,power channel types
    setChannelType 3 Voltage_div10
    setChannelType 4 Current_div1000
    setChannelType 5 Power
    // map dpID 6, which is VCP format, to first voltage, then current, then power (3, 4, 5)
    linkTuyaMCUOutputToChannel 6 RAW_V2C3P3  3
    
    
    
    Helpful post? Buy me a coffee.
  • #25 21574876
    lubopetrov
    Level 2  
    >>21574681
    WOW, power/current and voltage appeared. Thanks.

    Control panel for the espresso_breaker device, ON status, showing voltage, current, power, and control buttons.

    I noticed something strange too. When I rebooted the device a few times it toggled by itself. Could be something with the browser. Can you get out the consumption summary and anything else that could be useful? Do I need to leave the bulb on for a prolonged time?
  • #26 21574914
    p.kaczmarek2
    Moderator Smart Home
    Try rebooting with browser closed, just to be sure.

    Well, there is dpID 1 called "Total forward energy", but I'm not sure what is the unit used here. It's 0 currently, or is it?
    
    Info:TuyaMCU:ParseState: id 1 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    


    We can try to add it but maybe you need to leave bulb running for a bit longer time:
    
    
    
    // Start TuyaMCu driver
    startDriver TuyaMCU
    // set TuyaMCU baud rate
    //tuyaMcu_setBaudRate 115200
    // set TuyaMCU default wifi state 0x04, which means "paired",
    // because some TuyaMCU MCUs will not report all data
    // unless they think they are connected to cloud
    tuyaMcu_defWiFiState 4
    
    setChannelType 1 ReadOnly
    setChannelType 2 toggle
    // linkTuyaMCUOutputToChannel dpId verType tgChannel
    linkTuyaMCUOutputToChannel 16 bool  2
    // set voltage, current ,power channel types
    setChannelType 3 Voltage_div10
    setChannelType 4 Current_div1000
    setChannelType 5 Power
    // map dpID 6, which is VCP format, to first voltage, then current, then power (3, 4, 5)
    linkTuyaMCUOutputToChannel 6 RAW_V2C3P3  3
    
    // map dpID 1, which is energy, to channel 1
    linkTuyaMCUOutputToChannel 1 val 1
    
    
    

    I don't know the type of id 1, is it in Wh? We need to check.
    Helpful post? Buy me a coffee.
  • #27 21574921
    lubopetrov
    Level 2  
    >>21574914
    Later today I will go to buy an incandescent bulb and I will post the new log
  • #28 21574926
    p.kaczmarek2
    Moderator Smart Home
    I've checked your first post again and it seems that dpID 1 matches this:
    total_forward_energy Integer
    {
    "unit": "kW·h",
    "min": 0,
    "max": 99999999,
    "scale": 2,
    "step": 1
    }

    So it's kWh but requires scaling by 100, so raw value is in 10Wh. So, when dpID 1 is 1, then its' 10 Wh. If it's 123, then it's 1230 Wh, etc. Still, we need to check.

    This device will not show single Wh due to the low precision.
    Helpful post? Buy me a coffee.
  • #29 21575291
    lubopetrov
    Level 2  
    >>21574926
    I changed the light bulb to 100watts. Looks like id 1 has changed
    Info:TuyaMCU:ParseState: id 1 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 9
    After running it almost 1hr this is the output:
    
    Info:MAIN:Time 3294, idle 192330/s, free 62080, MQTT 1(1), bWifi 1, secondsWithNoPing 3223, socks 3/38 
    Info:MAIN:Time 3295, idle 190496/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3224, socks 2/38 
    Info:MAIN:Time 3296, idle 189085/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3225, socks 2/38 
    Info:CMD:[WebApp Cmd 'tuyaMcu_sendQueryState' Result] OK
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 6F 04 00 01 01 83 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 111 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 09 05 00 01 00 1D 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 9 type 5-bitmap len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 11 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 13 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 09 21 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 1 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 9
    Info:GEN:CHANNEL_Set channel 1 has changed to 9 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 9 to channel 1 
    Info:MQTT:Publishing val 9 to obkE577F7DF/1/get retain=0
    Info:TuyaMCU:Received: 55 AA 03 07 00 0C 06 00 00 08 09 44 00 01 8A 00 00 5F 5A 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 19
    Info:TuyaMCU:ParseState: id 6 type 0-raw len 8
    Info:GEN:No change in channel 3 (still set to 2372) - ignoring
    
    Info:GEN:CHANNEL_Set channel 4 has changed to 394 (flags 0)
    
    Info:MQTT:Channel has changed! Publishing 394 to channel 4 
    Info:MQTT:Publishing val 394 to obkE577F7DF/4/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obkE577F7DF/1/get
    Info:GEN:No change in channel 5 (still set to 95) - ignoring
    
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 0C 01 00 01 00 1C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 12 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 16 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:GEN:No change in channel 2 (still set to 1) - ignoring
    
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 12 00 00 04 01 01 02 76 A1 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 18 type 0-raw len 4
    Info:TuyaMCU:ParseState: int32 16843382
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obkE577F7DF/4/get
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 6B 02 00 04 00 00 00 0A 8C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 107 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 10
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 66 02 00 04 00 00 00 05 82 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 102 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 5
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 68 01 00 01 01 79 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 104 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 69 02 00 04 00 00 00 00 80 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 105 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 14 6A 03 00 10 45 77 41 41 41 41 41 41 41 41 41 41 41 41 3D 3D DC 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 27
    Info:TuyaMCU:ParseState: id 106 type 3-str len 16
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 6D 03 00 04 41 41 41 41 89 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 109 type 3-str len 4
    Info:TuyaMCU:ParseState: int32 1094795585
    Info:MAIN:Time 3297, idle 112021/s, free 70256, MQTT 1(1), bWifi 1, secondsWithNoPing 3226, socks 3/38 
    Info:TuyaMCU:Received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 0 (Hearbeat) len 8
    Info:MAIN:Time 3298, idle 188396/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3227, socks 2/38 
    Info:MAIN:Time 3299, idle 192400/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3228, socks 2/38 
    Info:MAIN:Time 3300, idle 189982/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3229, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.30.25 gate=192.168.30.1 mask=255.255.255.0 mac=38:2c:e5:77:f7:df
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-69,ssid=xxxxxxxx,bssid=22:61:b4:14:a9:a8,channel=1,cipher_type:CCMP
    Info:MAIN:Time 3301, idle 185502/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3230, socks 2/38 
    Info:TuyaMCU:Received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 0 (Hearbeat) len 8
    Info:MAIN:Time 3302, idle 193300/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3231, socks 2/38 
    Info:MAIN:Time 3303, idle 187675/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3232, socks 2/38 
    Info:MAIN:Time 3304, idle 193735/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3233, socks 2/38 
    Info:MAIN:Time 3305, idle 196690/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3234, socks 2/38 
    Info:TuyaMCU:Received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 0 (Hearbeat) len 8
    Info:MAIN:Time 3306, idle 192778/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3235, socks 2/38 
    Info:MAIN:Time 3307, idle 190111/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3236, socks 2/38 
    Info:TuyaMCU:Received: 55 AA 03 03 00 00 05 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 3 (WiFiState) len 7
    Info:MAIN:Time 3308, idle 192318/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 3237, socks 2/38 
    
    


    Added after 1 [hours] 13 [minutes]:

    >>21575291
    This the second log after 2hr bulb running. I guess id 1 is where the w/h are stored. Now the reading is 21. Btw I restarted the device few times but the reading stays at last value.
    
    Info:MAIN:Time 7801, idle 184783/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 7730, socks 2/38 
    Info:TuyaMCU:Received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 0 (Hearbeat) len 8
    Info:MAIN:Time 7802, idle 186564/s, free 70256, MQTT 1(1), bWifi 1, secondsWithNoPing 7731, socks 3/38 
    Info:MAIN:Time 7803, idle 194657/s, free 58776, MQTT 1(1), bWifi 1, secondsWithNoPing 7732, socks 3/38 
    Info:MAIN:Time 7804, idle 197935/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 7733, socks 2/38 
    Info:MAIN:Time 7805, idle 195999/s, free 58776, MQTT 1(1), bWifi 1, secondsWithNoPing 7734, socks 3/38 
    Info:TuyaMCU:Received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 0 (Hearbeat) len 8
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 12 00 00 04 01 01 02 76 A1 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 18 type 0-raw len 4
    Info:TuyaMCU:ParseState: int32 16843382
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 6B 02 00 04 00 00 00 0A 8C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 107 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 10
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 66 02 00 04 00 00 00 05 82 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 102 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 5
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 68 01 00 01 01 79 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 104 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:MAIN:Time 7806, idle 176506/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 7735, socks 2/38 
    Info:CMD:[WebApp Cmd 'tuyaMcu_sendQueryState' Result] OK
    Info:MAIN:Time 7807, idle 189891/s, free 70168, MQTT 1(1), bWifi 1, secondsWithNoPing 7736, socks 2/38 
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 6F 04 00 01 01 83 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 111 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 09 05 00 01 00 1D 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 9 type 5-bitmap len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 0B 01 00 01 00 1B 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 11 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 0D 02 00 04 00 00 00 00 24 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 13 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 01 02 00 04 00 00 00 15 2D 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 1 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 21
    Info:GEN:No change in channel 1 (still set to 21) - ignoring
    
    Info:TuyaMCU:Received: 55 AA 03 07 00 0C 06 00 00 08 09 15 00 01 85 00 00 5C 23 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 19
    Info:TuyaMCU:ParseState: id 6 type 0-raw len 8
    Info:GEN:No change in channel 3 (still set to 2325) - ignoring
    
    Info:GEN:No change in channel 4 (still set to 389) - ignoring
    
    Info:GEN:No change in channel 5 (still set to 92) - ignoring
    
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 0C 01 00 01 00 1C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 12 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 16 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:GEN:No change in channel 2 (still set to 1) - ignoring
    
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 12 00 00 04 01 01 02 76 A1 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 18 type 0-raw len 4
    Info:TuyaMCU:ParseState: int32 16843382
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 6B 02 00 04 00 00 00 0A 8C 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 107 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 10
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 66 02 00 04 00 00 00 05 82 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 102 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 5
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 68 01 00 01 01 79 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 104 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 69 02 00 04 00 00 00 00 80 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 105 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 14 6A 03 00 10 45 77 41 41 41 41 41 41 41 41 41 41 41 41 3D 3D DC 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 27
    Info:TuyaMCU:ParseState: id 106 type 3-str len 16
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 6D 03 00 04 41 41 41 41 89 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 109 type 3-str len 4
    Info:TuyaMCU:ParseState: int32 1094795585
    Info:MAIN:Time 7809, idle 193658/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 7738, socks 2/38 
    Info:TuyaMCU:Received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 0 (Hearbeat) len 8
    Info:MAIN:Time 7810, idle 193501/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 7739, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.30.25 gate=192.168.30.1 mask=255.255.255.0 mac=38:2c:e5:77:f7:df
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-67,ssid=xxxxxxx,bssid=22:61:b4:14:a9:a8,channel=1,cipher_type:CCMP
    Info:MAIN:Time 7812, idle 189736/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 7741, socks 2/38 
    Info:MAIN:Time 7813, idle 189210/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 7742, socks 2/38 
    Info:TuyaMCU:Received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 0 (Hearbeat) len 8
    Info:MAIN:Time 7814, idle 188952/s, free 58776, MQTT 1(1), bWifi 1, secondsWithNoPing 7743, socks 3/38 
    Info:MAIN:Time 7816, idle 192015/s, free 58776, MQTT 1(1), bWifi 1, secondsWithNoPing 7745, socks 3/38 
    Info:TuyaMCU:Received: 55 AA 03 2B 00 00 2D 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 43 (NetworkStatus) len 7
    Info:TuyaMCU:ProcessIncoming: (test for S09 calendar/IR device) received TUYA_CMD_NETWORK_STATUS 0x2B 
    Info:MAIN:Time 7817, idle 190416/s, free 61864, MQTT 1(1), bWifi 1, secondsWithNoPing 7746, socks 3/38 
    Info:TuyaMCU:Received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 0 (Hearbeat) len 8
    Info:MAIN:Time 7818, idle 190004/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 7747, socks 2/38 
    Info:MAIN:Time 7820, idle 191448/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 7749, socks 2/38 
    Info:GEN:dhcp=0 ip=192.168.30.25 gate=192.168.30.1 mask=255.255.255.0 mac=38:2c:e5:77:f7:df
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-67,ssid=xxxxxx,bssid=22:61:b4:14:a9:a8,channel=1,cipher_type:CCMP
    Info:MAIN:Time 7821, idle 188616/s, free 70472, MQTT 1(1), bWifi 1, secondsWithNoPing 7750, socks 2/38 
    Info:TuyaMCU:Received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 0 (Hearbeat) len 8
    
    
  • #30 21578257
    lubopetrov
    Level 2  
    I flashed the second unit and loaded the same autoexec.bat file. It does show the readings for Volt, Power and Current, but the toggle is not functional.
    Here is the output from the log:
    
    Info:CMD:[WebApp Cmd 'tuyaMcu_sendQueryState' Result] OK
    Info:MAIN:Time 12345, idle 187953/s, free 70864, MQTT 0(771), bWifi 1, secondsWithNoPing 12275, socks 2/38 
    Info:TuyaMCU:Received: 55 AA 03 1C 00 00 1E 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 28 (SetTime) len 7
    Info:TuyaMCU:ProcessIncoming: received TUYA_CMD_SET_TIME, so sending back time
    Info:TuyaMCU:MCU time to set: 0
    Info:TuyaMCU:ptime ->gmtime => tm_hour: 0
    Info:TuyaMCU:ptime ->gmtime => tm_min: 0
    Info:MAIN:Time 12346, idle 189166/s, free 70864, MQTT 0(771), bWifi 1, secondsWithNoPing 12276, socks 2/38 
    Info:CMD:[WebApp Cmd '' Result] No command entered
    Info:CMD:[WebApp Cmd '' Result] No command entered
    Info:MAIN:Time 12347, idle 187876/s, free 70864, MQTT 0(771), bWifi 1, secondsWithNoPing 12277, socks 2/38 
    Info:TuyaMCU:Received: 55 AA 03 1C 00 00 1E 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 28 (SetTime) len 7
    Info:TuyaMCU:ProcessIncoming: received TUYA_CMD_SET_TIME, so sending back time
    Info:TuyaMCU:MCU time to set: 0
    Info:TuyaMCU:ptime ->gmtime => tm_hour: 0
    Info:TuyaMCU:ptime ->gmtime => tm_min: 0
    Info:MAIN:Time 12348, idle 195007/s, free 59168, MQTT 0(771), bWifi 1, secondsWithNoPing 12278, socks 3/38 
    Info:TuyaMCU:Received: 55 AA 03 1C 00 00 1E 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 28 (SetTime) len 7
    Info:TuyaMCU:ProcessIncoming: received TUYA_CMD_SET_TIME, so sending back time
    Info:TuyaMCU:MCU time to set: 0
    Info:TuyaMCU:ptime ->gmtime => tm_hour: 0
    Info:TuyaMCU:ptime ->gmtime => tm_min: 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 0C 06 00 00 08 09 3D 00 01 8B 00 00 5F 54 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 19
    Info:TuyaMCU:ParseState: id 6 type 0-raw len 8
    Info:GEN:CHANNEL_Set channel 3 has changed to 2365 (flags 0)
    
    Info:TuyaMCU:OnChannelChanged: channel 3: unsupported data point type 206-error
    Info:MQTT:Channel has changed! Publishing 2365 to channel 3 
    Info:GEN:No change in channel 4 (still set to 395) - ignoring
    
    Info:GEN:No change in channel 5 (still set to 95) - ignoring
    
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 6F 04 00 01 01 83 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 111 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 12349, idle 173388/s, free 70864, MQTT 0(772), bWifi 1, secondsWithNoPing 12279, socks 2/38 
    Info:TuyaMCU:Received: 55 AA 03 1C 00 00 1E 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 28 (SetTime) len 7
    Info:TuyaMCU:ProcessIncoming: received TUYA_CMD_SET_TIME, so sending back time
    Info:TuyaMCU:MCU time to set: 0
    

    Also http://192.168.30.155/cm?cmnd=DP produces following:
    
    [
      {
        "id": 11,
        "type": 1,
        "data": 0
      },
      {
        "id": 13,
        "type": 2,
        "data": 0
      },
      {
        "id": 104,
        "type": 1,
        "data": 1
      },
      {
        "id": 102,
        "type": 2,
        "data": 5
      },
      {
        "id": 107,
        "type": 2,
        "data": 10
      },
      {
        "id": 18,
        "type": 0,
        "data": "01010276"
      },
      {
        "id": 111,
        "type": 4,
        "data": 0
      },
      {
        "id": 1,
        "type": 2,
        "data": 7
      },
      {
        "id": 6,
        "type": 206,
        "data": "0931000000000000"
      },
      {
        "id": 16,
        "type": 1,
        "data": 1
      }
    

    I compared this code to the one I posted earlier and I can see here is more data present.
    Can you please take look?
ADVERTISEMENT