logo elektroda
logo elektroda
X
logo elektroda

Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

caubergjef57 14733 193
ADVERTISEMENT
  • #31 20325107
    caubergjef57
    Level 4  
    Hi, how can I do that?

    Added after 47 [minutes]:

    Write sensor retain in the yaml?
  • ADVERTISEMENT
  • #32 20325220
    p.kaczmarek2
    Moderator Smart Home
    @caubergjef57 you can write retain in yaml, yes, but you can also enable flag:

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #33 20326004
    caubergjef57
    Level 4  
    Hi, I set the flag but nothing changed in HA

    Flag 7 - [MQTT] [Debug] Always set Retain flag to all published values

    December 9, 2022
    Motion_sensor_1 became unknown
    11:10:28 AM - 13 minutes ago
    Motion_sensor_1 became unavailable
    11:10:27 AM - 13 minutes ago
    Motion_sensor_1 became unknown
    11:10:27 AM - 13 minutes ago
    Motion_sensor_1 became unavailable
    11:10:26 AM - 13 minutes ago
  • #35 20326550
    caubergjef57
    Level 4  
    No I can't write it in yaml. Get an error when I want saved in Ha.

    Added after 1 [minutes]:

    I write retain: true but can't saved it in Ha
  • #36 20327553
    caubergjef57
    Level 4  
    Hi,
    I write this in the config.yaml
    binary_sensor:
    - unique_id: "OpenBK7231N_8c000000"
    name: "Motion_sensor_1"
    state_topic: "obk8c000000/1/get"
    qos: 1
    payload_on: 1
    payload_off: 0
    retain: true
    availability_topic: "obk8c000000/connected"
    But when I want to save this I get this error

    Invalid config for [mqtt]: [retain] is an invalid option for [mqtt]. Check: mqtt->mqtt->binary_sensor->0->retain.

    When I delete the line retain: true
    then no problem for saving the config.yaml
  • #37 20329316
    p.kaczmarek2
    Moderator Smart Home
    As I said in previous post, I apologize for slow reply, but please be a bit more understanding, I am a single person and I am helping in my free time.

    Ok, it seems that retain was removed from HA in the past. So that's not the way.

    You just need to set retain in OBK.

    You also need to remove the availability topic. Wait, I will check on my device.

    EDIT: Testing...
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    ye, it seems that you just had to remove ability topic? Let me check more...

    Solution: remove availability topic because it makes device go unavailable and enable retain on OBK (ha no longer has this options for binary sensor)

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    Helpful post? Buy me a coffee.
  • #38 20330584
    caubergjef57
    Level 4  
    H,
    I changed this in the config.yaml and now I can see the motion sensor on and off in HA.
    Thanks so far.
  • #39 20330707
    p.kaczmarek2
    Moderator Smart Home
    Great, that's good we've come so far. It took some time, especially that I don't have that device at hand and it's hard do to things remotely, but we have a good progress. If you have any other questions, feel free to ask.
    Helpful post? Buy me a coffee.
  • #40 20330733
    caubergjef57
    Level 4  
    H,
    Is there any change for seeing the battery status?
  • #41 20332361
    p.kaczmarek2
    Moderator Smart Home
    Hello, from what I know, it's possible to get battery status only if TuyaMCU is reporting it.
    Please check Web App logs to see what is being received.

    This is example log entry for detection state:
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 05 00 05 01 04 00 01 01 10 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 12 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 1, dataType 4-DP_TYPE_ENUM and 1 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: raw data 1 byte: 
    

    So you know that dpId 1 is detection state.... there might be also two battery related dpIds:
    - dpId - 2 - Battery Level Percentage - values range: 0-100
    - dpId - 3 - Battery Level Enum - low, middle, high
    Are you able to see any dpId 2 or 3 in the logs?


    You could also try setting:
    
    setChannelType 2 readonly
    // link dpid to channel 2
    linkTuyaMCUOutputToChannel 2 val 2
    

    to see if anything is received... maybe do the same for '3'.... and just observe, if it doesn't do anything, remove it later.
    Helpful post? Buy me a coffee.
  • #42 20332407
    caubergjef57
    Level 4  
    
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 12 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 1, dataType 4-DP_TYPE_ENUM and 1 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: 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 obk8C000000/1/get retain=1
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 45, idle 963051/s, free 76312, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 46, idle 472122/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 47, idle 468877/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 48, idle 483370/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 49, idle 488621/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 50, idle 484829/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.33 gate=192.168.1.1 mask=255.255.255.0 mac=38:1f:8d:0d:b9:d3 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-60,ssid=CAUBERG_2.4,bssid=e8:01:8d:2b:f3:a3 ,channel=11,cipher_type:CCMP
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 51, idle 476100/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 52, idle 487792/s, free 76288, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 53, idle 487275/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 54, idle 483790/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 55, idle 479293/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 56, idle 479889/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 57, idle 484496/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 58, idle 483332/s, free 67896, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 59, idle 471449/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 60, idle 480854/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.33 gate=192.168.1.1 mask=255.255.255.0 mac=38:1f:8d:0d:b9:d3 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-60,ssid=CAUBERG_2.4,bssid=e8:01:8d:2b:f3:a3 ,channel=11,cipher_type:CCMP
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 61, idle 470961/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 62, idle 474981/s, free 76200, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 63, idle 469415/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 64, idle 478212/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 65, idle 482480/s, free 67896, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 66, idle 482329/s, free 76520, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    nfo:TuyaMCU:TuyaMCU_ParseQueryProductInformation: received {"p":"lydwobwyqxiyob9h","v":"1.0.1"}
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 3, idle 486199/s, free 81680, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 02 00 00 01 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 2 (MCUconf) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: TUYA_CMD_MCU_CONF had wrong data lenght?
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 01 00 24 7B 22 70 22 3A 22 6C 79 64 77 6F 62 77 79 71 78 69 79 6F 62 39 68 22 2C 22 76 22 3A 22 31 2E 30 2E 31 22 7D 5E 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 1 (QueryProductInformation) with 43 bytes
    Info:TuyaMCU:TuyaMCU_ParseQueryProductInformation: received {"p":"lydwobwyqxiyob9h","v":"1.0.1"}
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 4, idle 483626/s, free 81680, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 5, idle 484901/s, free 81680, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:ssid:CAUBERG_2.4 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 6, idle 476536/s, free 76712, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 02 00 00 01 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 2 (MCUconf) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: TUYA_CMD_MCU_CONF had wrong data lenght?
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 05 00 08 04 02 00 04 00 00 00 4E 64 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 15 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 4, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: raw data 4 int: 78
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 7, idle 478562/s, free 75792, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 8, idle 285310/s, free 75552, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 05 00 05 01 04 00 01 00 0F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 12 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 1, dataType 4-DP_TYPE_ENUM and 1 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: raw data 1 byte: 
    Info:GEN:No change in channel 1 (still set to 0) - ignoring
    
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 9, idle 0/s, free 75552, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 10, idle 0/s, free 75552, 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=38:1f:8d:0d:b9:d3 
    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
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 11, idle 142862/s, free 72904, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 05 00 05 01 04 00 01 01 10 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 12 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 1, dataType 4-DP_TYPE_ENUM and 1 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: 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 
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 12, idle 465272/s, free 76144, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:mqtt_userName 
    mqtt_pass 
    mqtt_clientID obk8C000000
    mqtt_host 192.168.1.19:1883
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 13, idle 468874/s, free 76056, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:mqtt_connection_cb: Successfully connected
    Info:MQTT:mqtt_subscribed to obk8C000000/+/set
    Info:MQTT:mqtt_subscribed to cmnd/obk8C000000/+
    Info:MQTT:MQTT client "obk8C000000" request cb: err 0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk8C000000/2/set
    Info:MQTT:MQTT in topic obk8C000000/2/set
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk8C000000/1/set
    Info:MQTT:MQTT in topic obk8C000000/1/set
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk8C000000/3/set
    Info:MQTT:MQTT in topic obk8C000000/3/set
    Info:MQTT:MQTT client "obk8C000000" request cb: err 0
    Info:MQTT:channelSet part topic 2/set
    Info:MQTT:channelSet channel 2
    Info:MQTT:MQTT client in mqtt_incoming_data_cb data is 0 for ch 2
    Info:GEN:No change in channel 2 (still set to 0) - ignoring
    
    Info:MQTT:channelSet part topic 1/set
    Info:MQTT:channelSet channel 1
    Info:MQTT:MQTT client in mqtt_incoming_data_cb data is 0 for ch 1
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Channel has changed! Publishing change 1 with 0 
    Info:MQTT:Publishing val 0 to obk8C000000/1/get retain=1
    Info:MQTT:channelSet part topic 3/set
    Info:MQTT:channelSet channel 3
    Info:MQTT:MQTT client in mqtt_incoming_data_cb data is 0 for ch 3
    Info:GEN:No change in channel 3 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 14, idle 446578/s, free 76056, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 15, idle 454473/s, free 64360, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 16, idle 471379/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 17, idle 941739/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 18, idle 470091/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 19, idle 467756/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 20, idle 469588/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.33 gate=192.168.1.1 mask=255.255.255.0 mac=38:1f:8d:0d:b9:d3 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-55,ssid=CAUBERG_2.4,bssid=e8:01:8d:2b:f3:a3 ,channel=11,cipher_type:CCMP
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 21, idle 469994/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 22, idle 471349/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 23, idle 466184/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 24, idle 469638/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 25, idle 469734/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 26, idle 476752/s, free 75728, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 27, idle 465763/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 28, idle 473248/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 29, idle 471839/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 30, idle 474792/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.33 gate=192.168.1.1 mask=255.255.255.0 mac=38:1f:8d:0d:b9:d3 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-55,ssid=CAUBERG_2.4,bssid=e8:01:8d:2b:f3:a3 ,channel=11,cipher_type:CCMP
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 31, idle 464040/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Boot complete time reached (30 seconds)
    Info:CFG:####### Set Boot Complete #######
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 32, idle 458209/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 33, idle 471642/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 34, idle 476557/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 35, idle 466726/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 36, idle 472724/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 37, idle 470400/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 38, idle 474325/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 39, idle 462768/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 40, idle 474930/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.33 gate=192.168.1.1 mask=255.255.255.0 mac=38:1f:8d:0d:b9:d3 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-55,ssid=CAUBERG_2.4,bssid=e8:01:8d:2b:f3:a3 ,channel=11,cipher_type:CCMP
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 41, idle 471766/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 42, idle 475562/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 43, idle 467763/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 44, idle 472209/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 45, idle 473234/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 46, idle 472042/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 47, idle 461490/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 48, idle 473979/s, free 67424, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 49, idle 471954/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 50, idle 472547/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.33 gate=192.168.1.1 mask=255.255.255.0 mac=38:1f:8d:0d:b9:d3 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-56,ssid=CAUBERG_2.4,bssid=e8:01:8d:2b:f3:a3 ,channel=11,cipher_type:CCMP
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 51, idle 462986/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 52, idle 472457/s, free 75816, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 53, idle 471104/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 54, idle 471881/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 55, idle 462087/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 56, idle 476633/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 57, idle 471228/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: discarding packet bad expected checksum, expected 0 and got checksum 255
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 58, idle 473705/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 59, idle 464248/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 60, idle 476493/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.33 gate=192.168.1.1 mask=255.255.255.0 mac=38:1f:8d:0d:b9:d3 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-56,ssid=CAUBERG_2.4,bssid=e8:01:8d:2b:f3:a3 ,channel=11,cipher_type:CCMP
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 61, idle 469613/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:Consumed 1 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 00 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 62, idle 473368/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 63, idle 461694/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 64, idle 479536/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 65, idle 474058/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    


    Added after 10 [minutes]:

    Hi,
    Try doing that but in the log nothing changed, i only see a dpId 4.
  • #43 20332445
    p.kaczmarek2
    Moderator Smart Home
    You did great! dpId 4 must be a battery percentage! Good work.
    
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 15 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 4, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: raw data 4 int: 78
    

    78 = 78%?
    Can you check if it slowly goes down over time?

    NOTE: the following example links dpId 4 to channel 4. You could map it to channel 2 when you don't use channel 2 and 3, but maybe it will be easier if we map it to the channel with the same number as dpId..
    
    setChannelType 4 readonly
    // link dpid to channel 4
    linkTuyaMCUOutputToChannel 4 val 4
    


    Anyway, now please check if it really is a battery percentage.

    In a meantime, I might try to add a special "Channel type" for a better display of battery percentage on the main HTTP page.... but it's not really needed, only a cosmetic change. You could already just configure it and receive channel 4 (or whichever you map it to) in HA and use it as a battery percentage.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #44 20332459
    caubergjef57
    Level 4  
    
    TUYAMCU received: 55 AA 00 02 00 00 01 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 2 (MCUconf) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: TUYA_CMD_MCU_CONF had wrong data lenght?
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 4, idle 482994/s, free 81680, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 5, idle 484803/s, free 81680, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:ssid:CAUBERG_2.4 key
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 6, idle 476790/s, free 76712, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 02 00 00 01 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 2 (MCUconf) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: TUYA_CMD_MCU_CONF had wrong data lenght?
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 05 00 08 04 02 00 04 00 00 00 5A 70 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 15 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 4, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: raw data 4 int: 90
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 05 00 05 01 04 00 01 00 0F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 12 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 1, dataType 4-DP_TYPE_ENUM and 1 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: raw data 1 byte: 
    Info:GEN:No change in channel 1 (still set to 0) - ignoring
    
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 7, idle 478331/s, free 75784, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 05 00 05 01 04 00 01 01 10 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 12 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 1, dataType 4-DP_TYPE_ENUM and 1 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: 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 
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 8, idle 284302/s, free 75552, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 9, idle 0/s, free 75552, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 10, idle 0/s, free 75552, 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=38:1f:8d:0d:b9:d3 
    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
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 11, idle 144986/s, free 76104, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 05 00 05 01 04 00 01 00 0F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 12 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 1, dataType 4-DP_TYPE_ENUM and 1 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: raw data 1 byte: 
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MAIN:Channel has changed! Publishing change 1 with 0 
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 12, idle 468024/s, free 76144, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:mqtt_userName 
    mqtt_pass 
    mqtt_clientID obk8C000000
    mqtt_host 192.168.1.19:1883
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 13, idle 472648/s, free 76056, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:mqtt_connection_cb: Successfully connected
    Info:MQTT:mqtt_subscribed to obk8C000000/+/set
    Info:MQTT:mqtt_subscribed to cmnd/obk8C000000/+
    Info:MQTT:MQTT client "obk8C000000" request cb: err 0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk8C000000/2/set
    Info:MQTT:MQTT in topic obk8C000000/2/set
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk8C000000/1/set
    Info:MQTT:MQTT in topic obk8C000000/1/set
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic obk8C000000/3/set
    Info:MQTT:MQTT in topic obk8C000000/3/set
    Info:MQTT:MQTT client "obk8C000000" request cb: err 0
    Info:MQTT:channelSet part topic 2/set
    Info:MQTT:channelSet channel 2
    Info:MQTT:MQTT client in mqtt_incoming_data_cb data is 0 for ch 2
    Info:GEN:No change in channel 2 (still set to 0) - ignoring
    
    Info:MQTT:channelSet part topic 1/set
    Info:MQTT:channelSet channel 1
    Info:MQTT:MQTT client in mqtt_incoming_data_cb data is 0 for ch 1
    Info:GEN:No change in channel 1 (still set to 0) - ignoring
    
    Info:MQTT:channelSet part topic 3/set
    Info:MQTT:channelSet channel 3
    Info:MQTT:MQTT client in mqtt_incoming_data_cb data is 0 for ch 3
    Info:GEN:No change in channel 3 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 14, idle 453490/s, free 76056, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 15, idle 462213/s, free 75840, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 05 00 05 01 04 00 01 01 10 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 12 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 1, dataType 4-DP_TYPE_ENUM and 1 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: 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 obk8C000000/1/get retain=1
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 16, idle 472178/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 17, idle 465870/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 18, idle 469244/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 19, idle 475918/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 20, idle 467698/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.33 gate=192.168.1.1 mask=255.255.255.0 mac=38:1f:8d:0d:b9:d3 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-60,ssid=CAUBERG_2.4,bssid=e8:01:8d:2b:f3:a3 ,channel=11,cipher_type:CCMP
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 21, idle 467665/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 22, idle 468544/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 23, idle 475325/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 24, idle 470760/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 25, idle 475119/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 26, idle 475282/s, free 67440, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 27, idle 476369/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 28, idle 473900/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 29, idle 472778/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 30, idle 477744/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.33 gate=192.168.1.1 mask=255.255.255.0 mac=38:1f:8d:0d:b9:d3 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-61,ssid=CAUBERG_2.4,bssid=e8:01:8d:2b:f3:a3 ,channel=11,cipher_type:CCMP
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 31, idle 471815/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Boot complete time reached (30 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 05 00 05 01 04 00 01 00 0F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 12 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 1, dataType 4-DP_TYPE_ENUM and 1 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: raw data 1 byte: 
    Info:GEN:CHANNEL_Set channel 1 has changed to 0 (flags 0)
    
    Info:MAIN:Channel has changed! Publishing change 1 with 0 
    Info:MQTT:Publishing val 0 to obk8C000000/1/get retain=1
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 32, idle 461271/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 33, idle 467411/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 05 00 05 01 04 00 01 01 10 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 5 (WiFiSelect) with 12 bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: processing dpId 1, dataType 4-DP_TYPE_ENUM and 1 data bytes
    Info:TuyaMCU:TuyaMCU_V0_ParseRealTimeWithRecordStorage: 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 obk8C000000/1/get retain=1
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 34, idle 475513/s, free 75840, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 35, idle 464397/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 36, idle 466776/s, free 75832, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 37, idle 461882/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 38, idle 473765/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 39, idle 469919/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 40, idle 471280/s, free 67440, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Info:GEN:dhcp=0 ip=192.168.1.33 gate=192.168.1.1 mask=255.255.255.0 mac=38:1f:8d:0d:b9:d3 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-60,ssid=CAUBERG_2.4,bssid=e8:01:8d:2b:f3:a3 ,channel=11,cipher_type:CCMP
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 41, idle 466029/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 42, idle 474566/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 43, idle 470846/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 44, idle 471483/s, free 67440, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 45, idle 463560/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 46, idle 473791/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 47, idle 472023/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 48, idle 468946/s, free 67440, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 49, idle 466830/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 50, idle 479030/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.1.33 gate=192.168.1.1 mask=255.255.255.0 mac=38:1f:8d:0d:b9:d3 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-60,ssid=CAUBERG_2.4,bssid=e8:01:8d:2b:f3:a3 ,channel=11,cipher_type:CCMP
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 51, idle 464037/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 52, idle 468256/s, free 75832, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 53, idle 473491/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 54, idle 475403/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 55, idle 472700/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 56, idle 470872/s, free 75832, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 57, idle 471451/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:Consumed 8 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 00 AA 00 00 00 01 00 00 
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 58, idle 472716/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 59, idle 472413/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 60, idle 472614/s, free 75824, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Info:GEN:dhcp=0 ip=192.168.1.33 gate=192.168.1.1 mask=255.255.255.0 mac=38:1f:8d:0d:b9:d3 
    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:GEN:sta:rssi=-60,ssid=CAUBERG_2.4,bssid=e8:01:8d:2b:f3:a3 ,channel=11,cipher_type:CCMP
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 61, idle 468161/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 62, idle 470176/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 63, idle 468655/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 64, idle 470180/s, free 75528, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 3/38
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 65, idle 466755/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 00 00 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    Info:MAIN:Time 66, idle 476047/s, free 76048, MQTT 1(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    
  • #45 20332509
    p.kaczmarek2
    Moderator Smart Home
    From the log you posted now, I can see that dpId is at one time 90, and at the other 78. Why?

    PS: this messages:
    
    Error:CMD:command with name uartSendHex already exists!
    Error:CMD:command with name uartSendASCII already exists!
    

    are not harmful but they will disappear after update

    Added after 29 [minutes]:

    UPDATE
    It is just a cosmetic change, but I added a channel type for you.
    If you do:
    
    setChannelType 4 BatteryLevelPercent
    

    it will display it as a battery level on HTTP page.
    Look:
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #46 20332733
    caubergjef57
    Level 4  
    OpenBK7231N_8C000000
    Command Tool
    This is a basic command line.
    Please consider using 'Web Application' console with more options and real time log view.
    Remember that some commands are added after a restart when a driver is activated...

    Info:GEN:Channel 4 type not set because BatteryLevelPercent is not a known type
    Bad argument

    Command:
    setChannelType 4 BatteryLevelPercent


    Return to cfg | Read more | Devices List | Support project

    Build on Dec 11 2022 18:52:46 version 1.15.167
    Online for 3 minutes and 24 seconds
    Device MAC: 38:1F:8D:0D:B9:D3
    Short name: Motion_sensor_1, Chipset BK7231N
  • #47 20332736
    p.kaczmarek2
    Moderator Smart Home
    caubergjef57 wrote:

    Build on Dec 11 2022 18:52:46 version 1.15.167


    Battery Percent Indicator was added for you today (Dec 13), so you would need to update the firmware (make sure device won't power off during OTA because it might break device, use external power or something).

    But it's only cosmetic change, not really needed.

    In both cases, you'll need to receive that value in Home Assistant and interpret it.
    Helpful post? Buy me a coffee.
  • #48 20332867
    caubergjef57
    Level 4  
    Channel 1 = 1
    Battery level: 0% (ch 4)
    2 drivers active (TuyaMCU,tmSensor), total 17
    Channel 1 = 1, Channel 4 = 0
    Cfg size: 2016, change counter: 5, ota counter: 0, boot incompletes 0 (might change to 0 if you wait to 30 sec)!
    Ping watchdog - 0 lost, 0 ok!
    Wifi RSSI: Fair (-69dBm)
    MQTT State: disconnected RES: 0(ERR_OK)
    MQTT ErrMsg:
    MQTT Stats:CONN: 4 PUB: 0 RECV: 0 ERR: 0
    Battery level 0% but in the logfile dpId 4 = 90

    Added after 9 [minutes]:

    If the device startup again the battery level disappears and i have to give the command again.
  • #49 20333525
    p.kaczmarek2
    Moderator Smart Home
    Sorry, I am not sure if I understand now:
    caubergjef57 wrote:

    If the device startup again the battery level disappears and i have to give the command again.


    Do you mean that device forgets "setChannelType" command?
    What is your autoexec.bat?

    The commands in autoexec.bat are executed on each reboot, this is because without autoexec.bat device would "forget" commands.
    Helpful post? Buy me a coffee.
  • #50 20333866
    caubergjef57
    Level 4  
    Hi,
    I write this in the autoexec.bat

    startDriver TuyaMCU
    startDriver tmSensor
    setChannelType 1 readonly
    // link dpid to channel 1
    linkTuyaMCUOutputToChannel 1 val 1
    setChannelType 4 readonly
    // link dpid to channel 4
    linkTuyaMCUOutputToChannel 4 val 4
    setChannelType 4 BatteryLevelPercent

    Added after 2 [hours] 31 [minutes]:

    The result
    OpenBK7231N_BFA352E4
    Channel 1 = 0
    Channel 4 = 89
    2 drivers active (TuyaMCU,tmSensor), total 17
    Channel 1 = 0, Channel 4 = 89
    Cfg size: 2016, change counter: 7, ota counter: 0, boot incompletes 0 (might change to 0 if you wait to 30 sec)!
    Ping watchdog - 0 lost, 0 ok!
    Wifi RSSI: Good (-59dBm)
    MQTT State: connected RES: 0(ERR_OK)
    MQTT ErrMsg:
    MQTT Stats:CONN: 1 PUB: 4 RECV: 0 ERR: 0

    Added after 3 [minutes]:

    In HA I trying this and a lot of other writings but can't save anything in HA.
    binary_sensor:
    - unique_id: "OpenBK7231N_8C000000"
    name: "Motion_sensor_1"
    state_topic: "obk8C000000/1/get"
    qos: 1
    payload_on: 1
    payload_off: 0
    obk8C000000.battery_level:
    friendly_name: 'Motion sensor 1 Battery-Level'
    unit_of_measurement: '%'
    value_template: "{{ states.sensor.obk8C0000.battery_level}}"
    Not accept the line obk8C000000 and not accept unit_of_measurement: '%'
  • #51 20333922
    p.kaczmarek2
    Moderator Smart Home
    Hello, first I will reply regarding to first question.
    If you want to get this on HTTP page:
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    You need to update OBK to latest version (make sure the TuyaMCU won't power off the BK during the OTA!).

    Regarding HA config, wait, I will check it on my server
    Helpful post? Buy me a coffee.
  • #52 20333979
    caubergjef57
    Level 4  
    OpenBK7231N_8C000000
    Channel 1 = 1
    Battery level: 85% (ch 4)
    2 drivers active (TuyaMCU, tmSensor), total 17
    Channel 1 = 1, Channel 4 = 85
    Cfg size: 2016, change counter: 5, ota counter: 0, boot incompletes 0 (might change to 0 if you wait to 30 sec)!
    Ping watchdog - 0 lost, 0 ok!
    Wifi RSSI: Good (-57dBm)
    MQTT State: connected RES: 0(ERR_OK)
    MQTT ErrMsg:
    MQTT Stats:CONN: 1 PUB: 9 RECV: 3 ERR: 0

    This I get already, my mistake I write the battery level in the command line and not in the autoexec.bat
    That's okay now.

    Added after 5 [minutes]:

    I write this in the config.yaml

    binary_sensor:
    - unique_id: "OpenBK7231N_8C000000"
    name: "Motion_sensor_1"
    state_topic: "obk8C000000/1/get"
    qos: 1
    payload_on: 1
    payload_off: 0
    - unique_id: "OpenBK7231N_8C000000_battery"
    name: "Motion_sensor_1_battery"
    state_topic: "obk8C000000/4/get"
    device_class: battery
    payload_on: low
    payload_off: normal
    qos: 1

    And I get this result

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
  • #53 20333999
    p.kaczmarek2
    Moderator Smart Home
    Binary sensor is binary, only and off. Why do you configure battery as binary sensor? Maybe try other way...
    Code: YAML
    Log in, to see the code

    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol
    I will still need to find out how to change icon. I will look into it more.
    Helpful post? Buy me a coffee.
  • #54 20334090
    caubergjef57
    Level 4  
    Motion sensor with BK7231N and TuyaMCU battery powered devices protocol

    Finally I got it working.
    Write this in the config.yaml

    sensor:
    - unique_id: "OpenBK7231N_8C000000"
    name: "Battery Motion sensor 1"
    state_topic: "obk8C000000/4/get"
    unit_of_measurement: "%"
    value_template: "{{ value }}"

    Thanks

    Added after 22 [minutes]:

    Hi thank you so far.
    It's just a question, but can we have influence on the time after a motion is detected? I mean for example if we let a light going on after motion is detected, the time the light stay on?
  • #55 20334781
    p.kaczmarek2
    Moderator Smart Home
    Good work.

    Regarding question:
    caubergjef57 wrote:

    It's just a question, but can we have influence on the time after a motion is detected? I mean for example if we let a light going on after motion is detected, the time the light stay on?


    Do you mean Home Assistant automation? It's 100% configurable. You can do whatever you want once a detection event happens.
    Helpful post? Buy me a coffee.
  • #56 20335577
    caubergjef57
    Level 4  
    Hi, yes I understand that. Let me ask it differently, can we have influence on the time between when the motion is detected and when another motion will be detected?
  • #57 20503327
    spin55
    Level 17  
    Hello. I have two pir motion like this. One has Esp8266 chip and is flashed with Esphome. It works perfectly. The other one is identical to the one in this thread with BK7231N chip flashed with OpenBK Build on Dec 6 2022 07:45:45 version 1.15.139. It doesn't work because it doesn't seem to have enough time to post in the short time it's active. The boot of this firmware seems very "heavy" for this type of devices. I did a capture with Realterm and it can be seen that it does the activated-deactivated cycle well, but it is so fast that there is no time to activate the web or send via mqtt to Homeassistant.

    The file is displayed with Xavi32.
  • #58 20503347
    p.kaczmarek2
    Moderator Smart Home
    Hello @spin55 , do you run tuyaMCU and tmSensor drivers? tmSensor sends the packet to the MCU which order MCU to wait until report is done.
    Also, do you have a fast connect flag set?

    Btw, your log is only one half of the communication, right? for full log, you'd need to capture both RX and TX line.
    Helpful post? Buy me a coffee.
  • #59 20503382
    spin55
    Level 17  
    Configuring autoexec.bat as in the thread:
    startDriver TuyaMCU
    startDriver tmSensor
    setChannelType 1 readonly
    // vincular dpid al canal 1
    linkTuyaMCUOutputToChannel 1 val 1
    setChannelType 4 readonly
    // vincular dpid al canal 4
    linkTuyaMCUOutputToChannel 4 val 4
    setChannelType 4 BatteryLevelPercent
    
    


    Flags 7, 10 and 19 activated.
  • #60 20503398
    spin55
    Level 17  
    Why does the online counter keep running if it is disconnected?

    Build on Dec 6 2022 07:45:45 version 1.15.139
    Online for 5 minutes and 30 seconds

    Build on Dec 6 2022 07:45:45 version 1.15.139
    Online for 5 minutes and 58 seconds

    Build on Dec 6 2022 07:45:45 version 1.15.139
    Online for 8 minutes and 14 seconds

    Build on Dec 6 2022 07:45:45 version 1.15.139
    Online for 10 minutes and 10 seconds

Topic summary

The discussion revolves around configuring a motion sensor device powered by the BK7231N chip and utilizing the TuyaMCU protocol. Users share experiences and troubleshooting steps related to flashing the device, setting up the autoexec.bat file, and ensuring proper communication between the TuyaMCU and the Wi-Fi module. Key issues include the device not waking from sleep, MQTT communication problems, and the need for specific commands to maintain connectivity. Solutions involve using RealTerm for monitoring, adjusting baud rates, and ensuring the correct setup of drivers and commands in the autoexec.bat file. Users also discuss the importance of maintaining a stable power supply and the potential for firmware updates to improve functionality.
Summary generated by the language model.
ADVERTISEMENT