Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Visualisierung
    4. externes Bild in VIS

    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

    externes Bild in VIS

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

      @Negalein

      oder das hier ... du bist doch so ein Alexa Freak .

      Klingelscript von Chaot

      Negalein 1 Reply Last reply Reply Quote 0
      • Negalein
        Negalein Global Moderator @Glasfaser last edited by

        @Glasfaser sagte in externes Bild in VIS:

        du bist doch so ein Alexa Freak

        Ich schon, aber meine Hoheit würde mich dann zur Guillotine bringen. 😈

        1 Reply Last reply Reply Quote 0
        • Negalein
          Negalein Global Moderator @Glasfaser last edited by

          @Glasfaser sagte in externes Bild in VIS:

          Ich kann dir höchstens meins anbieten :

          Servus

          Jetzt bin ich endlich dazu gekommen es zu testen.

          Leider haut er mir für Zeile 22 einen Fehler raus.

          Exec ist im JS-Adapter erlaubt.

          javascript.0	2020-04-29 15:13:58.239	error	(594) at process._tickCallback (internal/process/next_tick.js:68:7)
          javascript.0	2020-04-29 15:13:58.239	error	(594) at promise.then (/opt/iobroker/node_modules/standard-as-callback/built/index.js:19:49)
          javascript.0	2020-04-29 15:13:58.239	error	(594) at tryCatcher (/opt/iobroker/node_modules/standard-as-callback/built/utils.js:11:23)
          javascript.0	2020-04-29 15:13:58.238	error	(594) at client.get (/opt/iobroker/node_modules/iobroker.js-controller/lib/states/statesInRedis.js:572:33)
          javascript.0	2020-04-29 15:13:58.238	error	(594) at adapter.getForeignState (/opt/iobroker/node_modules/iobroker.javascript/main.js:1055:17)
          javascript.0	2020-04-29 15:13:58.238	error	(594) at createProblemObject (/opt/iobroker/node_modules/iobroker.javascript/main.js:1464:17)
          javascript.0	2020-04-29 15:13:58.238	error	(594) at prepareScript (/opt/iobroker/node_modules/iobroker.javascript/main.js:1411:37)
          javascript.0	2020-04-29 15:13:58.238	error	(594) at compile (/opt/iobroker/node_modules/iobroker.javascript/main.js:1188:28)
          javascript.0	2020-04-29 15:13:58.238	error	(594) at Object.createScript (vm.js:277:10)
          javascript.0	2020-04-29 15:13:58.238	error	(594) at new Script (vm.js:83:7)
          javascript.0	2020-04-29 15:13:58.238	error	(594) SyntaxError: Invalid or unexpected token
          javascript.0	2020-04-29 15:13:58.237	error	(594) ^^^
          javascript.0	2020-04-29 15:13:58.237	error	(594) exec('wget --output-document /_temp/Max/Max.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi'');
          javascript.0	2020-04-29 15:13:58.237	error	at script.js.Doorbird.Doorbird_Bilder_Max:22
          javascript.0	2020-04-29 15:13:58.237	error	(594) script.js.Doorbird.Doorbird_Bilder_Max compile failed:
          

          const idklingel = ["doorbird.0.Doorbell.101.trigger"];
           
          var sperre = false;  //verhindert das doppeltes Drücken das Script stoppt
           
          var timeout1, timeout2, timeout3, timeout4, timeout5, timeout6, timeout7, timeout8, timeout9, timeout10, timeout11;
           
          var fs = require('fs');
           
           
           
           
          on({id: idklingel, change: "any"}, function (obj) {
           
           if(!sperre) {
           
             sperre = true;
           
             
           
              // Speichert das erste Bild bei Klingeln
           
             exec('wget --output-document /_temp/Max/Max.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi'');
           
             
              // Nach dem ersten Bild wird nach 2000ms das nächste Bild gespeichert
             timeout1 = setTimeout(function () {
           
               exec('wget --output-document /_temp/Max/Max2.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi''); 
           
             }, 2000);
           
             
              // Nach dem zweiten Bild wird nach 2000ms das nächste Bild gespeichert
             timeout2 = setTimeout(function () {
           
               exec('wget --output-document /_temp/Max/Max3.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi'');
           
             }, 4000);
           
            
              // Nach dem dritten Bild wird nach 2000ms das nächste Bild gespeichert
             timeout3 = setTimeout(function () {
           
               exec('wget --output-document /_temp/Max/Max4.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi'');
           
             }, 6000);
           
           
          // Telegram versenden
              timeout4 = setTimeout(function(){
            
                  sendTo('telegram.0', {text: '/_temp/Max/Max1.jpg', caption: 'Jemand klingelt an der Haustür !!!'});
            
                          //log ('__ Klingel-Bild wurde versendet __');
            
              }, 10000); 
              timeout5 = setTimeout(function(){
            
                  sendTo('telegram.0', {text: '/_temp/Max/Max2.jpg', caption: 'Jemand klingelt an der Haustür !!!'});
            
                          //log ('__ Klingel-Bild wurde versendet __');
            
              }, 11000); 
            
            
              }
                     
            
              timeout6 = setTimeout(function() {
            
                 sperre = false;
            
              }, 5000); //Zeit für Klingelsperre 1.Zeile
           
           
              // Bilder werden nach vis gespeichert
             timeout7 = setTimeout(function () {
           
                  const bild1 = fs.readFileSync('/_temp/Max/Max1.jpg');
           
                  writeFile('vis.0','/_temp/Max/Max1.jpg', bild1);
           
                  const bild2 = fs.readFileSync('/_temp/Max/Max2.jpg');
           
                  writeFile('vis.0','/_temp/Max/Max2.jpg', bild2);
           
                  const bild3 = fs.readFileSync('/_temp/Max/Max3.jpg');
           
                  writeFile('vis.0','/_temp/Max/Max3.jpg', bild3);
           
                  const bild4 = fs.readFileSync('/_temp/Max/Max4.jpg');
           
                  writeFile('vis.0','/_temp/Max/Max4.jpg', bild4);
           
             }, 20000); 
           
          });
           
          
          

          instances - ioBroker (15).png

          Hast du einen Tipp für mich?

          Und um Telegram nicht zu verwenden, reicht es Zeile 50-66 auszukommentieren, oder bis Zeile 69?

          Danke

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

            @Negalein

            Teste mal :

            nur User / Pass ändern

            const idklingel = ["doorbird.0.Doorbell.101.trigger"];
            
            var sperre = false;  //verhindert das doppeltes Drücken das Script stoppt
            
            var timeout1, timeout2, timeout3, timeout4, timeout5, timeout6, timeout7, timeout8, timeout9, timeout10, timeout11;
            
            var fs = require('fs');
            
            
            
            
            on({id: idklingel, change: "any"}, function (obj) {
            
             if(!sperre) {
            
               sperre = true;
            
               
            
                // Speichert das erste Bild bei Klingeln
            
               exec('wget --output-document /tmp/max1.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi\'');
            
               
                // Nach dem ersten Bild wird nach 2000ms das nächste Bild gespeichert
               timeout1 = setTimeout(function () {
            
                 exec('wget --output-document /tmp/max2.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi\''); 
            
               }, 2000);
            
               
                // Nach dem zweiten Bild wird nach 2000ms das nächste Bild gespeichert
               timeout2 = setTimeout(function () {
            
                 exec('wget --output-document /tmp/max3.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi\'');
            
               }, 4000);
            
              
                // Nach dem dritten Bild wird nach 2000ms das nächste Bild gespeichert
               timeout3 = setTimeout(function () {
            
                 exec('wget --output-document /tmp/max4.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi\'');
            
               }, 6000);
            
            
                // Telegram versenden
               timeout4 = setTimeout(function(){
            
                   sendTo('telegram.0', {text: '/tmp/max1.jpg', caption: 'Jemand klingelt an der Haustür !!!'});
            
                           //log ('__ Klingel-Bild wurde versendet __');
            
               }, 10000); 
               timeout5 = setTimeout(function(){
            
                   sendTo('telegram.0', {text: '/tmp/max2.jpg', caption: 'Jemand klingelt an der Haustür !!!'});
            
                           //log ('__ Klingel-Bild wurde versendet __');
            
               }, 11000); 
            
            
               }
                      
            
               timeout6 = setTimeout(function() {
            
                  sperre = false;
            
               }, 5000); //Zeit für Klingelsperre 1.Zeile
            
            
                // Bilder werden nach vis gespeichert
               timeout7 = setTimeout(function () {
            
                    const bild1 = fs.readFileSync('/tmp/max1.jpg');
            
                    writeFile('vis.0','/_temp/Max/Max1.jpg', bild1);
            
                    const bild2 = fs.readFileSync('/tmp/max2.jpg');
            
                    writeFile('vis.0','/_temp/Max/Max2.jpg', bild2);
            
                    const bild3 = fs.readFileSync('/tmp/maxt3.jpg');
            
                    writeFile('vis.0','/_temp/Max/Max3.jpg', bild3);
            
                    const bild4 = fs.readFileSync('/tmp/max4.jpg');
            
                    writeFile('vis.0','/_temp/Max/Max4.jpg', bild4);
            
               }, 20000); 
            
            });
            
            
            

            Negalein 1 Reply Last reply Reply Quote 1
            • Negalein
              Negalein Global Moderator @Glasfaser last edited by

              @Glasfaser sagte in externes Bild in VIS:

              Teste mal :

              Danke, kommen keine Fehler mehr. 🙂

              beim Klingeln speichert er die Bilder in /tmp/max1.jpg und kopiert sie dann in vis.0/_temp/Max/Max1.jpg ?
              Muss der Ordner _temp/Max/ händisch angelegt werden?

              Weißt du auch noch das wegen Telegram?

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

                @Negalein sagte in externes Bild in VIS:

                Muss der Ordner _temp/Max/ händisch angelegt werden?

                Ja ... mit dem Dateimanager 😉

                Telegram kannst du auch löschen , wenn nicht benötigt

                Negalein 1 Reply Last reply Reply Quote 1
                • Negalein
                  Negalein Global Moderator @Glasfaser last edited by

                  @Glasfaser sagte in externes Bild in VIS:

                  Telegram kannst du auch löschen , wenn nicht benötigt

                  reicht es Zeile 50-66 auszukommentieren, oder bis Zeile 69?

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

                    @Negalein

                    Eingentlich ja ... kann gerade nicht testen ... mußt du machen 🙂

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

                      @Negalein
                      Habe auch noch ein Fehler beseitigt ..

                      const idklingel = ["doorbird.0.Doorbell.101.trigger"];
                      
                      var sperre = false;  //verhindert das doppeltes Drücken das Script stoppt
                      
                      var timeout1, timeout2, timeout3, timeout4, timeout5, timeout6, timeout7, timeout8, timeout9, timeout10, timeout11;
                      
                      var fs = require('fs');
                      
                      
                      
                      
                      on({id: idklingel, change: "any"}, function (obj) {
                      
                       if(!sperre) {
                      
                         sperre = true;
                      
                         
                      
                          // Speichert das erste Bild bei Klingeln
                      
                         exec('wget --output-document /tmp/max1.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi\'');
                      
                         
                          // Nach dem ersten Bild wird nach 2000ms das nächste Bild gespeichert
                         timeout1 = setTimeout(function () {
                      
                           exec('wget --output-document /tmp/max2.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi\''); 
                      
                         }, 2000);
                      
                         
                          // Nach dem zweiten Bild wird nach 2000ms das nächste Bild gespeichert
                         timeout2 = setTimeout(function () {
                      
                           exec('wget --output-document /tmp/max3.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi\'');
                      
                         }, 4000);
                      
                        
                          // Nach dem dritten Bild wird nach 2000ms das nächste Bild gespeichert
                         timeout3 = setTimeout(function () {
                      
                           exec('wget --output-document /tmp/max4.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi\'');
                      
                         }, 6000);
                      
                          /*
                          // Telegram versenden
                         timeout4 = setTimeout(function(){
                      
                             sendTo('telegram.0', {text: '/tmp/max1.jpg', caption: 'Jemand klingelt an der Haustür !!!'});
                      
                                     //log ('__ Klingel-Bild wurde versendet __');
                      
                         }, 10000); 
                         timeout5 = setTimeout(function(){
                      
                             sendTo('telegram.0', {text: '/tmp/max2.jpg', caption: 'Jemand klingelt an der Haustür !!!'});
                      
                                     //log ('__ Klingel-Bild wurde versendet __');
                      
                         }, 11000); 
                      
                         */
                         }
                                
                      
                         timeout6 = setTimeout(function() {
                      
                            sperre = false;
                      
                         }, 5000); //Zeit für Klingelsperre 1.Zeile
                      
                      
                          // Bilder werden nach vis gespeichert
                         timeout7 = setTimeout(function () {
                      
                              const bild1 = fs.readFileSync('/tmp/max1.jpg');
                      
                              writeFile('vis.0','/_temp/Max/Max1.jpg', bild1);
                      
                              const bild2 = fs.readFileSync('/tmp/max2.jpg');
                      
                              writeFile('vis.0','/_temp/Max/Max2.jpg', bild2);
                      
                              const bild3 = fs.readFileSync('/tmp/max3.jpg');
                      
                              writeFile('vis.0','/_temp/Max/Max3.jpg', bild3);
                      
                              const bild4 = fs.readFileSync('/tmp/max4.jpg');
                      
                              writeFile('vis.0','/_temp/Max/Max4.jpg', bild4);
                      
                         }, 20000); 
                      
                      });
                      
                      
                      
                      


                      Edit :
                      das {1} kommt durch das Importieren in den Forum Editor

                      Negalein 2 Replies Last reply Reply Quote 1
                      • Negalein
                        Negalein Global Moderator @Glasfaser last edited by

                        @Glasfaser sagte in externes Bild in VIS:

                        Habe auch noch ein Fehler beseitigt ..

                        Danke, habs gleich neu angelegt.

                        1 Reply Last reply Reply Quote 0
                        • Negalein
                          Negalein Global Moderator @Glasfaser last edited by

                          @Glasfaser sagte in externes Bild in VIS:

                          const bild4 = fs.readFileSync('/tmp/max4.jpg');
                          

                          dieser Ordner muss unter files angelegt werden?

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

                            @Negalein

                            Nö ... wird alles automatisch angelegt

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

                              @Negalein

                              .... hier nur mit einem Klingelbild

                              const idklingel = ["doorbird.0.Doorbell.101.trigger"];
                              
                              var sperre = false;  //verhindert das doppeltes Drücken das Script stoppt
                              
                              var timeout1, timeout2, timeout3, timeout4, timeout5, timeout6, timeout7, timeout8, timeout9, timeout10, timeout11;
                              
                              var fs = require('fs');
                              
                              
                              on({id: idklingel, change: "any"}, function (obj) {
                              
                              
                              
                              if(!sperre) {
                              
                              
                              
                                sperre = true;
                              
                              
                                 // Speichert das erste Bild bei Klingeln
                              
                              
                              
                                exec('wget --output-document /tmp/max1.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi\'');
                              
                              
                                 /*
                                
                              
                                 // Nach dem ersten Bild wird nach 2000ms das nächste Bild gespeichert
                              
                                timeout1 = setTimeout(function () {
                              
                              
                              
                                  exec('wget --output-document /tmp/max2.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi\''); 
                              
                              
                              
                                }, 2000);
                              
                              
                              
                              
                                 // Nach dem zweiten Bild wird nach 2000ms das nächste Bild gespeichert
                              
                                timeout2 = setTimeout(function () {
                              
                              
                              
                                  exec('wget --output-document /tmp/max3.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi\'');
                              
                              
                              
                                }, 4000);
                              
                              
                               
                              
                                 // Nach dem dritten Bild wird nach 2000ms das nächste Bild gespeichert
                              
                                timeout3 = setTimeout(function () {
                              
                              
                              
                                  exec('wget --output-document /tmp/max4.jpg \'http://xxxxxx:xxxxxx@10.0.1.84/bha-api/image.cgi\'');
                              
                              
                              
                                }, 6000);
                              
                              
                                 
                              
                                 // Telegram versenden
                              
                                timeout4 = setTimeout(function(){
                              
                              
                                    sendTo('telegram.0', {text: '/tmp/max1.jpg', caption: 'Jemand klingelt an der Haustür !!!'});
                              
                              
                              
                                            //log ('__ Klingel-Bild wurde versendet __');
                              
                              
                              
                                }, 10000); 
                              
                                timeout5 = setTimeout(function(){
                              
                              
                              
                                    sendTo('telegram.0', {text: '/tmp/max2.jpg', caption: 'Jemand klingelt an der Haustür !!!'});
                              
                              
                              
                                            //log ('__ Klingel-Bild wurde versendet __');
                              
                              
                              
                                }, 11000); 
                              
                              
                              
                                */
                              
                                }
                              
                                       
                              
                              
                              
                                timeout6 = setTimeout(function() {
                              
                              
                              
                                   sperre = false;
                              
                              
                              
                                }, 5000); //Zeit für Klingelsperre 1.Zeile
                              
                              
                              
                              
                              
                                 // Bilder werden nach vis gespeichert
                              
                                timeout7 = setTimeout(function () {
                              
                              
                              
                                     const bild1 = fs.readFileSync('/tmp/max1.jpg');
                              
                              
                                     writeFile('vis.0','/_temp/Max/Max1.jpg', bild1);
                              
                                  /*
                                     const bild2 = fs.readFileSync('/tmp/max2.jpg');
                              
                                 
                                     writeFile('vis.0','/_temp/Max/Max2.jpg', bild2);
                              
                              
                                     const bild3 = fs.readFileSync('/tmp/max3.jpg');
                              
                              
                                     writeFile('vis.0','/_temp/Max/Max3.jpg', bild3);
                              
                              
                                     const bild4 = fs.readFileSync('/tmp/max4.jpg');
                              
                              
                                     writeFile('vis.0','/_temp/Max/Max4.jpg', bild4);
                              
                                 */
                              
                                }, 20000); 
                              
                              
                              
                              });
                              

                              Negalein 1 Reply Last reply Reply Quote 0
                              • Negalein
                                Negalein Global Moderator @Glasfaser last edited by

                                @Glasfaser sagte in externes Bild in VIS:

                                hier nur mit einem Klingelbild

                                Danke

                                Muss im anderen Thread nochmal schauen.
                                Ideal wäre es, wenn auch die letzten 3 oder 4 gespeichert bleiben um sie in VIS anzuzeigen.

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

                                  @Negalein sagte in externes Bild in VIS:

                                  Ideal wäre es, wenn auch die letzten 3 oder 4 gespeichert

                                  Das geht mit dem Script so nicht ,
                                  da der Speichername vom Bild nicht Variabel/Zeitstempel gespeichert wird.

                                  Negalein 1 Reply Last reply Reply Quote 0
                                  • Negalein
                                    Negalein Global Moderator @Glasfaser last edited by

                                    @Glasfaser sagte in externes Bild in VIS:

                                    Das geht mit dem Script so nicht ,
                                    da der Speichername vom Bild nicht Variabel/Zeitstempel gespeichert wird.

                                    Ja, leider.

                                    Vielleicht finde ich im anderen Thread noch eine Lösung.

                                    1 Reply Last reply Reply Quote 0
                                    • Basti97
                                      Basti97 Most Active last edited by

                                      Ich weiß nicht ob es hier her passt. Ich habe meine Kamerabild auch per Link in meine vis eingefügt. Nun habe ich das Problem das, dass Bild auf Firefox (Win10) funktioniert und angezeigt wird aber auf dem Smartphone (android) per Browser nicht.
                                      Die Dateiendung des Links ist .cgi
                                      Der vis Baustein nennt sich Basic Image.
                                      Weiß jemand eine Lösung.
                                      DAnke im vorraus.

                                      R 1 Reply Last reply Reply Quote 0
                                      • R
                                        RandyAndy @Basti97 last edited by RandyAndy

                                        @Basti97

                                        das mit Kamerabildern ist so eine Sache und da kommt schnell auch die basic authentication hinzu das heutige browser nicht mehr wirklich unterstützen.
                                        Ich habe mich da ewig mit gespielt und am Ende habe ich es so gemacht das ich mir in regelmäßigen Abständen ein File auf einer RAM-Disk abspeichere. Diese Datei rufe ich dann über einen Web-Server auf den ich auf dem RaspberryPi installiert habe (Anleitung gibt es zu Hauf im Internet).
                                        Das funktioniert seit ca. 1 Jahr recht stabil und am Wichtigsten ist ich schreibe keine Daten auf die SD-Karte.

                                        Andreas

                                        Basti97 1 Reply Last reply Reply Quote 0
                                        • Basti97
                                          Basti97 Most Active @RandyAndy last edited by

                                          @RandyAndy Danke für deinen Tipp ich probiere es mal. Das komische ist ja das Firefox es unterstützt aber die Mobilen Browser nicht mehr. Wenn gar nichts gegangen wäre hätte ich es ja verstanden aber so.

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

                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          755
                                          Online

                                          31.9k
                                          Users

                                          80.2k
                                          Topics

                                          1.3m
                                          Posts

                                          camera vis
                                          4
                                          23
                                          1829
                                          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