logo elektroda
logo elektroda
X
logo elektroda

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

yuretskor 6414 97
ADVERTISEMENT
  • #61 20460061
    p.kaczmarek2
    Moderator Smart Home
    Thank you for testing.

    yuretskor wrote:

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

    You can use either console commands or a Web Application wrapper.
    You need to set default type for those channels, because they are marked as temperature/humidity.
    Here:
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?

    yuretskor wrote:

    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.

    Hmm, web browser on Android does not support the onchange event? I will check this out.


    Okay, how stable is the LED control now? I think we soon may begin working on the temperature to color mapping.... how would you like it to work?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #62 20460080
    yuretskor
    Level 6  
    Through the webapp, I set the default value and it works until reboot. Then it goes back again. I did both from my phone and computer. The SetChannel 0 default command does not work or I do not understand it correctly ( Led control from a computer is 100%, all functions work as they should. At work, depending on the temperature, I see the following algorithm: Temperature from 0 to 10 color blue, temperature from 10 to 20 color yellow temperature from 20 to 30 color red. And all this would work in the time range from 7.00 to 21.00. something like this.
  • ADVERTISEMENT
  • #63 20460168
    p.kaczmarek2
    Moderator Smart Home
    yuretskor wrote:
    Through the webapp, I set the default value and it works until reboot. Then it goes back again.

    Okay, I can see now what's wrong. The autosave was missing for this particular API.

    Please update to version 1.15.507 or later and try using Web App again. It will be saved now.
    Helpful post? Buy me a coffee.
  • #64 20460187
    yuretskor
    Level 6  
    @p.kaczmarek2 works. The change has been preserved. Can I have another question? Why is the temperature data for mqtt given with a resolution of 0.000001, it is displayed on the web with 0.1, although the sensor is very accurate and can output up to 0.01. It's so purely for order). (Although I understand that 21.8 and 21.84, I won’t feel the difference)
  • #65 20460273
    p.kaczmarek2
    Moderator Smart Home
    This is most likely because we have started with TuyaMCU compatibility, which forces integer values (no fractional point) for everything, including temperature.
    See:
    https://www.elektroda.com/rtvforum/topic3942730.html
    TuyaMCU stores temperature as value times 10, so we had channel type:
    
    Temperature_div10
    

    all to be compatible with TuyaMCU standard.

    I am not sure about that part:
    Quote:

    given with a resolution of 0.000001

    but you might be just referring to sprintf rounding?
    Most likely rounding has to be added here:
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?
    but we need to make sure that rounding respects channel type.

    And to get 2 decimal places standard, we would need to introduce:
    
    Temperature_div100
    

    and handle it accordingly.


    @dheenhasty , would you be interested in doing the decimal places fix?
    You need to go to MQTT_ChannelChangeCallback, an alter MQTT_MultiplierConfiguredOnChannel to return the number of decimal places required, and then add sensible rounding here:
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?

    Another thing to do would be to introduce that Temperature_div100 with channel type and everything and in driver check which resolution user wants.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #66 20460607
    yuretskor
    Level 6  
    @p.kaczmarek2 On the latest firmware, the color change through the interface has worked. Thank you. Now 100% functional
    I'll wait for the display test on tm1637 and maybe tell me which way to dig to change the color.
  • #67 20460658
    p.kaczmarek2
    Moderator Smart Home
    We'll do the color stuff as well, but first:
    yuretskor wrote:
    @p.kaczmarek2 On the latest firmware, the color change through the interface has worked. Thank you. Now 100% functional

    so... which browser were you using?
    I have done some tests and I realized that color change interface worked always for me on Chrome on Windows and worked for me on my iPhone and iPad. I had to borrow a family phone with Android and then I realized it's not working on certain browsers.
    It has turned out that input color events of HTML are handled differently by different browsers, this is very not nice from the developer perspective...
    I was totally not aware about the problem, but at least it's fixed now.
    Helpful post? Buy me a coffee.
  • #68 20460663
    yuretskor
    Level 6  
    @p.kaczmarek2 I use a smartphone on Android's browser Google Chrome, I also installed Opera and Mi browser but it did not work there. On the PC I used Google Chrome, everything is ok.
  • #69 20460684
    p.kaczmarek2
    Moderator Smart Home
    I will update the input code again because it seems that current version still had issues on Firefox. Next one will be ok.
    Helpful post? Buy me a coffee.
  • #70 20460876
    yuretskor
    Level 6  
    Yes, everything works, the code for RGB has been added.
  • #71 20463421
    yuretskor
    Level 6  
    Everything works so well that there is nothing to ask)
  • #72 20463602
    p.kaczmarek2
    Moderator Smart Home
    Okay, so it's time to try to map the temperature to color, right? Or what kind of effect do we want?

    I have an idea how to do it. I will add a Map command.
    Arguments:
    
    [TargetChannel][InputValue][InMin][InMax][OutMin][OutMax]
    

    So we will try to do something like that.
    First, catch temperature change:
    
    addEventHandler OnChannelChange 10 [todo]
    

    Then, in change, map temperature. Let's say temperature input range is 100 to 250 (cause it's times 10) to the Hue value from -120 to 50, we will use 15 as temporary channel:
    
    Map 15 $CH10 100 250 -120 50
    

    And then we can use hue value...
    
    HSBColor1 $CH15
    

    Then we can create a one-liner event handler from that and it could work, but it's not a final version. I will review it again tomorrow.
    Helpful post? Buy me a coffee.
  • #73 20466222
    p.kaczmarek2
    Moderator Smart Home
    My TM1637 displays has arrived. I have started writing driver for them:
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED? [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?
    Helpful post? Buy me a coffee.
  • #74 20466224
    yuretskor
    Level 6  
    Very good news. Will it work for 4 digits? And if there is time, then always with dots and blinking. It greatly changes the perception of the device.
  • #75 20466562
    p.kaczmarek2
    Moderator Smart Home
    I have 4 digits as well, they are virtually the same from the implementation standpoint.
    [BK7231T/WBLC5] How to attach SHT30 sensor to smart Tuya LED?
    We will have to script them... but it should be very simple.
    Helpful post? Buy me a coffee.
  • #76 20469110
    yuretskor
    Level 6  
    Nothing happened with tm1637? Collect the lamp and put in place? We will not test.
  • #77 20469144
    p.kaczmarek2
    Moderator Smart Home
    The driver is ready but there is no tutorial yet, but you can test it by updating the firmware, setting the CLK and DIO pin roles for two chosen IOs, and then by using:
    
    TM1637_Print 0 0 123456
    

    command, where first argument is offset in display and second is character limit (0 for none).

    To print a channel value, you can try:
    TM1637_Print 0 0 $CH10
    etc etc

    You can try it out now or wait for the documentation/tutorial
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #78 20842388
    yuretskor
    Level 6  

    Hello. I haven't been here for a long time. How are things going now? Tm 1637.
  • #79 20842508
    p.kaczmarek2
    Moderator Smart Home
    TM1637 support is implemented, we've did it with @DeDaMrAz , would you like to try running it?

    I even done an article on that in Polish:
    https://www.elektroda.pl/rtvforum/topic3961943.html#20468593
    Helpful post? Buy me a coffee.
  • #80 20842697
    yuretskor
    Level 6  

    We need to gather our strength and try. It is possible to implement the display of time every 5 seconds, then data from the Sht30 sensor: temperature every 5 seconds and humidity every 5 seconds. And so in a circle?
  • #81 20842737
    p.kaczmarek2
    Moderator Smart Home
    Yes, it should be possible to do this fully in the OBK script with the current version of the firmware. If not, I can easily add required mechanisms.
    Helpful post? Buy me a coffee.
  • #82 21199555
    yuretskor
    Level 6  
    Hello. Change that then abandoned the topic, but there were circumstances both personal and global (( from Ukraine I. Decided to raise an old topic and resurrect a forgotten project on connecting the module to TM1637 to BK7213T sh31 to display the time, temperature and humidity readings. How are things now with this? Ready to check and test, there was a lot of free time.

    Added after 2 [hours] 27 [minutes]:

    And one more thing. What is the shipping period mqtt message? 10, 15, 20 seconds? Maybe 5 sec

    Added after 40 [minutes]:

    I figured out how to send messages every 5 seconds using commands
    mqtt_broadcastInterval 2
    mqtt_broadcastItemsPerSec 5
  • #83 21200610
    p.kaczmarek2
    Moderator Smart Home
    Hey, how are you? We've made some more tutorials on displays, etc, in a meantime. You can check out one here:
    https://www.elektroda.com/rtvforum/topic4061154.html

    Why do you want to increase the frequency of MQTT broadcasts? Maybe it would be more optimal to use scripting to publish a single value every second, instead of increasing the frequency globally with mqtt_broadcastInterval ?
    Helpful post? Buy me a coffee.
  • #84 21200734
    yuretskor
    Level 6  
    >>21200610 @p.kaczmarek2 Thanks for the link, I haven't seen it. It describes almost exactly what I need, the only thing I want is a cyclic change of time - temperature - humidity. And regarding the interval, if you don't enter these commands, the sending goes with an inconstant period (it's quite possible that it's a dish when the value has changed) because of this I get errors on another module that receives this data. I'll try tomorrow, I'm at work today. Everything is OK, we're holding on.
  • #85 21202164
    yuretskor
    Level 6  
    Hi, I'm trying to run the driver. ТМ1637 and after the commands startDriver TM1637 I see the following on the screen. I also have a question: are the pigs free only with UART2_TX and UART2_RX. Can I hang on them CLK and DIO TM1637?
    Screenshot of the OpenBK7231T Command Tool showing driver information.


    Added after 53 [minutes]:

    I realized that I need to make a firmware with the library included displays. Can you help me with something? I have a problem with that. Гитхаб I can't figure it out. Thanks.

    Added after 3 [hours] 40 [minutes]:

    Nothing works. It's very difficult to master. Maybe there is some video?
  • #86 21202562
    p.kaczmarek2
    Moderator Smart Home
    yuretskor wrote:
    I also have a question: are the pigs free only with UART2_TX and UART2_RX. Can I hang on them CLK and DIO TM1637?

    It may be possible to use RX2/TX2, but I am not sure. You would need to try. It's a debug log output by default.


    yuretskor wrote:

    I realized that I need to make a firmware with the library included displays. Can you help me with something?

    Sure, we have tutorial about that:
    https://www.elektroda.com/rtvforum/topic4033833.html#20946719
    Also related:
    https://www.elektroda.com/rtvforum/topic4056286.html
    Helpful post? Buy me a coffee.
  • #87 21202873
    yuretskor
    Level 6  
    @p.kaczmarek2 Can you please add support for the TM1637 module to the firmware and upload it here. It's almost impossible to use it from a phone on GitHub. The computer is currently unavailable.
  • #88 21202919
    p.kaczmarek2
    Moderator Smart Home
    Sure, here is a PR with TM1637 enabled. Please follow the steps shown in my guide to find the binary download link:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1330

    Added after 47 [minutes]:

    EDIT: It seems there is some strange github issue preventing the build on some platforms
    Helpful post? Buy me a coffee.
  • #89 21203068
    yuretskor
    Level 6  
    @p.kaczmarek2 I can't figure out where the file is for downloading? In your settings, are all the previous libraries enabled and TM1637 added?
  • #90 21204622
    yuretskor
    Level 6  
    @p.kaczmarek2 to download new firmware files you have to give permission?

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