logo elektroda
logo elektroda
X
logo elektroda

OpenBK Socket: Set Last Known State or Always ON After Power Break

vitya123 447 6
ADVERTISEMENT
  • #1 21352231
    vitya123
    Level 6  
    Dear All,
    I just converted a WL2H based socket to OpenBK. All features work great. I only have last thing to set up on it: I need to make sure that after a power break, it should switch to the old state. If not possible, then the next best solution for my application is to always switch on at boot. How do I go about this?
    I think the "start with ON" is easier to solve, just a line in autoexec.bat (although I'm not sure yet how) But how can I make sure it follows the last state?
    Thanks for any pointers!
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #3 21352274
    vitya123
    Level 6  
    Awesome, thanks - I feel ashamed that I didn't see that....
  • #4 21514931
    kantora98
    Level 4  
    >>21352243

    Given the situation when 2 channels are used and configuration of pins as shown below, which channel should I set to -1 for the relay to remember its last state after power restored?

    - BL0937 VI on P6
    - BL0937 ELE on P7
    - WiFi LED on P8
    - Button (channel 1) on P10
    - BL0937 SEL on P24
    - Relay (channel 1) on P26

    Screenshot of a configuration interface for various pins of an electronic circuit.
  • ADVERTISEMENT
  • #5 21515225
    p.kaczmarek2
    Moderator Smart Home
    You have a menu for that:
    Screenshot of the BK7231T_LSPA9_BL0937 module pin start settings.
    You don't set channel to -1, you set start value to -1.
    Helpful post? Buy me a coffee.
  • #6 21517203
    kantora98
    Level 4  
    >>21515225 but relay in my config is on channel 1.
  • ADVERTISEMENT
  • #7 21517434
    p.kaczmarek2
    Moderator Smart Home
    Well, if your relay is on channel 1, then you want to retain channel 1 value, right? The UI should update itself to contain channel 1, it checks which channels are used. And if you don't want to use UI, you can always use command SetStartValue - https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
    Helpful post? Buy me a coffee.

Topic summary

A WL2H-based socket converted to OpenBK firmware requires configuration to restore its last known relay state after a power outage or alternatively to always start in the ON state. The OpenBK interface provides a startup menu option to set the relay's start value, allowing it to remember the last state by setting the start value to -1 for the relevant channel. For multi-channel setups, the start value must be assigned per channel rather than setting the channel number itself to -1. The relay channel in question (e.g., channel 1) should have its start value set to -1 to enable state retention after power restoration. This can be configured via the UI or by using the command `SetStartValue` as documented in the OpenBK GitHub repository.
Summary generated by the language model.
ADVERTISEMENT