Script to auto turn-on a switch if turned off

  • Hi all,

    my router is connected to a Shelly (4PM) and would like to have the ability to reboot it when I’m not at home.

    Moreover, if someone accidentally turn the Shelly switch off I want it to turn it on again after a fixed time, in order to not be cut out from my house when I’m away.

    When my router is off all network devices cannot communicate, so the automation has to be stored and executed on the Shelly itself.

    I think it would be also wise to implement a “safe rule” to avoid to turn the switch on again and again in case of some kind of malfunction (eg. a counter that stops the "auto turn-on" loop if triggered more than n times in the last 5 minutes).

    Is this doable with a Shelly's script?

    • Hilfreichste Antwort

    It´s easy and implemented:

    Call the Shelly via WebUI. Open setting field "Timer".

    Activate the checkbox "When off - Turn on after x seconds".

    Save it.

    You don´t need any more - this works without any internet or network connection.

    If you want to prevent the input from toggling many times (which action could do that? physical or over the network?) maybe use a momentary switch, the button type "activation switch" and "reverse inputs", so toggling has no further effect than prolonging the offtime a few seconds.

    2 Mal editiert, zuletzt von rallyecom (13. Februar 2022 um 18:56)

  • asp__ 13. Februar 2022 um 20:13

    Hat einen Beitrag als hilfreichste Antwort ausgewählt.