logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

Automatic switching off of relays in OBK autoexec - how do I separate the channels?

grzgol 249 0
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 21870443
    grzgol
    Level 12  
    Posts: 32
    Rate: 6
    Good morning!

    I am trying to do an automatic switching off of the lights after a set time directly in a WiFi switch with OBK uploaded.
    My switch is with 3 relays. Such as here: https://www.elektroda.com/rtvforum/topic4026798.html.
    I am using the description in this thread. https://www.elektroda.pl/rtvforum/topic4032982.html#20941803

    I first copied autoexec.bat 'on the fly' as in the thread. Something worked there, but obviously not as needed.

    After analysing (a bit too late) this autoexec, I came to the conclusion that the channels used under variables in the script in autoxec
    overlap with the channels used to control the relays.

    So I made a modification to make the script work on :
    channel 1 - relay (was: Channel 1 - relay)
    channel 4 - current timer value (was: Channel 2 - current countdown value)
    channel 5 - timer start setting (was: Channel 3 - constant time for countdown)

    and, of course, the applied script changes.
    Now it works OK.
    Channel 1 shuts down automatically according to the set time, during this time channels 2 and 3 can be switched on/off freely.
    The entire modified autoxec.bat attached.

    But ...
    (1) On the interface it keeps displaying me the value 'channel2', where the relay is,
    by entering '0' or '1' and 'SET' I can switch relay 2 on and off (Toggle2 button also works fine)
    Why doesn't this disappear, even though in autoxec it is no longer there ?

    OBK web UI screenshot with three OFF switches and timer sections for Channel 2 and Channel 4

    (2) I do not have a third relay available in HA, there is only a field in 'Configuration'.
    Home Assistant screenshot: OpenBK7231N device with switches 1 and 2 and a “Configuration” card showing values 3 and 0

    Re-uploading the OBK did not restore the desired state.
    How to fix it ?

    (3) Is it possible to publish to HA the value of 'channel4', i.e. the current value counted down by the timer ?

    Greetings
    Grzegorz
    Attachments:
    • autoexec_bat.txt (1.27 KB) You must be logged in to download this attachment.
  • ADVERTISEMENT
ADVERTISEMENT