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 ?
(2) I do not have a third relay available in HA, there is only a field in 'Configuration'.
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
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 ?
(2) I do not have a third relay available in HA, there is only a field in 'Configuration'.
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