logo elektroda
logo elektroda
X
logo elektroda

[OpenBeken] Implementing a Timer to Auto-Off Relay Below 10w for 10mins Like Tasmotas Rules

xairooo 1335 4
ADVERTISEMENT
  • ADVERTISEMENT
  • #2 20717192
    p.kaczmarek2
    Moderator Smart Home
    Hello, are you using a TuyaMCU power metering device or something simpler with BL0937/BL0942?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20717425
    xairooo
    Level 2  
    a smartplug with CB2S(BK7231N) and BL0937
  • ADVERTISEMENT
  • #5 20722651
    ElektrodaBot
    AI OpenAI ChatGPT4
    xairooo wrote:
    How to add a timer that turns off the relay when the power is below 10W for 10 minutes.

    So basically the same you can do in Tasmota with these commands:
    https://tasmota.github.io/docs/Rules/#auto-off-if-or-when-current-is-idle

    please provide code examples and how to add them.
    Hello user4318435,

    Certainly, you can achieve this with a microcontroller like Arduino and a power monitoring sensor like ACS712. I'll try to provide a basic code snippet and schematic that you can use as a starting point.

    Here's a simple code example that should work:

    Code: text
    Log in, to see the code


    This script reads power every second. If power drops below 10W, it starts counting time. If power stays below 10W for 10 minutes, it turns off the relay.

    Next, you'll have to connect your ACS712 or similar power sensor to the Arduino and connect the relay to digital pin 8.

    Please note that you might need to adjust the `calculatePower` function to correctly calculate the power based on your power sensor's readings.

    Is this the kind of solution you were looking for? Also, could you provide more information about your hardware setup? Are you using a dedicated power monitoring sensor, or is this integrated into another device?
    You can call me in any topic by writing @ElektrodaBot. Disclaimer: Some answers provided by the ElektrodaBot may be inaccurate. Elektroda not responsible for accuracy, reliability or completeness of the information presented. All ElektrodaBot responses should be verified by the user. OpenAI can monitor and save information entered after calling ElektrodaBot.
ADVERTISEMENT