Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. Sauberer Shutdown bei Stromausfall

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Sauberer Shutdown bei Stromausfall

    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      Langer last edited by

      Hallo zusammen,

      Situation:

      1 x QNAP-NAS
      1 x ioBroker Master auf pi 4
      1 x ioBroker Slave auf pi 4

      Am slave ist die USV angeschlossen, per USB.
      NUT - Adapter installiert und es werden Datenpunkte geschrieben.

      Soll:
      Bei Stromausfall soll bei einem BatterieStand von 50% in folgender Reihenfolge
      NAS, Master und zum Schluß der Slave sauber runtergefahren werden.

      Ich habe dieses Script erstellt:

      let ssh = require('node-ssh');
      
      on({id:'nut.0.battery.charge'}, function(obj) {
      
          if (obj.state.val < 50) {
              ssh.connect({   
                  host: '192.168.xxx.xx',
                  username: 'yyyyyyy',
                  password: 'zzzzzzzzz'}).then(()=> {
                  ssh.execCommand("nohup shutdown -h 1");
              });
              //hier ist die USV angeschlossen
              ssh.connect({   
                  host: '192.168.xxx.xx',
                  username: 'yyyyyyyy',
                  password: 'zzzzzzz'}).then(()=> {
                  ssh.execCommand("nohup shutdown -h 1");
              });
          };
      });
      

      Meine Frage:
      Ist das richtig und wie funktioniert das mit der NAS?

      Mfg
      Wastl

      arteck 1 Reply Last reply Reply Quote 0
      • arteck
        arteck Developer Most Active @Langer last edited by

        @langer die qnap kannst du direkt in dessen Einstellungen konfigurieren.. auf der qnap oberfläche

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        Support us

        ioBroker
        Community Adapters
        Donate

        783
        Online

        31.8k
        Users

        80.0k
        Topics

        1.3m
        Posts

        javascript
        2
        2
        257
        Loading More Posts
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes
        Reply
        • Reply as topic
        Log in to reply
        Community
        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
        The ioBroker Community 2014-2023
        logo