Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. rasbperry PI automatisch hoch und runterfahren?

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    rasbperry PI automatisch hoch und runterfahren?

    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      saeft_2003 Most Active last edited by

      Hallo,

      ich habe einen rasbperry PI (hifiberry mit volumio) den ich gerne automatisch über den iobroker hoch und herunterfahren möchte.

      Hintergrund ist um Stromkosten zu sparen und die Lebenszeit der SD-Karte zu verlängern.

      Wie genau könnte ich das machen?

      E 1 Reply Last reply Reply Quote 0
      • S
        saeft_2003 Most Active last edited by

        ich habe es jetzt mit diesem skript probiert. Node-ssh habe ich in der javescript instanz hinzugefügt.

        
        
        on({id:'meine-datenpunkte.0.volumio.shutdown', change: 'any'}, function() {
        
        let ssh = new node_ssh();
        
        ssh.connect({ host: '192.168.178.59',
        
                               username: 'volumio',
        
                               password: 'xxxxxxxx'}).then(()=> {
        
                     ssh.execCommand("nohup shutdown -h 1");
        
        })
        
        }); 
        
         
        
        

        leider bekomme ich folgende Fehlermeldungen im log, hat jemand eine Idee an was das liegen könnte?

        
        
        javascript.0	2020-03-31 20:48:13.943	error	(9562) at processImmediate (timers.js:658:5)
        
        javascript.0	2020-03-31 20:48:13.942	error	(9562) at tryOnImmediate (timers.js:676:5)
        
        javascript.0	2020-03-31 20:48:13.942	error	(9562) at runCallback (timers.js:705:18)
        
        javascript.0	2020-03-31 20:48:13.942	error	(9562) at Immediate.setImmediate (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:4848:37)
        
        javascript.0	2020-03-31 20:48:13.942	error	(9562) at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:439:25)
        
        javascript.0	2020-03-31 20:48:13.941	error	(9562) at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1101:38)
        
        javascript.0	2020-03-31 20:48:13.941	error	(9562) at Object.<anonymous> (script.js.funktioniert.volumio_shutdown:2:11)
        
        javascript.0	2020-03-31 20:48:13.940	error	(9562) Error in callback: ReferenceError: node_ssh is not defined
        
        
        E 1 Reply Last reply Reply Quote 0
        • E
          el_malto @saeft_2003 last edited by

          @saeft_2003

          node_ssh = require('node-ssh');
          ssh = new node_ssh();
          ssh.connect({
            host: '192.168.xxx.xx',
            username: 'name',
            password: 'password'
          }).then(() => {
            ssh.execCommand("<command>");
          })
          

          Das Skript geht so bei mir. Musst natürlich mit deinen Werten anpassen.

          1 Reply Last reply Reply Quote 0
          • E
            el_malto @saeft_2003 last edited by el_malto

            @saeft_2003 Hochfahren könntest du den mit WOL.
            wake_on_lan in der Javaskript Instanz hinzufügen.

            var wol = require('wake_on_lan');
            var MAC = "xx:xx:xx:xx:xx:xx";
            
            wol.wake(MAC);
            

            Hier natürlich deine MAC-Adresse vom Pi einfügen. Keine Ahnung ob man beim Pi noch irgendwas installieren oder einstellen muss um den per WOL aufwecken zu können. Geht glaube ich auch nur mit LAN und nicht mit WLAN. Ich hab es so mit meinem PC.

            S 1 Reply Last reply Reply Quote 0
            • S
              saeft_2003 Most Active @el_malto last edited by

              @el_malto

              Vielen dank für die info ich werde es testen

              E 1 Reply Last reply Reply Quote 0
              • E
                el_malto @saeft_2003 last edited by

                @saeft_2003
                Vielleicht erstmal nur die einzelnen Skript Schnipzel testen. Dann weißt du ob die wirklich funktionieren. Dann kannst die später in deinen Skript einfügen und weißt dann wenn was nicht funktioniert, dass es daran nicht liegt.

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

                Support us

                ioBroker
                Community Adapters
                Donate
                FAQ Cloud / IOT
                HowTo: Node.js-Update
                HowTo: Backup/Restore
                Downloads
                BLOG

                877
                Online

                32.0k
                Users

                80.5k
                Topics

                1.3m
                Posts

                raspberry pi
                2
                6
                418
                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