logo elektroda
logo elektroda
X
logo elektroda

Tuya ATORCH S1-B/W/T/H Smart Socket Energy Monitor (BK7231N) (C3BS) (CH573F) (BL0942)

maximesharp 11664 50
ADVERTISEMENT
  • #31 20946539
    divadiow
    Level 34  
    maximesharp wrote:
    As you can see in my post above, on this device, the CPU temp is sent on dpid 135 from tuyamcu and set on channel 7 on OBK


    Ah ok. Not from the BK7231N itself. I was curious about a temp reading for all BK7231s

    Next thing, have you had to calibrate the power on this unit itself after flashing to OBK? I bought mine to calibrate other devices flashed with OBK
  • ADVERTISEMENT
  • #32 20946773
    miegapele
    Level 15  

    Beken also has some internal temperature functions, tried to make use of them, but it reports 270 for me, not sure, could it be Celsius *10?
    You can try for yourself this build
    Screenshot showing diagnostic information for an IoT device.
  • #33 20946830
    maximesharp
    Level 6  
    miegapele wrote:
    Beken also has some internal temperature functions, tried to make use of them, but it reports 270 for me, not sure , could it be Celsius *10?
    You can try for yourself this build


    There is a Temperature_div10 channel type if the temperature read 10x higher, it should fix the reading.

    divadiow wrote:
    Next thing, have you had to calibrate the power on this unit itself after flashing to OBK? I bought mine to calibrate other devices flashed with OBK


    I didn't because I wasn't able to locate some incandescent light bulb (they're banned from my country since 2009) to calibrate it, but seems to be accurate enough according to my amp meter.
    I've recently find some 35w GU10 halogen lamp, I'm waiting to receive my GU10 socket to see if the factory calibration is correct or if I need to calibrate it.
  • ADVERTISEMENT
  • #34 20946859
    p.kaczmarek2
    Moderator Smart Home
    miegapele wrote:

    You can try for yourself this build
    Screenshot showing diagnostic information for an IoT device.

    This is a very good job, but:
    1. please encapsulate the code in a check for safe mode, I don't want to accidentally brick devices for hundreds of users
    2. is it a scaled value from Beken or raw value from ADC (that is in 0-1024 range, I guess)?

    Added after 58 [seconds]:

    divadiow wrote:

    Next thing, have you had to calibrate the power on this unit itself after flashing to OBK? I bought mine to calibrate other devices flashed with OBK

    I think that TuyaMCU is calibrated at factory on the MCU side
    Helpful post? Buy me a coffee.
  • #35 20946866
    miegapele
    Level 15  

    p.kaczmarek2 wrote:
    1. please encapsulate the code in a check for safe mode, I don't want to accidentally brick devices for hundreds of users
    2. is it a scaled value from Beken or raw value from ADC (that is in 0-1024 range, I guess)?

    I'm not sure what this is, the sdk limits values to be between 50 and 700. Could be Celsius, but then 70C is sorta low.
  • #36 20946971
    hwti
    Level 2  

    p.kaczmarek2 wrote:
    The autoexec.bat posted earlier also contains 0.01W resolution setup;
    
    setChannelType 3 Power_div100
    

    So, @hwti, can you elaborate on what you mean here?
    hwti wrote:

    The device shows the energy values with 0.01Wh resolution, but only 1Wh is reported.
    I suppose the only way to get the full resolution would be to modify the CH573F firmware (not sure if possible).

    Are you saying that the values from the screen display are not sent to OBK?

    I wrote about the energy values (in Wh), not the power.
    For example, the screen displays 0.07309kWh, and OpenBK reads 73 for channels 6/9.
    But since Tuya doesn't display these two additional digits either, the MCU firmware probably never reports them (unless it's behind an unknown setting).

    maximesharp wrote:
    the pairing screen disappears once the device is connected to the Wi-Fi network.

    Even with "MQTT State: not configured," like in your first post?
    It seems by default OpenBK waits for the MQTT connection to be established to report the Wi-Fi state 4 (i.e., "connected to the cloud").
    Maybe the MCU remembers if a Tuya pairing has been done and has a different behavior.
  • ADVERTISEMENT
  • #37 20947382
    divadiow
    Level 34  
    >>20946773

    this is cool. Hopefully it can be made good for general release :)

    what do your GPIOs look like now as seen in the template export?

    Screenshot of the export template field with highlighted GPIO pin information.

    Added after 34 [minutes]:

    divadiow wrote:
    this is cool. Hopefully it can be made good for general release


    :D Screenshot of the OpenBK7231N interface displaying device status data.
  • Helpful post
    #38 20948700
    divadiow
    Level 34  
    divadiow wrote:
    what do your GPIOs look like now as seen in the template export?


    Oh I understand now. TuyaMCU controls everything, so no GPIO assignments. This is my first real look at anything with TuyaMCU. And also my first CB3S desoldering, which I didnt particularly enjoy, despite the help of this good vid.

    attached is a factory fw dump.
  • #41 20955846
    micbanand
    Level 5  

    I have just flashed one of these with /OpenBK7231T_UA_1.17.457.bin
    but nothing works over Wi-Fi.
    How do I flash the .bat file from this thread?
  • ADVERTISEMENT
  • #42 20955863
    p.kaczmarek2
    Moderator Smart Home
    What do you mean by "nothing works over WiFi"?

    Have you watched our tutorials?

    Autoexec tutorial is here:


    Helpful post? Buy me a coffee.
  • #43 20956255
    micbanand
    Level 5  

    I can see it on a given IP.
    But I get no readings, and the switch on/off is not working.

    Yes, I have watched that video.
    But I can't see anywhere how to upload autoexec.bat to my unit, only how to create it.
  • #44 20957424
    p.kaczmarek2
    Moderator Smart Home
    micbanand wrote:

    But I can't see anywhere how to upload autoexec.bat to my unit, only how to create it.

    Well, for example drag and drop file or just copy content?

    Are you able to open the Web App?
    Helpful post? Buy me a coffee.
  • #45 20957467
    divadiow
    Level 34  
    micbanand wrote:
    But I can't see anywhere how to upload autoexec.bat to my unit, only how to create it.


    I just copy the text into the box after opening the autoexec.bat I created in the web app.
    Screenshot of a web application for editing the autoexec.bat file.
  • #46 20957553
    p.kaczmarek2
    Moderator Smart Home
    You can also drag and drop a file on a field that says.... "drop file(s) or .tar here"
    Helpful post? Buy me a coffee.
  • #47 20957784
    micbanand
    Level 5  

    I think I have lost every WiFi connection.
    I think I have to solder the chip and flash the backup.
    Or can one of you share an obk working one with the default 192.168.1.4 or other known IP?
  • Helpful post
    #49 21005755
    divadiow
    Level 34  
    Finally flashed a replacement after blowing up my first. No desoldering of module, I have no heat gun.
    I had to sever the RX from the CB3S then all was OK flashing with all pins soldered to USB-TTL

    here is Tuya API response for this device

    Code: JSON
    Log in, to see the code


    in summary
    Code: Text
    Log in, to see the code


    This was trace cut and then soldered with a little blob.

    Close-up of a circuit board with visible pins and soldering marks.

    Close-up of a circuit board with a soldered module.
  • #50 21013048
    cdtdsilva
    Level 10  
    How is the current measurement done? Is it a sensing resistor?

    Actually - has someone had any of these (current sensing resistors) failing during a mains short circuit?

    Thanks

Topic summary

The discussion revolves around the Tuya ATORCH S1-B/W/T/H Smart Socket Energy Monitor, focusing on its internal components, firmware flashing, and configuration using OpenBeken. Users share experiences with the device's autoexec.bat file, addressing issues such as incorrect voltage and power readings, and the need for specific channel types for accurate data reporting. The conversation includes troubleshooting steps, firmware updates, and the integration of the device with Home Assistant (HASS). Key components mentioned include the C3BS (BK7231N) chip, CH573F logic chip, and BL0942 metering chip. Users also discuss the importance of proper channel configuration for energy monitoring and relay control.
Summary generated by the language model.
ADVERTISEMENT