logo elektroda
logo elektroda
X
logo elektroda

[Solved] Calibrating Temperature & Humidity Sensor on TuyaMCU with OpenBeken

geocristi 2253 9
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 21274484
    geocristi
    Level 3  
    Hi,
    Is there any possibility to set an offset or calibration of the temperature and humidity sensor?
    I tried, but without success: AHT2X_Calibrate -2 5, CHT_Calibrate -2 5
    thx
    Moderated By p.kaczmarek2:


    I've split this post from https://www.elektroda.com/rtvforum/topic3942730.html

  • ADVERTISEMENT
  • #2 21274572
    divadiow
    Level 35  
    geocristi wrote:
    AHT2X_Calibrate -2 5

    this should work I believe
  • #3 21274593
    geocristi
    Level 3  
    >>21274572
    The T&H sensor is indeed AHT10, but unfortunately "AHT2X_Calibrate" has no effect
    I also tried to load a driver startDriver AHT10, still no effect
  • ADVERTISEMENT
  • #4 21274608
    divadiow
    Level 35  
    oh. what build firmware are you using? what platform is your device? AHT2X driver is not included in the build by default. If Beken, the firmware in here would have included the driver:
    https://github.com/openshwprojects/OpenBK7231T_App/actions/runs/8769670483
    but the download link has expired, so attached.

    AHT2X experiments here https://www.elektroda.com/rtvforum/topic4052685.html and information on adding the driver to the latest code and making your own custom OpenBeken firmware:

    https://www.elektroda.com/rtvforum/topic4081556.html
    https://www.elektroda.com/rtvforum/topic4082682.html
  • ADVERTISEMENT
  • #5 21274797
    p.kaczmarek2
    Moderator Smart Home
    @geocristi are you referring to the device from the original first post? It's a TuyaMCU device, so OpenBeken "doesn't know" what sensor is used, you can't calibrate it directly. AHT driver is not even run on OBK.

    The best you can do is:
    
    addEventHandler OnChannelChange 1 setChannel 2 $CH1+1.23
    

    This assumes that channel 1 is not calibrated value and channel 2 is calibrated. This is an universal, driver-agnostic approach.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #6 21276546
    geocristi
    Level 3  
    @divadiow - I did not build a firmware specially for this. I removed the WiFi chip from the device and burned it with the default.
    Then I follow the instructions for creating the autoexec.bat, nothing more.
    The firmware: Built on Oct 25 2024 06:03:18 version 1.17.757
    The device: TH06 with WB3S wifi chipset
    Regarding the archive posted by you above, I tried to make an OTA update, after which it became a brick. I had to desolder the WB3S and write it again.

    @p.kaczmarek2 - Yes, it is the same device for which you put in so much work, and I thank you for that!
    addEventHandler OnChannelChange 1 setChannel 2 $CH1+1.23 - has no effect!

    Thank you both!
  • #7 21276590
    divadiow
    Level 35  
    geocristi wrote:
    I did not build a firmware specially for this.

    Yeh, my bad. I didn't check device in first post. No need for driver if TuyaMCU
  • #8 21276605
    geocristi
    Level 3  
    >>21276590 No problem! Still search for a way of calibration.
  • #9 21277218
    p.kaczmarek2
    Moderator Smart Home
    geocristi wrote:

    @p.kaczmarek2 - Yes, it is the same device for which you put in so much work, and I thank you for that!
    addEventHandler OnChannelChange 1 setChannel 2 $CH1+1.23 - has no effect!

    Are you sure? Remember that:
    - if you are using config from the first post, then channel 2 is humidity, then you should rather use channel 3
    - if you are using HA or anything else, note that old raw temperature will still be in channel 1 and calibrated will be in channel 3....
    - futhermore, this only calibrates the temperature seen by OpenBeken and Home Assistant, there is no known way to change it for screen because screen is connected directly to the MCU in your device. So unless there is a calibration dpID (but I don't remember seeing this in app), there is no way to change screen temperature...
    Helpful post? Buy me a coffee.
  • #10 21297264
    geocristi
    Level 3  
    There is no way to calibrate the sensor
    The topic may be closed

Topic summary

The discussion revolves around the calibration of temperature and humidity sensors, specifically the AHT10 model, using TuyaMCU with OpenBeken firmware. The original poster inquires about setting an offset for calibration but encounters issues with the commands AHT2X_Calibrate and CHT_Calibrate. Responses indicate that the AHT2X driver is not included by default in the firmware build, and calibration may not be directly possible due to the limitations of TuyaMCU. Suggestions include using event handlers to adjust channel values, but it is noted that this only affects readings in OpenBeken and Home Assistant, not the display connected to the MCU. Ultimately, it is concluded that there is no known method to calibrate the sensor effectively.
Summary generated by the language model.
ADVERTISEMENT