logo elektroda
logo elektroda
X
logo elektroda

Tuya TYTE-D1 Smart Switch: Relay Works, Temperature Sensor find

marcolueck1976 3561 31
ADVERTISEMENT
  • #1 21135669
    marcolueck1976
    Level 8  
    Hi there!

    Here is my new project:
    Tuya Smart Switch
    TYTE-D1 Wifi / bluetooth temperature relay

    I've flashed it, works fine, get the power parameters, relay is working, but I can not get the temperature.

    White Tuya smart switch model TYTE-D1 with visible technical specifications. Tuya Smart Switch circuit board with electronic components including CB3S module.


    Code: JSON
    Log in, to see the code

    Screenshot of a web interface showing relay status.

    I want to use the relay to work with my aquarium heater, there is an external temperature sensor.

    Where is my fault?
  • ADVERTISEMENT
  • #2 21135733
    p.kaczmarek2
    Moderator Smart Home
    Hello, what kind of sensor is there? Which GPIO is used? Is it supported?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21135746
    marcolueck1976
    Level 8  
    >>21135733
    It's an external sensor via 3.5mm plug.
    External sensor connected via a 3.5 mm plug to a white device on a measurement grid.
    I don't know the GPIO pin.

    That's the output from the flasher.

    Code: JSON
    Log in, to see the code
  • #5 21135907
    marcolueck1976
    Level 8  
    Sorry, I don't understand much of coding. Can you say what I could do to bring the sensor to work?
  • ADVERTISEMENT
  • #6 21138205
    divadiow
    Level 34  
    If you have a multimeter you could trace to where it goes on the CB3S module. But still, a driver would need writing for the DS18B20 I imagine.
  • #7 21139176
    marcolueck1976
    Level 8  
    That sounds not so good for me. Is it possible that someone can write a driver and help me at this project. I ordered more of these things. some days ago, somebody added this thing to the database, but temperature is not working there...

    Thank you for your help :-)

    Hinzugefügt nach 1 [Stunden]:

    >>21138205I try, but can´t find anything
  • Helpful post
    #8 21139326
    p.kaczmarek2
    Moderator Smart Home
    I can look into it once I finish IR2 driver for remotes. Maybe.
    Helpful post? Buy me a coffee.
  • Helpful post
    #9 21147604
    divadiow
    Level 34  
    The GPIO for DS18B20 on the TYTE-D1 is P26

    "sel_pin_pin":"9",
    "bt1_pin":"7",
    "vi_pin":"6",
    "netled_pin":"14",
    "one_wire_pin":"26",
    "ele_pin":"24",
    "rl1_pin":"8"

    one_wire_pin could be a new detection for Easy Flasher I guess. I've not seen this for any other device though.

    I didn't know One Wire was a standard

    Code: Text
    Log in, to see the code


    for the record here is what the Tuya app options look like for TYTE-D1

    Tuya app interface showing current temperature. Tuya app on a phone displaying temperature and automation options. Screenshot from the Tuya app for TYTE-D1 with an error message and statistics. Screenshot of the Tuya app showing humidity statistics for TYTE-D1. Tuya app interface on TYTE-D1 showing current temperature 24.4°C, autowork settings, and options: timer, countdown. Tuya app screen with added device.
  • #10 21147863
    marcolueck1976
    Level 8  
    Hi :-)

    Sounds very good! Maybee i can test it tomorrow.

    Is there an option that after an power failure the relay switches in the state before? Like at led´s. That would be great, because the relay should be for my aquarium heater, would not good to have an power failure or something else. I look in the config but can not find ???
  • Helpful post
    #11 21147868
    p.kaczmarek2
    Moderator Smart Home
    Maybe in "Configure startup" tab? You can set channel there to remember it's state.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #12 21147893
    divadiow
    Level 34  
    marcolueck1976 wrote:
    Sounds very good! Maybee i can test it tomorrow.

    but! I only added more information. The DS18B20 still needs a driver...
  • #13 21150110
    marcolueck1976
    Level 8  
    Sorry, i forgot :-(
  • #14 21155826
    p.kaczmarek2
    Moderator Smart Home
    Helpful post? Buy me a coffee.
  • #16 21158425
    p.kaczmarek2
    Moderator Smart Home
    Wait @divadiow, is DS18B20 working for you now?
    Helpful post? Buy me a coffee.
  • Helpful post
    #17 21158431
    divadiow
    Level 34  
    I have not progressed since last post on closed PR comments. I was posting 3.5mm jack continuity findings for the record

    Added after 10 [hours] 50 [minutes]:

    with an adapted single Arduino sketch to combine the print_family, check_fake and discover_fake examples from https://github.com/koendv/CheckDS18B20/tree/main with the DQ (data) pin connected to D4/GPIO2 of an ESP8266 NodeMCU we can see that the DS18B20 in my TYTE-D1 is a Sensylink clone - CT1820B

    Code: Arduino
    Log in, to see the code


    Screenshot of results checking DS18B20 chip for clone.

    https://en.sensylink.com/html/web/product/wdcgq/xpbdcw/1662800678185840642.html

    ESP8266 NodeMCU board connected to a breadboard with wires.
  • #19 21177195
    p.kaczmarek2
    Moderator Smart Home
    DS18B20 driver has progressed a lot since last time. @divadiow , is the DS18B20 working for you?
    Helpful post? Buy me a coffee.
  • #20 21177339
    divadiow
    Level 34  
    well. the latest I know is that on BL602 the driver seems good https://github.com/openshwprojects/OpenBK7231T_App/pull/1294

    but regarding the TYTE-D1 and Beken the latest is that with startDriver DS1820 18 the fewest CRC errors are seen with PR build 1296_merge_7117258cf00e with powersave 0. I don't think I found a working timing with powersave 1

    https://www.elektroda.com/rtvforum/topic4056286-30.html#21165621

    I think @max4elektroda was going to do something with a logic analyser
  • #22 21254905
    p.kaczmarek2
    Moderator Smart Home
    That's nice, did anyone already test that? I can merge it today.
    Helpful post? Buy me a coffee.
  • #23 21255243
    divadiow
    Level 34  
    Not sure. I don't get the impression it has been tested reading the GH chat. 4 PR builds awaiting approval.
  • #26 21316992
    Lawk1961
    Level 1  
    Looks as if there is a sub GHz radio as well. Coiled antenna opposite the WiFi module. Top label says 433MHz
  • #27 21379314
    teriall
    Level 1  
    Hello everyone, I am trying to set up a DS18B20 temperature sensor with OpenBeken on a BK7231N chip, but unfortunately, I am unable to get it to display any temperature readings.

    I have already configured GPIO 26 as DS1820_IO and made sure to start the DS18B20 driver. However, the web interface keeps showing "0 drivers active," and no temperature data is available.

    I have tested the sensor on another platform, and it works fine there. The MQTT connection is working, but no temperature readings are being published to the MQTT broker either.

    All other components, such as the relay, button, and WiFi LED, are working perfectly. I checked the logs and did not find any errors related to the DS18B20 sensor.

    Could someone please guide me on what might be going wrong or suggest any additional steps I should try? I really appreciate any help you can provide. Thank you!
  • #28 21382258
    divadiow
    Level 34  
    what version of OpenBeken are you running?
  • #29 21382890
    p.kaczmarek2
    Moderator Smart Home
    I am waiting for final shipment of DS18B20 set from China, so I will be most likely soon able to add DS18B20 to my test boards. I'll check this out and let you know. Please remind me if I forget (like in a week or two).
    Helpful post? Buy me a coffee.

Topic summary

The discussion centers on the Tuya TYTE-D1 smart switch featuring a BK7231N chip and an external DS18B20 temperature sensor connected via a 3.5mm jack. The relay and power measurement functions operate correctly, but temperature readings are initially unavailable due to missing driver support. GPIO 26 is identified as the One-Wire data pin for the DS18B20 sensor. Community members have been developing and porting a DS18B20 driver for the OpenBeken firmware, with progress including pull requests and testing on the CB3S board variant. The One-Wire protocol characteristics and sensor clone identification (Sensylink CT1820B) were discussed. Users seek guidance on enabling temperature reporting to MQTT and Home Assistant, with suggestions to start the DS1820 driver via custom commands and configure startup scripts. Additional features like relay state retention after power failure were queried, with configuration options suggested. Some users report partial success with the driver on GPIO 26, while others face issues with driver activation and temperature data publishing. The relay's load capacity and behavior under varying heater loads were also discussed. The latest OpenBeken builds include a DS18B20 driver and device template for TYTE-D1, facilitating integration of temperature sensing alongside relay control and power monitoring.
Summary generated by the language model.
ADVERTISEMENT