logo elektroda
logo elektroda
X
logo elektroda

OpenBeken on LN882H pulsetime command or how to make relay return after time

silvestro_gatto 1425 5
ADVERTISEMENT
  • #1 20996836
    silvestro_gatto
    Level 7  

    I would like to use one of these Mini Smart Switch running the latest OpenLN882H to command remotely a step by step relay,
    https://www.elektroda.com/rtvforum/topic4014743.html

    Is there a way I can configure the module to close relay for 1 second when I click the Toggle Bar in the web interface?

    Tasmota has "PULSETIME 10" command that does the job in the way I need.

    PULSETIME command seems not to work with OBK

    Once again looking forward to your help, Thanks!
  • ADVERTISEMENT
  • #2 20997023
    p.kaczmarek2
    Moderator Smart Home
    We don't have PULSETIME yet but you can do it with script:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    Something like:
    
    // This aliased command will turn off relay on CH1 after 10 seconds
    // addRepeatingEvent	[IntervalSeconds][RepeatsOr-1][CommandToRun]
    alias turn_off_after_time addRepeatingEvent 10 1 setChannel 1 0
    // this will run the turn off command every time that CH1 becomes 1
    addChangeHandler Channel1 == 1 turn_off_after_time 
    

    but if your platform does not have LittleFS, you may put that in a startup command and convert it to a single line command.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20997047
    silvestro_gatto
    Level 7  
    Thank you for your prompt reply, but it seems that my platform (OpenLN882H) does not support LittleFS.
    Unfortunately I do not know how to put those lines in a startup command and convert it to a single line command.
    Is there any document I can read to find the steps to convert it?
    Many thanks!
  • ADVERTISEMENT
  • #4 20997181
    p.kaczmarek2
    Moderator Smart Home
    I would have try that line in the "short startup command" and reboot:
    
    addChangeHandler Channel1 == 1 addRepeatingEvent 10 1 setChannel 1 0
    
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20998733
    silvestro_gatto
    Level 7  

    Thank you p.kaczmarek2,
    I added the line in the "short startup command" and it works like a charm!

    In my case (Elivco Mini Smart Switch 16A module with LN882H chip) the correct code is:

    addChangeHandler Channel0 == 1 addRepeatingEvent 10 1 setChannel 0 0

  • #6 21320418
    Tilator
    Level 10  
    Hello. Old topic, but important.

    There seems to be one big difference between the above OpenBeken command and Tasmota Pulsetime.

    Tasmota resets timer, but OpenBeken does not. So - if Tasmota timer is set to turn relay off after 10 seconds from turning it on but relay on command is set again after 5 seconds, relay is set off 10 seconds after the latter command. Repeating relay on command without letting timer become 0 keeps the relay on as long as you keep repeating relay on command..

    In OpenBeken relay turns off after 10 seconds even though relay on command is repeated.

    Is there any trick to add time to an already started counter in OpenBeken?
ADVERTISEMENT