logo elektroda
logo elektroda
X
logo elektroda

[BK7231N][BL0937] Zunepluse 16A Smart Plug OpenBK7231N_1.18.143 Power Data Scripting for Auto-Off

OP741 99 3
ADVERTISEMENT
  • #1 21620951
    OP741
    Level 2  
    I have Zunepluse 16A Smart Plug [BK7231N][BL0937] running OpenBK7231N_1.18.143.rbl,
    i need to have this smart plug detect low load like 5w and then turn off. but i can't figure out how to get power data from MCU in script i have tried every article without success.
    [BK7231N][BL0937] Zunepluse 16A Smart Plug OpenBK7231N_1.18.143 Power Data Scripting for Auto-Off


    there every less information available about this on internet. please someone help
    AI: is the power data (like current wattage) visible anywhere in the openbk7231n web interface, mqtt, or logs for your plug?
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic ServerPower/power/get
    Info:MQTT:Publishing val 0.189 to ServerPower/current/get retain=0
    Info:MQTT:Publishing val 45.43 to ServerPower/power_apparent/get retain=0
    Info:MQTT:Publishing val 526562.187 to ServerPower/energycounter/get retain=0
  • ADVERTISEMENT
  • #2 21621253
    Drakarah
    Level 2  
    
    alias checkBelowThreshold if $power<5 then SetChannel 0 0
    addRepeatingEvent 1 -1 checkBelowThreshold
    


    This will do a check every second (1) indefinitely (-1). If the power is below 5w, then it will turn channel 0 off (if your relay is on channel 1 then it would become SetChannel 1 0)

    ($power is one of the available constants you can use https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/constants.md)
  • ADVERTISEMENT
  • #3 21621473
    p.kaczmarek2
    Moderator Smart Home
    You can also try using Berry scripting: https://www.elektroda.com/rtvforum/topic4117238.html
    Helpful post? Buy me a coffee.
  • #4 21621525
    OP741
    Level 2  
    >>21621253
    Sir you are a godsend. Many thanks. This is working perfectly

    Can you please also tell me how to remove this rule if needed.
    I mean to delete alias or list alias.
ADVERTISEMENT