logo elektroda
logo elektroda
X
logo elektroda

[BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?

yuretskor 6414 97
ADVERTISEMENT
  • #31 20455491
    p.kaczmarek2
    Moderator Smart Home
    To publish state every minute use:
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?
    You can also put:
    
    mqtt_broadcastInterval SECONDSNUMBER
    

    in autoexec, replace SECONDSNUMBER with for example 120 for 120 seconds.

    
    1. data via mqtt can only be received until the module is rebooted, after rebooting it is necessary to enter the channel type again, for some reason they are not saved.
    

    Where do you set channel types?
    Then in autoexec do:
    
    setChannelType 0 Temperature_div10
    setChannelType 1 Humidity
    
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #32 20455518
    yuretskor
    Level 6  
    Thanks, I'll try it at home.
    I changed the flag type data via the web interface. After that, I pressed the save button, and the data was saved only after 3-4 reboots.

    Added after 2 [minutes]:

    This [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?

    Added after 27 [minutes]:

    Tell me I have a display on the TM1637 processor, it is not supported by the firmware. Is it possible to somehow add it? ready to be a tester)

    it would not be bad to display in a circle Time (21:45), Temperature (-7 °), Humidity (H 99) with a change interval of 5-10 seconds, well, this is of course a dream))
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?[/url]

    Added after 6 [hours] 4 [minutes]:

    Thank you. Now it works as it should. I will now connect the led module. Is it really possible to implement the change of the module colors on the temperature? [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?
  • #33 20456240
    p.kaczmarek2
    Moderator Smart Home
    Very nice idea with display. I will check if I can order one like that in Poland and try to add support for you.

    Quote:
    module colors on the temperature

    It should be possible, but do you mean LED color? Do you have basic LED controls running?
    Helpful post? Buy me a coffee.
  • #34 20456257
    yuretskor
    Level 6  
    I took the wblc5 module from the led lamp. I have this type of LED module. I think it will not be a problem to order the tm1633 module in Ukraine, they are like dirt.
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?
  • ADVERTISEMENT
  • #35 20456624
    p.kaczmarek2
    Moderator Smart Home
    Your device is using SM2135 LED driver. This LED driver supports 5 channels, so RGBCW is possible, but only requires 2 lines to work - SDA and SCL. It's using modified I2C protocol.
    Here is the pinout:
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?
    Communication is using DATA (SDA) and CLK (SCL) pins.
    Your wifi module, on other hand, has those pins:
    3PWM4I/OHardware PWM pin, which is connected to the P24 pin on the internal IC
    4PWM5I/OHardware PWM pin, which is connected to the P26 pin on the internal IC
    5PWM0I/OHardware PWM pin, which is connected to the P6 pin on the internal IC

    My question: can you take a look at the PCB traces or check with multimeter where the CLK and DAT are connected? To which Px of WiFi module?

    Of course, disconnect power before doing that!
    Helpful post? Buy me a coffee.
  • #36 20456657
    yuretskor
    Level 6  
    CLK -- PWM5, DATA(SDA) -- PWM4. If I now connected sht30 to Rx1 and Tx1, then it will not work to control the led?
  • #37 20456669
    p.kaczmarek2
    Moderator Smart Home
    SHT30 won't hurt for LEDs. It should be ok.

    Ok, so now, in pins config:
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?
    and reboot...
    Helpful post? Buy me a coffee.
  • #38 20456692
    yuretskor
    Level 6  
    Thanks, I will try. Now the module is soldered separately from the power board. In order for everything to work, you need to solder it and connect the power for sht30 and bring it out through the lamp housing. But I drank alcohol today and I don’t want to get drunk into 220 V circuits. I’ll be there tomorrow. Thanks, I'll write back tomorrow.
  • Helpful post
    #39 20456793
    p.kaczmarek2
    Moderator Smart Home
    There is no need to hurry. I will be here tomorrow to help you.

    Once you start the driver, you will most likely see that the colors are swapped. White warm instead of blue, etc, etc. We will remap them with console command.

    Then we can try to write a channel change handler that will remap the temperature or whatever you want to a hue value or something like that.... I'll think about it.

    Added after 10 [minutes]:

    EDIT: I've bought that display with a donation money:
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?
    I will try to get it running once it arrives, but I can't promise anything.
    Helpful post? Buy me a coffee.
  • #40 20457482
    yuretskor
    Level 6  
    Connected as you suggested. Led doesn't work. (
    Everything is very expensive for you.

    Added after 1 [hour] 10 [minutes]:

    Now I have a sht30 sensor connected I
    I connect the led module to the sm2135e when you press Toggle light for a few seconds, the value of channel 1 changes from the current humidity to 100 and then returns back. In this case, the led module does not turn on.


  • #41 20457713
    p.kaczmarek2
    Moderator Smart Home
    Please test the LED driver directly by using the SM2135_RGBCW command.
    So something like:
    
    SM2135_RGBCW FF00000000
    

    and then:

    
    SM2135_RGBCW 00FF000000
    

    etc.

    The following command writes to LED directly and skips channels.
    Helpful post? Buy me a coffee.
  • #42 20457747
    yuretskor
    Level 6  
    Not work( [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?

    Added after 10 [minutes]:

    Maybe you need to use the SM2135_Current command to raise the current to 10, for example?

    Added after 42 [minutes]:

    And again the channel type has changed, I set the temperature to div10 after a reboot, it changes to the humidity of div10. Channel type change via web
  • #43 20457907
    p.kaczmarek2
    Moderator Smart Home
    SM2135_Current default value is correct.
    Nothing works? Not even:
    
    SM2135_RGBCW 000000FF00
    

    or
    
    SM2135_RGBCW 0000FF0000
    

    or
    
    SM2135_RGBCW 00000000FF
    

    ?
    That would mean that maybe SDA and SCL are swapped (you need to reboot after changing).
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #44 20458002
    yuretskor
    Level 6  
    The led module started working after I removed autoexec.bat with the following code.

    echo "activate SHT3X Sensor"
    startDriver SHT3X
    setChannelType 0 Temperature_div10
    setChannelType 1 Humidity
    addRepeatingEvent 5 -1 SHT_Measure
    mqtt_broadcastInterval 5


    SHT30 does not work at the same time ((and I see that when adjusting the color, the data changes in channel 2, where the humidity data is. Could this be the reason?

    Added after 10 [minutes]:

    and the colors don't match. I put Red - Blue, Blue - Green, Green - Red. What is C and W
  • #45 20458050
    p.kaczmarek2
    Moderator Smart Home
    This command allows you to remap channel indexes:
    
    SM2135_Map 2 1 0 4 3 
    

    it can be run once, without autoexec, it will remember the setting.
    You must guess which are the indexes.

    I am not sure about SHT30, fix colors first and then we'll think about it.
    Helpful post? Buy me a coffee.
  • #46 20458059
    yuretskor
    Level 6  
    Reboot after change?
  • #47 20458088
    p.kaczmarek2
    Moderator Smart Home
    No, in this case no reboot is indeed. But to see the new colors, you need to change something on web panel, move slider, select another color, toggle light. But no reboot needed.
    Helpful post? Buy me a coffee.
  • #48 20458089
    yuretskor
    Level 6  
    Adjusted colors Red - Red, Green - Green, Blue - Blue. The code is like this
    SM2135_Map 1 0 2 3 4

    The brightness is adjustable, but Cold - Warm does not work, as soon as I start to adjust the lamp turns off.
    That is, the central part of the lamp does not work only RGB LED
  • #50 20458108
    yuretskor
    Level 6  
    I turned on flag 9, the main LEDs started working and I entered the code for full-fledged work
    SM2135_Map 1 0 2 4 3

    only after applying the flag, the RGB LEDs began to shine dimmer, but within the normal range, I like it. I remove the flag, they do not become brighter. It will do for me anyway, this is for statistics) how now to make the temperature sensor SHT30 work as well? Maybe it needs to be transplanted to another channel, for example 5 temperature, 6 humidity? How to do it?
  • #51 20458931
    p.kaczmarek2
    Moderator Smart Home
    Can you try to change SHT channels to something unused, like 10 and 11:
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?
    Also keep in mind that you need to change your old indices 0 and 1 in autoexec as well.
    Helpful post? Buy me a coffee.
  • Helpful post
    #52 20459103
    yuretskor
    Level 6  
    I can't figure out what's wrong with my module. Last night, the color red, blue, green, cold and warm worked separately. From the web interface. And the sensor worked separately. I turned it on in the morning, and the colors are not selected only by the RGB white channel. And it works cold and warm (only steel on the turn) if I send the command SM2135_RGBCW 000000FF00, then the color turns on. I send the command SM2135_Map 1 0 2 4 3 yesterday everything worked on it correctly yesterday, today it does not work anymore. As for the channels, I set 10 and 11 for sht30 led does not work at all (the temperature is transferred to these channels. Also I updated the firmware to the latest 499

    Added after 13 [minutes]:

    Sorry. Now connected from the computer, the color change works as it should. But not from the phone (although it worked yesterday. I'm in shock, honestly. Sorry again.

    Added after 18 [minutes]:

    Checked from a computer. The SHT3X-Sda-Scl adventure automatic temperature measurement operation function works. Just turn it on and work Led does not work.
  • #53 20459181
    p.kaczmarek2
    Moderator Smart Home
    I think I know what''s wrong. Thank you! Thanks to you I've found a potential issue that happens only when using LED driver with SHT driver. I will fix it for you in the next update. Please wait.

    @dheenhasty , do you know what happens? It's related to how I2C is handled...
    Helpful post? Buy me a coffee.
  • Helpful post
    #54 20459206
    dheenhasty
    Level 13  
    if Led driver is a 2135 i think i might have an idea. when you rework all the sensor /I2C stuff i find some SM2135 void in SHT Driver.

    So i suppose maybe we have some cross variable here ....
  • #55 20459212
    p.kaczmarek2
    Moderator Smart Home
    The issue is because we're in a middle of transition to shared soft I2C code (because at first we had I2C code duplicated in each driver, btw, surprisingly, Tasmota still has that code duplication), but the:
    
    int g_i2c_pin_clk = 0;
    int g_i2c_pin_data = 1;
    

    are still shared and global. And I2C LED can be called from other thread than I2C sensor...

    I will change the I2C code to use a local variable with a struct with two pin indices so there are no global variables anymore.

    @dheenhasty will you be able to test my changes later today?
    Helpful post? Buy me a coffee.
  • #56 20459219
    dheenhasty
    Level 13  
    Sure no problem later today.

    and i saw that Soft_I2C_Start and Soft_I2C_Stop is declared on SM2135 driver, but with SM2135 variables in it. don't know yet if it can impact;
  • #57 20459236
    p.kaczmarek2
    Moderator Smart Home
    They were here only temporary, I was in process of moving them to drc_soft_i2c.c, which are they now since several hours.

    I am finalizing the transition right now:
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?

    Added after 1 [hours] 17 [minutes]:

    @dheenhasty I have first tested my changes on BP5758 LED driver, they seem to work, so I pushed my changes to the main tree. Is the SHT still working for you?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #58 20459500
    dheenhasty
    Level 13  
    Yes everything ok on SHT Side.
  • #59 20459538
    p.kaczmarek2
    Moderator Smart Home
    @yuretskor I don't know if it fixes your issue, but you can try updating to latest version

    But it most likely will, because earlier even the SDA/SCL lines were overwritten by one driver for the another driver...
    Helpful post? Buy me a coffee.
  • #60 20459873
    yuretskor
    Level 6  
    @p.kaczmarek2 yes. Now everything works as it should. Both the LED module and the sht30 sensor, just to send the readings correctly via mqtt, you need to change the channels, I set 10 and 11. Now everything is fine. Thanks a lot. So the firmware will be perfect. Still, now the rgb color change by temperature and the tm1637 display and then there will be a bomb in general. Cool guys, thanks very much!

    Added after 1 [minutes]:

    Tell me how to remove the data in the square?[BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?

    Added after 14 [minutes]:

    And, for some reason, changing the color through the browser on Android smartphones does not work, in order to change the color, you need to select a color and click on the launch web application button, then the color changes. From the computer works immediately.

Topic summary

The discussion revolves around integrating an SHT30 temperature and humidity sensor with a smart Tuya LED lamp utilizing a BK7231T processor. The user seeks guidance on the necessary firmware and connections for repurposing the LED lamp as a sensor. Responses include recommendations to flash OpenBeken firmware, connect the SHT30 sensor to specific pins (VDD, GND, SDA, SCL), and utilize UART1 for programming. Users share troubleshooting tips for Wi-Fi connectivity issues, configuring MQTT for data transmission, and managing LED functionality alongside sensor readings. The conversation also touches on the challenges of maintaining channel types for MQTT and the need for firmware updates to resolve conflicts between the LED driver and sensor operations. Ultimately, the user successfully configures the system to read temperature and humidity while controlling LED colors based on temperature readings.
Summary generated by the language model.
ADVERTISEMENT