logo elektroda
logo elektroda
X
logo elektroda

Home Assistant Integration: Reflashing BK7231N in Tuya Smart DIN-rail Energy Meter TAC2121C

tomanyusers 6807 60
ADVERTISEMENT
  • #31 20332687
    tomanyusers
    Level 3  
    Hi

    I tested "tuyaMcu_sendRSSI -80" and it works perfectly.

    I checked again and it's definitely "uartSendHex 55AA000300010407" the 03 is correct.

    Sending the "Tuya_SetWifiState" manually I get the following
    Error:CMD:cmd Tuya_SetWifiState NOT found (args 1)
  • ADVERTISEMENT
  • #32 20332688
    p.kaczmarek2
    Moderator Smart Home
    Thanks,

    but to be clear:
    tomanyusers wrote:

    I checked again and its definitely "uartSendHex 55AA000300010407" the 03 is correct.

    Sending the "Tuya_SetWifiState" manually I get the following
    Error:CMD:cmd Tuya_SetWifiState NOT found (args 1)

    I meant that current code should itself send that packet if MQTT and WiFi are connected. Do you have them both connected?
    Home Assistant Integration: Reflashing BK7231N in Tuya Smart DIN-rail Energy Meter TAC2121C

    It should not be needed to send "55AA000300010407" manually.

    Unless there is some kind of bug... maybe protocol difference....
    Helpful post? Buy me a coffee.
  • #33 20332702
    tomanyusers
    Level 3  
    Yes, the meter is connected to the WiFi and is publishing to my MQTT Broker.

    But still needed to manually send the command.
  • #34 20332951
    p.kaczmarek2
    Moderator Smart Home
    No idea what's wrong, we have to debug.

    Update to latest build, add an extra line "loglevel 6" to your autoexec, also change runtime log level to ExtraDebug:
    Home Assistant Integration: Reflashing BK7231N in Tuya Smart DIN-rail Energy Meter TAC2121C
    and reboot, what does it shows for you? Paste full log.
    You can disable non-TuyaMCU options in logging.
    Helpful post? Buy me a coffee.
  • #35 20332980
    tomanyusers
    Level 3  
    Hi

    Will this do?

    
    
    Info:NTP:Seconds since Jan 1 1900 = 3879930027
    Info:NTP:Unix time  : 1670941227
    Info:NTP:Local Time : 2022/12/13 14:20:27
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 02 00 00 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 2 (MCUconf) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: TUYA_CMD_MCU_CONF had wrong data lenght?
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 4, idle 466643/s, free 81416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    Info:MAIN:Time 5, idle 468467/s, free 81416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:ssid:NewNet key:XXXXX
    Debug:MAIN:Registered for wifi changes
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=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
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 6, idle 459076/s, free 75824, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 7, idle 461054/s, free 75824, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 8, idle 278206/s, free 76032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    Info:MAIN:Time 9, idle 0/s, free 76032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=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
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 10, idle 0/s, free 76032, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=a0:92:08:73:4c:21 
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:wl_status 3
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING
    Info:MAIN:wl_status 10
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED
    Info:MAIN:wl_status 11
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 11, idle 139474/s, free 76272, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 12, idle 460918/s, free 76312, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:mqtt_userName homeassistant
    mqtt_pass qqqqqqqqqq
    mqtt_clientID BK7231N_TAC2121C_obk08734C21
    mqtt_host mqtt.home:1883
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    Info:MAIN:Time 13, idle 458260/s, free 76224, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:mqtt_connection_cb: Successfully connected
    Info:MQTT:mqtt_subscribed to BK7231N_TAC2121C_obk08734C21/+/set
    Info:MQTT:mqtt_subscribed to cmnd/BK7231N_TAC2121C_obk08734C21/+
    Info:MQTT:MQTT client "BK7231N_TAC2121C_obk08734C21" request cb: err 0
    Info:MQTT:MQTT client "BK7231N_TAC2121C_obk08734C21" request cb: err 0
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [logfeature 8 1]
    Debug:CMD:logfeature set 0x01FFFDFF
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=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
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 14, idle 445322/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [logfeature 8 0]
    Debug:CMD:logfeature set 0x01FFFCFF
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 15, idle 444805/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 16, idle 460904/s, free 64096, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 4/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    Info:NTP:Seconds since Jan 1 1900 = 3879930045
    Info:NTP:Unix time  : 1670941245
    Info:NTP:Local Time : 2022/12/13 14:20:45
    Info:MAIN:Time 17, idle 455424/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=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
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 18, idle 458336/s, free 76008, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 19, idle 448381/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 20, idle 458007/s, free 64528, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Info:GEN:dhcp=0 ip=192.168.1.106 gate=192.168.1.1 mask=255.255.255.0 mac=a0:92:08:73:4c:21 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-60,ssid=NewNet,bssid=4c:5e:0c:a2:23:b7 ,channel=5,cipher_type:CCMP
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    Info:MAIN:Time 21, idle 456973/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=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
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 22, idle 459214/s, free 64528, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 23, idle 449104/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 24, idle 455740/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    Info:MAIN:Time 25, idle 455162/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=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
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 26, idle 455889/s, free 76008, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 27, idle 449004/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 28, idle 453804/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    Info:MAIN:Time 29, idle 456605/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=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
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 30, idle 462532/s, free 76008, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Info:GEN:dhcp=0 ip=192.168.1.106 gate=192.168.1.1 mask=255.255.255.0 mac=a0:92:08:73:4c:21 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-63,ssid=NewNet,bssid=4c:5e:0c:a2:23:b7 ,channel=5,cipher_type:CCMP
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 31, idle 447420/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Boot complete time reached (30 seconds)
    Info:CFG:####### Set Boot Complete #######
    Debug:CFG:new offset 5956, boot_count 48, success count 48
    Debug:CFG:new offset after read 5956, boot_count 48, success count 48
    Debug:CFG:re-read - offset 5956, boot count 48, boot success 48, bootfailures 0
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 32, idle 444603/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    Info:MAIN:Time 33, idle 455921/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=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
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 34, idle 457089/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 35, idle 450202/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false).
    Info:MAIN:Time 36, idle 454764/s, free 76224, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    
    
  • #36 20333072
    p.kaczmarek2
    Moderator Smart Home
    It seems like the device doesnt' answer the TUYA_CMD_QUERY_STATE until a TUYA_CMD_WIFI_STATE is set. I've added a crude mechanism to send TUYA_CMD_WIFI_STATE is device didn't answer to QUERY, can you check now? The final solution is still TODO
    Helpful post? Buy me a coffee.
  • #37 20333301
    tomanyusers
    Level 3  
    Here are the logs. Does not seem to be working. Running Version 1.15.177

    
    NTP driver initialized with server=217.147.223.78, offset=0
    Info:MAIN:Started NTP.
    Info:GEN:Channel 1 type changed to toggle
    Info:GEN:Channel 2 type changed to Voltage_div10
    Info:GEN:Channel 3 type changed to Power
    Info:GEN:Channel 4 type changed to Current_div1000
    Info:GEN:Channel 5 type changed to EnergyTotal_kWh_div100
    Error:CMD:cmd // NOT found (args link id 16 to channel 1)
    Error:CMD:cmd // NOT found (args link id 1 to channel 5)
    Error:CMD:cmd // NOT found (args TAC2121C VoltageCurrentPower Packet)
    Error:CMD:cmd // NOT found (args This will automatically set voltage, power and current)
    Debug:CMD:loglevel set 6
    Debug:CMD:closed file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    Debug:MAIN:started timer
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 1, idle 654583/s, free 81416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 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:MAIN:Time 2, idle 462690/s, free 81416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 01 00 2A 7B 22 70 22 3A 22 6C 69 68 34 76 6A 65 6F 79 61 6F 34 6A 65 6B 75 22 2C 22 76 22 3A 22 32 2E 30 2E 30 22 2C 22 6D 22 3A 30 7D 41 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 1 (QueryProductInformation) with 49 bytes
    Info:TuyaMCU:TuyaMCU_ParseQueryProductInformation: received {"p":"lih4vjeoyao4jeku","v":"2.0.0","m":0}
    Info:MAIN:Time 3, idle 461201/s, free 81416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 02 00 00 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 2 (MCUconf) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: TUYA_CMD_MCU_CONF had wrong data lenght?
    Info:MAIN:Time 4, idle 460334/s, free 81416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 5, idle 461410/s, free 81416, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:ssid:NewNet key:cabannas
    Debug:MAIN:Registered for wifi changes
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 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:MAIN:Time 6, idle 449800/s, free 75824, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 7, idle 451713/s, free 75752, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 8, idle 275141/s, free 75888, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 9, idle 0/s, free 75888, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 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:MAIN:Time 10, idle 0/s, free 75888, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=a0:92:08:73:4c:21 
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:wl_status 3
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING
    Info:MAIN:wl_status 10
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED
    Info:MAIN:wl_status 11
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 11, idle 140856/s, free 76200, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [logfeature 7 0]
    Debug:CMD:logfeature set 0x01FFFD7F
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [logfeature 7 1]
    Debug:CMD:logfeature set 0x01FFFDFF
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 12, idle 439115/s, free 76240, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:mqtt_userName homeassistant
    mqtt_pass qqqqqqqqqq
    mqtt_clientID BK7231N_TAC2121C_obk08734C21
    mqtt_host mqtt.home:1883
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 13, idle 456971/s, free 76152, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:mqtt_connection_cb: Successfully connected
    Info:MQTT:mqtt_subscribed to BK7231N_TAC2121C_obk08734C21/+/set
    Info:MQTT:mqtt_subscribed to cmnd/BK7231N_TAC2121C_obk08734C21/+
    Info:MQTT:MQTT client "BK7231N_TAC2121C_obk08734C21" request cb: err 0
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [logfeature 7 0]
    Debug:CMD:logfeature set 0x01FFFD7F
    Info:MQTT:MQTT client "BK7231N_TAC2121C_obk08734C21" request cb: err 0
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 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:MAIN:Time 14, idle 438537/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 15, idle 433117/s, free 64456, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 16, idle 448986/s, free 75720, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:NTP:Seconds since Jan 1 1900 = 3879987174
    Info:NTP:Unix time  : 1670998374
    Info:NTP:Local Time : 2022/12/14 06:12:54
    Info:MAIN:Time 17, idle 446511/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 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:MAIN:Time 18, idle 447566/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 19, idle 445345/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 20, idle 449869/s, free 64456, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 21, idle 451053/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 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:MAIN:Time 22, idle 447091/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 23, idle 442306/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 24, idle 454674/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 25, idle 448895/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 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:MAIN:Time 26, idle 450561/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 27, idle 440131/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 28, idle 455007/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 29, idle 450873/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 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:MAIN:Time 30, idle 446012/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 31, idle 438986/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Boot complete time reached (30 seconds)
    Info:CFG:####### Set Boot Complete #######
    Debug:CFG:new offset 7556, boot_count 61, success count 61
    Debug:CFG:new offset after read 7556, boot_count 61, success count 61
    Debug:CFG:re-read - offset 7556, boot count 61, boot success 61, bootfailures 0
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 32, idle 438427/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 33, idle 452078/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 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:MAIN:Time 34, idle 452155/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 35, idle 441851/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 36, idle 450578/s, free 75936, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 37, idle 450965/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 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:MAIN:Time 38, idle 446822/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    Info:MAIN:Time 39, idle 443676/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    
  • ADVERTISEMENT
  • #39 20333899
    tomanyusers
    Level 3  
    I just updated to the newest version again. Here are the logs.

    
    Info:MQTT:mqtt_connection_cb: Successfully connected
    Info:MQTT:mqtt_subscribed to BK7231N_TAC2121C_obk08734C21/+/set
    Info:MQTT:mqtt_subscribed to cmnd/BK7231N_TAC2121C_obk08734C21/+
    Info:MAIN:Time 13, idle 457419/s, free 75816, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:MQTT client "BK7231N_TAC2121C_obk08734C21" request cb: err 0
    Info:MQTT:MQTT client "BK7231N_TAC2121C_obk08734C21" request cb: err 0
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=4
    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
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false, try 7).
    Info:MAIN:Time 14, idle 441774/s, free 64456, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=4
    ExtraDebug:TuyaMCU:Will send SetWiFiState 4.
    Info:MAIN:Time 15, idle 444942/s, free 52760, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 4/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=6
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 03 00 00 05 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 3 (WiFiState) with 7 bytes
    ExtraDebug:TuyaMCU:Will send TUYA_CMD_QUERY_STATE (state_updated==false, try 9).
    Info:MAIN:Time 16, idle 449845/s, free 52328, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 5/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=6
    Info:NTP:Seconds since Jan 1 1900 = 3879987487
    Info:NTP:Unix time  : 1670998687
    Info:NTP:Local Time : 2022/12/14 06:18:07
    Info:MAIN:Time 17, idle 453826/s, free 52760, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 4/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=6
    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 14 06 00 00 08 08 D3 00 00 00 00 00 00 01 02 00 04 00 00 00 53 60 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 27 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 2259 (flags 0)
    
    Info:MAIN:Channel has changed! Publishing change 2 with 2259 
    Info:MQTT:Publishing val 2259 to BK7231N_TAC2121C_obk08734C21/2/get retain=0
    Info:GEN:No change in channel 4 (still set to 0) - ignoring
    
    Info:GEN:No change in channel 3 (still set to 0) - ignoring
    
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 83
    Info:GEN:CHANNEL_Set channel 5 has changed to 83 (flags 0)
    
    Info:MAIN:Channel has changed! Publishing change 5 with 83 
    Info:MQTT:Publishing val 83 to BK7231N_TAC2121C_obk08734C21/5/get retain=0
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 03 00 00 08 16 0C 16 0C 00 00 00 02 66 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 3, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:MAIN:Time 18, idle 457057/s, free 52512, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 4/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=7
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 04 00 00 08 0C 0E 0C 0E 00 00 00 00 55 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 4, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 06 0B 00 00 02 01 00 1D 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 13 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 11, dataType 0-DP_TYPE_RAW and 2 data bytes
    Info:MAIN:Time 19, idle 438225/s, free 64456, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=8
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 11 10 01 00 01 01 12 03 00 08 32 32 34 39 30 30 36 38 E9 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 24 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:MAIN:Channel has changed! Publishing change 1 with 1 
    Info:MQTT:Publishing val 1 to BK7231N_TAC2121C_obk08734C21/1/get retain=0
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 18, dataType 3-DP_TYPE_STRING and 8 data bytes
    Info:MAIN:Time 20, idle 442626/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.106 gate=192.168.1.1 mask=255.255.255.0 mac=a0:92:08:73:4c:21 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-61,ssid=NewNet,bssid=4c:5e:0c:a2:23:b7 ,channel=5,cipher_type:CCMP
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=9
    Info:MAIN:Time 21, idle 441706/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=9
    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 22, idle 453325/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=10
    Info:MAIN:Time 23, idle 448789/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=11
    Info:MAIN:Time 24, idle 439836/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=12
    Info:MAIN:Time 25, idle 446626/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=12
    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 26, idle 456696/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=13
    Info:MAIN:Time 27, idle 448265/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=14
    Info:MAIN:Time 28, idle 440439/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=15
    Info:MAIN:Time 29, idle 449660/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=15
    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 30, idle 450210/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.106 gate=192.168.1.1 mask=255.255.255.0 mac=a0:92:08:73:4c:21 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-60,ssid=NewNet,bssid=4c:5e:0c:a2:23:b7 ,channel=5,cipher_type:CCMP
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=16
    Info:MAIN:Time 31, idle 449819/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Boot complete time reached (30 seconds)
    Info:CFG:####### Set Boot Complete #######
    Debug:CFG:new offset 7876, boot_count 64, success count 64
    Debug:CFG:new offset after read 7876, boot_count 64, success count 64
    Debug:CFG:re-read - offset 7876, boot count 64, boot success 64, bootfailures 0
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=17
    Info:MAIN:Time 32, idle 435063/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=18
    Info:MAIN:Time 33, idle 449166/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=18
    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 34, idle 450591/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:wl_status 10
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=19
    Info:MAIN:Time 35, idle 449292/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=20
    Info:MAIN:Time 36, idle 439591/s, free 76152, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    


    Looks like the TUYA_CMD_WIFI_STATE worked.
  • #40 20352744
    tomanyusers
    Level 3  
    Hi

    Whats the next steps from here?
  • ADVERTISEMENT
  • #41 20352750
    p.kaczmarek2
    Moderator Smart Home
    Hello, it's been 14 days, I must read back whole topic again to see how much progress we had, but in general, do we already have a known list of dpIDs for this device with their meanings?

    What is your current autoexec.bat?

    Do we know the meaning of those dpIDs?
    Home Assistant Integration: Reflashing BK7231N in Tuya Smart DIN-rail Energy Meter TAC2121C

    Dodano po 3 [minuty]:

    From what I see, you had received those packets...
    
    
    55 AA 03 00 00 01 01 04 
    55 AA 03 03 00 00 05 
    55 AA 03 07 00 14 06 00 00 08 08 D3 00 00 00 00 00 00 01 02 00 04 00 00 00 53 60 
    55 AA 03 07 00 0C 03 00 00 08 16 0C 16 0C 00 00 00 02 66 
    55 AA 03 07 00 0C 04 00 00 08 0C 0E 0C 0E 00 00 00 00 55 
    55 AA 03 07 00 06 0B 00 00 02 01 00 1D 
    55 AA 03 07 00 11 10 01 00 01 01 12 03 00 08 32 32 34 39 30 30 36 38 E9 
    55 AA 03 00 00 01 01 04 
    

    Home Assistant Integration: Reflashing BK7231N in Tuya Smart DIN-rail Energy Meter TAC2121C
    We might need to guess what are the binary values here, especially in RAW packets:
    
    55 AA	03	07		00 14	06 00 00 08 08D3000000000000 01 02 00 04 00000053 		60	
    HEADER	VER=03	State		LEN	fnId=6 Raw V=08 D3 00 00 00 00 00 00,fnId=1 Val V=83	CHK	
    
    55 AA	03	07		00 0C	03 00 00 08 160C160C00000002 		66	
    HEADER	VER=03	State		LEN	fnId=3 Raw V=16 0C 16 0C 00 00 00 02	CHK	
    
    55 AA	03	07		00 0C	04 00 00 08 0C0E0C0E00000000 		55	
    HEADER	VER=03	State		LEN	fnId=4 Raw V=0C 0E 0C 0E 00 00 00 00	CHK	
    
    55 AA	03	07		00 06	0B 00 00 02 0100 		1D	
    HEADER	VER=03	State		LEN	fnId=11 Raw V=01 00	CHK	
    
    55 AA	03	07		00 11	10 01 00 01 01 12 03 00 08 3232343930303638 		E9	
    HEADER	VER=03	State		LEN	fnId=16 Bool V=1,fnId=18 Str V=22490068	CHK	
    

    EDIT: From what I've seen, I've already described them 2 weeks ago here:
    https://www.elektroda.com/rtvforum/topic3936455.html#20310817

    So basically now we just need to them on GUI?

    It seems that most of the work is already done, what is remaining now, or are you asking how to get results to Home Assistant?
    Helpful post? Buy me a coffee.
  • #42 20352891
    tomanyusers
    Level 3  
    Yes, it has been a while.

    In my mind the last few bits are:
    1. Getting the RSSI to display on the LCD Screen.
    2. Updating the channel names in the MQTT messages to reflect the actual names and not just numbers and formatting the numbers.
    Home Assistant Integration: Reflashing BK7231N in Tuya Smart DIN-rail Energy Meter TAC2121C
    3. Format the values correctly on the GUI, at the moment there are 6 decimal places, I assume the plan is to round these to 2.
    Home Assistant Integration: Reflashing BK7231N in Tuya Smart DIN-rail Energy Meter TAC2121C

    Not sure if there is anything else.

    My current autoexec.bat is
    
    startDriver TuyaMCU
    startDriver NTP
    setChannelType 1 toggle
    setChannelType 2 Voltage_div10
    setChannelType 3 Power
    setChannelType 4 Current_div1000
    setChannelType 5 EnergyTotal_kWh_div100
    // 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
    loglevel 6
    
  • #43 20352903
    p.kaczmarek2
    Moderator Smart Home
    Wow, that's a great list. Very helpful, we will solve those points one by one.
    I will start looking into them now (or maybe after I finish DHT support), but let's start with RSSI - do you know does RSSI has to be sent in response to one of the packets we currently ignore?

    Pt. 2 is great suggestion, I will add a command for that, a channel MQTT name override that is scriptable. It's easy to do and very handy.

    Pt 3 just a chore, I will do that
    Helpful post? Buy me a coffee.
  • #44 20352943
    tomanyusers
    Level 3  
    Pt1 - RSSI
    I don't think it needs to be sent after one of the packets we are ignoring. Looks like it can be sent periodically after the WiFi state is set.
  • #45 20352962
    p.kaczmarek2
    Moderator Smart Home
    Well, I think we should send it at the correct moment, I heard rare reports that some devices do not like transferring data at the unexpected times.
    But if you want to use more risky approach (which might work ok), maybe you can do in autoexec "addRepeatingEvent 30 -1 tuyaMcu_sendRSSI"? Every 30 second send that command (-1 means infinite repeats). I am curious if it would work for you.

    tomanyusers wrote:

    3. Format the values correctly on the GUI, at the moment there are 6 decimal places, I assume the plan it to round these to 2.
    Home Assistant Integration: Reflashing BK7231N in Tuya Smart DIN-rail Energy Meter TAC2121C

    Should be done, I hardcoded it to 2 decimal places right now:
    https://github.com/openshwprojects/OpenBK7231T_App
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #46 20353000
    tomanyusers
    Level 3  
    The 2 decimal points seems to be working except for the energy. It rounded 0.8299999... to 0.82 but the value should be 0.83. Seems to truncate and not round.

    Adding the "tuyaMcu_sendRSSI" to the autoexec does not seem to work as it is expecting the RSSI as a parameter.
    
    Debug:CMD:cmd [tuyaMcu_sendRSSI]
    Info:TuyaMCU:Requires 1 argument
    
  • #47 20353016
    p.kaczmarek2
    Moderator Smart Home
    tomanyusers wrote:
    The 2 decimal points seems to be working except for the energy. It rounded 0.8299999... to 0.82 but the value should be 0.83. Seems to truncate and not round.

    That's not good, but it seems that our lightweight sprintf just works that way. I might need to figure out a better way for conversion. At least, this is purely cosmetical, the values in channels are not rounded.

    tomanyusers wrote:
    Adding the "tuyaMcu_sendRSSI" to the autoexec does not seem to work as it is expecting the RSSI as a parameter.

    Ah I see, I forget about that. I will modify this command to send the current RSSI if an argument is not present.
    Helpful post? Buy me a coffee.
  • #48 20368818
    tomanyusers
    Level 3  
    Hi

    Have you had a chance to look at the rounding issue and sending the current RSSI if an argument is not present?
  • #49 20368895
    p.kaczmarek2
    Moderator Smart Home
    Hey @tomanyusers , if I remember correctly, I added the default RSSI value sending many days ago:
    Home Assistant Integration: Reflashing BK7231N in Tuya Smart DIN-rail Energy Meter TAC2121C
    Regarding rounding, not yet, but I will forward it to our dev issues board so we won't forget that
    Helpful post? Buy me a coffee.
  • #50 20369011
    tomanyusers
    Level 3  
    Hi
    Thanks for the update.
    I must have missed the update for the RSSI.
    I have tested with the latest version and it seems to be working now.
  • #51 20472957
    p.kaczmarek2
    Moderator Smart Home
    Hello, I am making a better docs system, can you post your final autoexec.bat so I can include it as a reference?
    https://github.com/openshwprojects/OpenBK7231T_App/tree/main/docs
    Helpful post? Buy me a coffee.
  • #52 21325110
    tarkowskimicha
    Level 7  
    Hi,

    Sorry for digging inside an old topic but I have a question about the usage of RAW_TAC2121C_VCP command in a 3-phase metering tuya device, using autoexec provided in this thread and dpIDs I was able to convert a SMTONOFF breaker from tuya proprietary firmware to OpenBK one although there is a small bug with publishing voltage current and power values in situation when three phases use different dpID's. In my case Phase A is published on dpID 6, Phase B on dpID 7 and Phase C on dpID 8.
    When using:
    "linkTuyaMCUOutputToChannel 6 RAW_TAC2121C_VCP
    setChannelType 5 Voltage_div10
    setChannelLabel 5 "Voltage A"
    setChannelType 6 Power
    setChannelLabel 6 "Power A"
    setChannelType 7 Current_div1000
    setChannelLabel 7 "Current A""
    instruction all data from Phase A is published correctly but when added another dpID's:
    linkTuyaMCUOutputToChannel 6 RAW_TAC2121C_VCP
    setChannelType 5 Voltage_div10
    setChannelLabel 5 "Voltage A"
    setChannelType 6 Power
    setChannelLabel 6 "Power A"
    setChannelType 7 Current_div1000
    setChannelLabel 7 "Current A"
    linkTuyaMCUOutputToChannel 7 RAW_TAC2121C_VCP
    setChannelType 20 Voltage_div10
    setChannelLabel 20 "Voltage B"
    setChannelType 21 Power
    setChannelLabel 21 "Power B"
    setChannelType 22 Current_div1000
    setChannelLabel 22 "Current B"
    linkTuyaMCUOutputToChannel 8 RAW_TAC2121C_VCP
    setChannelType 23 Voltage_div10
    setChannelLabel 23 "Voltage C"
    setChannelType 24 Power
    setChannelLabel 24 "Power C"
    setChannelType 25 Current_div1000
    setChannelLabel 25 "Current C"
    it combines all 3 phase metering values and publishes them on channels 5, 6 and 7. Am I missing something in the configuration or is it expected behaviour? If I use the command from the first example but exchange listening dpID to 7 or 8 alone it works as expected but publishes only one phase metrics.

    Thank you in advance for your support.
  • #53 21325115
    p.kaczmarek2
    Moderator Smart Home
    I have 3 phase meter now, sent by @DarkMan1 . I will be working on this issue shortly. See this topic for photos of the devices I have:
    https://www.elektroda.com/rtvforum/topic4089722.html
    I just need to add some little changes to the firmware and it will work good. I will post the teardown and guide once it's ready.
    Helpful post? Buy me a coffee.
  • #54 21325119
    tarkowskimicha
    Level 7  
    >>21325115 Great to hear that :) thank you for your prompt reply, my device is as the one below, will add my autoexec as soon as I finish configuration then. Smart auto-reclosing protector SMTONO with a digital display.
  • #55 21325645
    p.kaczmarek2
    Moderator Smart Home
    Do you have some photos from the teardown or maybe 2MB flash dump?
    Helpful post? Buy me a coffee.
  • #56 21326279
    tarkowskimicha
    Level 7  
    >>21325645 Yes I do, here is a dump, dpID's and MCU output. I have two breakers as one was bricked by vendor with Tuya MCU update (8H3K64S2 flash was corrupted and cannot be dumped from other working breaker, Chinese seller couldn't provide me with working dump but sent me a new breaker for replacement). Newer one is a bit different revision and cannot be reflashed with openBK without opening (although it is simple, just 4 screws at the back of device). In older one, the front label can be removed and UART pins are exposed next to the display (MCU does not interfere with CBU unit when no voltage is applied to breaker inputs and can be reflashed without removal of CBU) PCB with a digital display and buttons. Printed circuit board with integrated circuits and connectors on a white background. Electronic module with four wires on a light background.

    Dodano po 1 [minuty]:

    And the rest of files:
  • #57 21337927
    p.kaczmarek2
    Moderator Smart Home
    tarkowskimicha wrote:

    it combines all 3 phase metering values and publishes them on channels 5, 6 and 7. Am I missing something in the configuration or is it expected behaviour? If I use the command from the first example but exchange listening dpID to 7 or 8 alone it works as expected but publishes only one phase metrics.

    Thank you in advance for your support.

    @tarkowskimicha Here is related update. You still can use RAW_TAC2121C_VCP, but you need to specify first channel, which is used for voltage. Next is current, then is power.

    See related commit:
    https://github.com/openshwprojects/OpenBK7231...mmit/6e176a39112e34691808efa22cb3245bd5682b43

    Self test:
    Code: C / C++
    Log in, to see the code
    Helpful post? Buy me a coffee.
  • #58 21345230
    tarkowskimicha
    Level 7  
    >>21337927 Hello, sorry for a late reply but I missed the notification. I can confirm that all works as expected: Screenshot displaying electrical data for voltage, current, and power for three phases. Thank you! I'll prepare autoexec and publish it as well.
  • #59 21345520
    p.kaczmarek2
    Moderator Smart Home
    Thank you, if you want, you can also create separate detailed guide/article, see here:
    https://www.elektroda.com/rtvforum/topic3950844.html
    Big thanks to @DarkMan1 for providing a 3 phase device for me to test and implement this feature.
    Helpful post? Buy me a coffee.
  • Helpful post
    #60 21373603
    tarkowskimicha
    Level 7  
    Hi, I tried to spare some time during Christmas break but it was too busy, I'll prepare the tutorial in January, in the mean time here is working autoexec for my circuit breaker.

Topic summary

The discussion revolves around the integration of the BK7231N chip in the Tuya Smart DIN-rail Energy Meter TAC2121C with Home Assistant. The user seeks to reflash the device to eliminate reliance on Tuya services. Various options for reflashing are explored, including using OpenBK7231N or replacing the BK7231N with an ESP-12F flashed with Tasmota or ESP-Home. The main challenge identified is the lack of information regarding the energy meter's chip and the necessary drivers. Participants share insights on the components found on the PCB, including the V9911 chip, and discuss the UART communication protocol. They analyze data packets to extract energy statistics, voltage, and power readings. The conversation progresses to successfully sending commands to the TuyaMCU, enabling the meter to report readings and toggle the relay. The final steps involve refining the autoexec.bat configuration for optimal performance and addressing issues like RSSI display and data rounding.
Summary generated by the language model.
ADVERTISEMENT