logo elektroda
logo elektroda
X
logo elektroda

OpenBeken logic configuration questions after flashing for beginners

proks777 60 2
ADVERTISEMENT
  • #1 21890073
    proks777
    Level 2  
    I've flashed OpenBeken >>21888469 and am now trying to configure its logic. Along the way, I've encountered many questions I can't find answers to. I hope this thread will help me and other newbies better understand OpenBeken.

    I'm currently trying to integrate two functions:
    addEventHandler OnHold and addRepeatingEventID.

    When adding addRepeatingEventID to the file, the addEventHandler OnHold function no longer works as expected; it triggers addRepeatingEventID!
    I want the device to remain active when I long-press the button, rather than going to sleep! How can this be accomplished?

    Here's an example of my file.
    startDriver battery
    startDriver CHT83XX
    Battery_Setup 2200 3000 1.92 2400 4096
    addEventHandler OnHold 8 stopAllscripts
    addRepeatingEventID 60 1 777 DeepSleep 300
    waitFor WiFiState 4
    waitFor MQTTState 1
    cancelRepeatingEvent 777
    delay_s 2
    publishChannels
    delay_s 4
    PinDeepSleep 60
  • ADVERTISEMENT
  • Helpful post
    #2 21890077
    divadiow
    Level 38  
    not really sure but are you trying to stop scripts and cancel the repeating event, so the line should be

    Code: Text
    Log in, to see the code

    ?
  • #3 21890088
    proks777
    Level 2  
    >>21890077
    Yes! Excellent! I've been struggling with this for two days.)) Thank you so much!

    Added after 11 [minutes]:

    Is there a way to switch MQTT publishing to manual mode?
    I'm currently sending data—temperature, humidity, battery in volts, and percentage! And I don't like that the data can be published multiple times during a single device startup!
    If I enable Flag 37 and Flag 51, the first data transmission happens too quickly, and I see 0% battery charge in Home Assistant.
    As I understand it, this is because the Driver battery initially displays a low voltage of ~700 mV and only after a couple of seconds displays a normal voltage of 2.7 V.
    When the device is booted, it constantly publishes data to MQTT. Is it possible to disable this and publish only once per session?
ADVERTISEMENT