Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Adapter zur bestimmten Zeit aus oder anmachen

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Adapter zur bestimmten Zeit aus oder anmachen

    This topic has been deleted. Only users with topic management privileges can see it.
    • Homer.J.
      Homer.J. @sigi234 last edited by Homer.J.

      Probier es mal hiermit.


      function stopAdapter() {
      var obj = getObject('system.adapter.Adapter.0');
      obj.common.enabled = false;
      setObject('system.adapter.Adapter.0', obj);
      }
      function startAdapter() {
      var obj = getObject('system.adapter.Adapter.0');
      obj.common.enabled = true;
      setObject('system.adapter.Adapter.0', obj);
      }
      schedule("0 0 * * *", function () { stopAdapter()});
      schedule("0 0 * * *", function () { startAdapter()});

      1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @robudus last edited by

        @robudus sagte:

        Dazu muss ich den Adapter gegen 14 Uhr starten und gegen 16 Uhr kann er auch wieder aus.

        Vorschlag:

        const idStau = 'system.adapter.roadtraffic.0';
        
        schedule('0 14 * * 1-5', function() {
           extendObject(idStau, {common: {enabled: true}});
        });
        
        schedule('0 16 * * 1-5', function() {
           extendObject(idStau, {common: {enabled: false}});
        });
        
        1 Reply Last reply Reply Quote 0
        • R
          robudus last edited by

          super. Teste ich heute Abend.

          Thx

          1 Reply Last reply Reply Quote 0
          • R
            robudus last edited by

            Mit einen Blocky Exec und sudo iobroker stop "AdapterName" sollte es auch funktionieren :-). Drumrum ein Cron und gut ist.
            Natürlich ist Javascript da schöner aber sicher nicht einfacher 🙂 vor allem wenn man nur Gelegentlich was damit erstellt.

            L 1 Reply Last reply Reply Quote 0
            • L
              loverz @robudus last edited by loverz

              @robudus gerade probiert:
              b21a5109-263a-4142-87ad-b6f20a228229-image.png

              funktioniert nicht, gibt aber auch kein Fehler aus.
              EXEC erlauben ist in Javascript Instanz aktiv.

              Über die Konsole geht der Befehl.

              OK, scheint an der Berechtigung zu liegen, so geht der Befehl:
              c888bd70-a636-448d-9514-afeb1a564e84-image.png

              Glasfaser dslraser 2 Replies Last reply Reply Quote 0
              • Glasfaser
                Glasfaser @loverz last edited by Glasfaser

                @loverz

                kein sudo vor ioBroker Befehle !

                L 1 Reply Last reply Reply Quote 1
                • L
                  loverz @Glasfaser last edited by

                  @glasfaser danke, habs bemerkt, bin noch immer newbe 😂

                  Glasfaser 1 Reply Last reply Reply Quote 0
                  • Glasfaser
                    Glasfaser @loverz last edited by

                    @loverz
                    Hier zum Lesen :

                    https://github.com/ioBroker/ioBroker/wiki/Console-commands#iobroker-stop-adapternameinstance

                    1 Reply Last reply Reply Quote 0
                    • dslraser
                      dslraser Forum Testing Most Active @loverz last edited by dslraser

                      @loverz
                      Blockly Beispiel zum Instanz start/stop. (nur als Beispiel ohne cron)

                      https://forum.iobroker.net/post/608712

                      L 1 Reply Last reply Reply Quote 0
                      • L
                        loverz @dslraser last edited by loverz

                        @dslraser danke für die Info.
                        Das mit diesen Javascript Funktionen ist für mich Neuland, ich denke, dass ich daher bei dem einfachen EXEC-Befehl bleiben muss 🐶
                        Funktioniert ja auch.

                        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

                        374
                        Online

                        32.0k
                        Users

                        80.4k
                        Topics

                        1.3m
                        Posts

                        7
                        14
                        1169
                        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