Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. LAN-Gateway (PI) neustarten wenn DUTY-Cycle -1

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.7k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    2.2k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    16
    1
    3.2k

LAN-Gateway (PI) neustarten wenn DUTY-Cycle -1

Scheduled Pinned Locked Moved Skripten / Logik
4 Posts 3 Posters 562 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • sissiwupS Offline
    sissiwupS Offline
    sissiwup
    wrote on last edited by
    #1

    Hallo,

    im rega-Adapter DUTY-Cycle aktivieren.

    Variable mit Duty-Cycle suchen: hm-rega.0.OEQ0608058.0.DUTY_CYCLE

    sshpass installieren oder keys erstellen (apt-get install sshpass)

    Gateway-Adresse suchen: 192.168.1.10 (meine)

    Es wird 120 Sekunden gewartet, wenn dann immer noch der DUTY-Cycle auf -1 ist, wird das Gateway neu gestartet.

    Das wird 30mal wiederholt, solange bis der DUTY wieder auf >=0 ist.

    PS: Exec muss im Java-Script Adapter aktiviert werden!

    on({id: 'hm-rega.0.OEQ0608058.0.DUTY_CYCLE', change: "ne"}, function (obj) {
      var value = obj.state.val;
      var oldValue = obj.oldState.val;
      // console.log('PI-LAN-GATEWAY:'+value);
      if (value == "-1") {
        console.log('PI-LAN-GATEWAY-ERROR:'+value);
        (function theLoop (i) {
                setTimeout(function () {
                    var val = getState('hm-rega.0.OEQ0608058.0.DUTY_CYCLE').val;
                    if (val=="-1") {
                      console.log('PI-LAN-GATEWAY-Restart('+i+'):'+val);
                      exec('sshpass -p passort ssh root@192.168.1.10 reboot now');
                    } else {
                        console.log('PI-LAN-GATEWAY-Erfolg('+i+'):'+val);
                        i = 0;
                    }
                    i--;
                    if (i>0) {          // If i > 0, keep going
                        theLoop(i);       // Call the loop again, and pass it the current value of i
                    }
                }, 120000);
        })(30);
      }
    });
    

    MfG

    Sissi

    –-----------------------------------------

    1 CCU3 1 CCU2-Gateway 1 LanGateway 1 Pi-Gateway 1 I7 für ioBroker/MySQL


    1 Reply Last reply
    0
    • F Offline
      F Offline
      Flauschi
      wrote on last edited by
      #2

      sollte man nicht lieber daran arbeiten, die Ursache für einen hohen DutyCycle auszumerzen?

      Eine riesige Installation mit sogar Lan Gateways braucht keinen DutyCycle über 50 zu haben, wenn man ordentlich programmiert.

      Sent from my iPhone using Tapatalk

      1 Reply Last reply
      0
      • HomoranH Do not disturb
        HomoranH Do not disturb
        Homoran
        Global Moderator Administrators
        wrote on last edited by
        #3

        Es geht um einen negativen DC wo immer der herkommt.

        Gruß Rainer

        kein Support per PN! - Fragen im Forum stellen - es gibt fast nichts, was nicht auch für andere interessant ist.

        Benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat.

        der Installationsfixer: curl -fsL https://iobroker.net/fix.sh | bash -

        1 Reply Last reply
        0
        • sissiwupS Offline
          sissiwupS Offline
          sissiwup
          wrote on last edited by
          #4

          @Homoran:

          Es geht um einen negativen DC wo immer der herkommt.

          Gruß Rainer `

          Genau, es geht nicht um zu hohen DUTY-Cycle.

          Wenn der Duty-Cycle -1 ist, bedeutet es dass das LAN-Gateway nicht mehr erreicht wird.

          Das Gateway ist normalerweise schon noch per ping etc. erreichbar, nur halt von der CCU nicht.

          In diesen Fall kann man sich beheben indem man das Gateway neu startet.

          Und das macht das Script automatisiert. Es kann natürlich durch jedes beliebige Ereignis ausgelöst werden

          und dann irgend etwas zeitversetzt starten.

          MfG

          Sissi

          –-----------------------------------------

          1 CCU3 1 CCU2-Gateway 1 LanGateway 1 Pi-Gateway 1 I7 für ioBroker/MySQL


          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          Support us

          ioBroker
          Community Adapters
          Donate

          789

          Online

          32.4k

          Users

          81.5k

          Topics

          1.3m

          Posts
          Community
          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
          ioBroker Community 2014-2025
          logo
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Home
          • Recent
          • Tags
          • Unread 0
          • Categories
          • Unreplied
          • Popular
          • GitHub
          • Docu
          • Hilfe