Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Bei Event ein Bild aktualisieren

    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

    Bei Event ein Bild aktualisieren

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

      @Glasfaser

      var timeout, timeout1, timeout2;
      var fs = require('fs');
      
      
      on({id: 'hm-rpc.XXX.PRESS_SHORT', change: "any"}, function (obj) {
        var value = obj.state.val;
        var oldValue = obj.oldState.val;
        timeout = setTimeout(function () {
          exec('wget --output-document /opt/iobroker/Klingelbild/alarm.jpg \'http://192.XXX.XXX.XXX:XXX/picture/1/current/\'');
         }, 1000);
        timeout1 = setTimeout(function () {
         const bild = fs.readFileSync('/opt/iobroker/Klingelbild/alarm.jpg');
      	     writeFile('vis.0','alarm.jpg', bild);
         }, 1500);
        timeout2 = setTimeout(function () {
          sendTo("telegram.1", "send", {
              text: '/opt/iobroker/Klingelbild/alarm.jpg'
          });
        }, 5000);
        // ab hier so oft wiederholen wie man es möchte
      });
      
      Glasfaser 1 Reply Last reply Reply Quote 0
      • Glasfaser
        Glasfaser @haselchen last edited by

        @haselchen

        Könntest du das noch in den " Code "setzen 😉

        1.JPG

        haselchen 1 Reply Last reply Reply Quote 0
        • haselchen
          haselchen Most Active @Glasfaser last edited by

          @Glasfaser

          var timeout, timeout1, timeout2;
          var fs = require('fs');
          
          
          on({id: 'hm-rpc.XXX.PRESS_SHORT', change: "any"}, function (obj) {
            var value = obj.state.val;
            var oldValue = obj.oldState.val;
            timeout = setTimeout(function () {
              exec('wget --output-document /opt/iobroker/Klingelbild/alarm.jpg \'http://XXXX/picture/1/current/\'');
             }, 1000);
            timeout1 = setTimeout(function () {
             const bild = fs.readFileSync('/opt/iobroker/Klingelbild/alarm.jpg');
          	     writeFile('vis.0','alarm.jpg', bild);
             }, 1500);
            timeout2 = setTimeout(function () {
              sendTo("telegram.1", "send", {
                  text: '/opt/iobroker/Klingelbild/alarm.jpg'
              });
            }, 5000);
            // ab hier so oft wiederholen wie man es möchte
          });
          
          Glasfaser 1 Reply Last reply Reply Quote 0
          • Glasfaser
            Glasfaser @haselchen last edited by Glasfaser

            @haselchen

            Habe es geändert ... teste mal bitte

            var timeout, timeout1, timeout2;
            
            var fs = require('fs');
            
            
            
            
            
            on({id: 'javascript.0.Datenpunkt.DP1', change: "any"}, function (obj) {
            
             var value = obj.state.val;
            
             var oldValue = obj.oldState.val;
            
             timeout = setTimeout(function () {
            
               exec('wget --output-document /tmp/alarm.jpg \'http://xxxxxxxxxx@192.168.178.53/streaming/channels/101/picture\'');
            
              }, 1000);
            
             timeout1 = setTimeout(function () {
            
                const bild = fs.readFileSync('/tmp/alarm.jpg');
            
                writeFile('vis.0','alarm.jpg', bild);
            
              }, 1500);
            
             timeout2 = setTimeout(function () {
            
               sendTo("telegram.1", "send", {
            
                   text: '/tmp/alarm.jpg'
            
               });
            
             }, 5000);
            
             // ab hier so oft wiederholen wie man es möchte
            
            });
            

            haselchen 1 Reply Last reply Reply Quote 0
            • haselchen
              haselchen Most Active @Glasfaser last edited by

              @Glasfaser

              Nun kommt gar kein Bild mehr.
              Container neu gestartet
              Browser refreshed
              Alles probiert 😞

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

                @haselchen

                ???
                das Skript mit dem Einzelbild funktioniert bei mir .
                Habe nur den Speicherort geändert !

                Auch kein Telegram ?

                haselchen 1 Reply Last reply Reply Quote 0
                • haselchen
                  haselchen Most Active @Glasfaser last edited by

                  @Glasfaser

                  Dein Script hat den letzten Denkanstoss gegeben 🙂
                  Ich habe die Pfade anpassen müssen da ich docker benutze.
                  Und die Timeouts. Jetzt passt es.
                  Deine Idee mit dem TMP Ordner hat die Lösung gebracht.
                  Danke!!!

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

                    @haselchen

                    Dann tausche noch die Sparlampe am Eingang gegen eine hellere Lampe … dann ist alles Perfekt 😉 😎

                    haselchen 1 Reply Last reply Reply Quote 0
                    • haselchen
                      haselchen Most Active @Glasfaser last edited by haselchen

                      @Glasfaser

                      Hahahahahaha, der war gut 🙂 🙂 🙂
                      Ist nur so als Test gedacht. Ne 5 Euro TTGO Kamera aus China. Die hat auch keine IR Leds für Nachtsicht.
                      Wenn ich weiss wie das alles so technisch funktioniert kommt da ne Dome Camera hin.

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

                        @haselchen

                        Ok …. dann Bau die Kamera im Sommer auf dein Mähroboter 😂

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        517
                        Online

                        31.9k
                        Users

                        80.1k
                        Topics

                        1.3m
                        Posts

                        blockly monitoring multimedia
                        7
                        37
                        2976
                        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