Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Visualisierung
    4. Bild unter vis.0 aktualisiert nicht

    NEWS

    • Amazon Alexa - ioBroker Skill läuft aus ?

    • Monatsrückblick – September 2025

    • Neues Video "KI im Smart Home" - ioBroker plus n8n

    Bild unter vis.0 aktualisiert nicht

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

      @coyote
      In meiner Vis läuft immer die Live Cam.
      Bei Alarm schaltet die Visu auf Kamera View um.

      Wenn Alarmanlage ist ein und ein Fenster / Tür Kontakt wird aktiviert,
      wird vom IO / Blockly das MotionEye Live Bild geholt und dierkt per E-Mail Adapter versandt.

      Zwischenspeichern des Bildes benötige ich nicht.
      So als Anregung das es auch anders geht.

      MotionEye_100220.jpg

      coyote 1 Reply Last reply Reply Quote 0
      • coyote
        coyote Most Active @Ralla66 last edited by

        @Ralla66 achso ok, darum ging es mir ja nicht, dass mache ich über telegram und in der Visu läuft auch der Stream. Ich will ja zb beim klingeln oder Posteinwurf den letzten Snapshot in der Visu anzeigen, wenn ich auf ein Icon klicke. Aber funktioniert ja jetzt.

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

          @coyote

          ehrlich gesagt komm ich nicht mehr ganz mit. was genau hast du jetzt getan damit es wieder geht?

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

            @saeft_2003

            @Glasfaser sagte in [Frage BLOCKLY ] Klingel Bild per Telegram versenden / Snapshot von Cam per Telegram versenden:

            @Knallochse

            Ich habe das hier so bei mir angepasst (Vorlage von Chaot) :

            Es werde 4 Screenshot´s erstellt , per Telegramm versendet und in vis.0/klingelbild zur weiteren Verwendung hinterlegt .

            Datenpunkt in const idklingel und die vier URL anpassen .

            const idklingel = ["hm-rpc.2.00145709AED72D.8.PRESS_SHORT", "hm-rpc.2.00145709AED72D.8.PRESS_LONG", "ID5", "ID4"];
            
            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/haustuer1.jpg \'http://user:passwort@192.168.178.53/streaming/channels/101/picture\'');
            
               
                // Nach dem ersten Bild wird nach 2000ms das nächste Bild gespeichert
               timeout1 = setTimeout(function () {
            
                 exec('wget --output-document /tmp/haustuer2.jpg \'http://user:passwort@192.168.178.53/streaming/channels/101/picture\''); 
            
               }, 2000);
            
               
                // Nach dem zweiten Bild wird nach 2000ms das nächste Bild gespeichert
               timeout2 = setTimeout(function () {
            
                 exec('wget --output-document /tmp/haustuer3.jpg \'http://user:passwort@192.168.178.53/streaming/channels/101/picture\'');
            
               }, 4000);
            
              
                // Nach dem dritten Bild wird nach 2000ms das nächste Bild gespeichert
               timeout3 = setTimeout(function () {
            
                 exec('wget --output-document /tmp/haustuer4.jpg \'http://user:passwort@192.168.178.53/streaming/channels/101/picture\'');
            
               }, 6000);
            
            
                // Telegram versenden
               timeout4 = setTimeout(function(){
            
                   sendTo('telegram.0', {text: '/tmp/haustuer1.jpg', caption: 'Jemand klingelt an der Haustür !!!'});
            
                           //log ('__ Klingel-Bild wurde versendet __');
            
               }, 8000); 
               timeout5 = setTimeout(function(){
            
                   sendTo('telegram.0', {text: '/tmp/haustuer2.jpg', caption: 'Jemand klingelt an der Haustür !!!'});
            
                           //log ('__ Klingel-Bild wurde versendet __');
            
               }, 9000); 
            
            
               }
                      
            
               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/haustuer1.jpg');
            
                    writeFile('vis.0','/klingelbild/haustuer1.jpg', bild1);
            
                    const bild2 = fs.readFileSync('/tmp/haustuer2.jpg');
            
                    writeFile('vis.0','/klingelbild/haustuer2.jpg', bild2);
            
                    const bild3 = fs.readFileSync('/tmp/haustuer3.jpg');
            
                    writeFile('vis.0','/klingelbild/haustuer3.jpg', bild3);
            
                    const bild4 = fs.readFileSync('/tmp/haustuer4.jpg');
            
                    writeFile('vis.0','/klingelbild/haustuer4.jpg', bild4);
            
               }, 20000); 
            
            });
            
            
            
            

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

              @saeft_2003 habe das Script aus dem Link von Glasfaser benutzt, damit geht es. Kann ich morgen Mal hochladen, habe es für mich soweit gekürzt, da ich nur ein Bild benötige.

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

                @coyote

                und du kannst jetzt das bild im vis datei manager direkt auswählen? Ja wäre nett wenn du das machst. Könnte man das auch in blockly nachbauen? weil da kenn ich mich ein wenig aus, direkt mit js leider nicht wirklich...

                1 Reply Last reply Reply Quote 0
                • apollon77
                  apollon77 @coyote last edited by

                  @coyote Bitte liess die Erklärungen im js.controller 2.1 Thread .. da steht alles genau drin 🙂 und da ist auch ein Thread verlinkt mit weiteren Details und Skripten.

                  Ein kopieren in das files/vis.0 macht das File nicht im ioBroker Storage bekannt ... und damit existiert es für den ioBroker nicht. Erst mit writeFile machst Du das

                  S coyote 2 Replies Last reply Reply Quote 0
                  • S
                    saeft_2003 Most Active @apollon77 last edited by

                    @apollon77

                    Danke für die Erklärung weißt du ob das writefile auch mit blockly möglich ist?

                    @coyote

                    Wäre nett wenn du heute im laufe des Tages mal dein script zu Verfügung stellen könntest.

                    1 Reply Last reply Reply Quote 0
                    • coyote
                      coyote Most Active @apollon77 last edited by coyote

                      @apollon77 ich wusste doch, dass ich da irgendwo mal was gelesen hatte, habe es gestern nur nicht mehr gefunden. Ich werde nochmal im js-controller thread suchen.

                      Aber wieso kopieren? wie oben in meinem ersten Script, schreibe ich doch damit die Datei in vis oder nicht?

                       fs.writeFile(dest_path + 'Postbild.jpeg', body, 'binary', function(err) {
                      

                      aber so geht es ja nicht.

                      @saeft_2003 hier:

                      var source_url = 'http://192.168.XX.XX:2000/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=XXXX&pwd=XXXX',
                          dest_path = '/opt/iobroker/iobroker-data/files/vis.0/';
                      
                      
                      var request = require("request");
                      var fs      = require('fs');
                      
                          // Speichert das erste Bild 
                      function saveImage(){
                          request.get({url: source_url, encoding: 'binary'}, function (err, response, body) {
                              fs.writeFile('/tmp/' + 'Postbild.jpg', body, 'binary', function(err) {
                        if (err) {
                                  log('Fehler beim Bild speichern: ' + err, 'warn');
                              } else {
                                  log('Webcam Bild gespeichert');  
                              }
                              })
                          })
                          // Bilder werden nach vis gespeichert
                              const bild1 = fs.readFileSync('/tmp/Postbild.jpg');
                              writeFile('vis.0','/Postbild.jpg', bild1);
                      };
                      

                      EDIT; @apollon77 habs gefunden, auch die Links dazu, wo es besprochen wurde. Danke

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

                        @coyote

                        Danke fürs skript werde ich heute Abend testen. Aber wie gesagt da ich in js nicht wirklich fitt bin könnte es sein das ich noch die ein oder andere Frage habe...

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

                          @saeft_2003 Klar, kein Thema sag Bescheid

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

                            @coyote

                            Die erste Frage habe ich schon 😵 was ist in dem Skript der trigger? Wie löst du dieses aus?

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

                              @saeft_2003 sorry, ich hab nicht mitbekommen, dass du hier geantwortet hast, muss Mal schauen warum ich keine Benachrichtigungen mehr bekomme.

                              Ausgelöst wird es in einem anderen Teil des Scripts, mein Trigger ist hier der Posteinwurf, den hatte ich jetzt hier nicht mit drin, kannst aber ja nehmen was du möchtest. Ansonsten kann ich dir nachher auch den restlichen Teil hochladen

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

                                @coyote

                                Ich bräuchte es so das wenn der Datenpunkt (meine-datenpunkte.0.xyz) aktualisiert wird, wird das skript einmal ausgeführt.

                                Kannst du das in das skript noch mit rein machen?

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

                                  @saeft_2003 Guten morgen,
                                  da ich jetzt nicht weiß, was für ein Typ dein Datenpunkt ist, versuche es einfach mal so.

                                  
                                  var source_url = 'http://192.168.XX.XX:2000/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=XXXX&pwd=XXXX',
                                  dest_path = '/opt/iobroker/iobroker-data/files/vis.0/';
                                  
                                   
                                  var request = require("request");
                                  var fs      = require('fs');
                                  
                                  
                                  on({id: 'dein-Datenpunkt.0.XYZ', change: "any"}, function (obj) {
                                      request.get({url: source_url, encoding: 'binary'}, function (err, response, body) {
                                  
                                          fs.writeFile('/tmp/' + 'Postbild.jpg', body, 'binary', function(err) {
                                  
                                    if (err) {
                                  
                                              log('Fehler beim Bild speichern: ' + err, 'warn');
                                  
                                          } else {
                                  
                                              log('Webcam Bild gespeichert');  
                                  
                                          }
                                  
                                          })
                                  
                                      })
                                  
                                      // Bilder werden nach vis gespeichert
                                  
                                          const bild1 = fs.readFileSync('/tmp/Postbild.jpg');
                                  
                                          writeFile('vis.0','/Postbild.jpg', bild1);
                                  
                                  });
                                  

                                  Bei diesem Beispiel ist es jetzt aber so, dass egal wie sich dein Datenpunkt ändert, wird das Bild aktualisiert.
                                  "change: any"

                                  Hast du einen true/false Datenpunkt, kannst du auch statt "any" z.B. "ne" schreiben, dann wird nur getriggert wenn der Datenpunkt sich von "true" auf "false" oder umgekehrt ändert.

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

                                    @coyote

                                    Vielen Dank ich werde es testen! Der Datenpunkt ist ein Logikwert mit true false. Das mit dem aktualisiert sollte schon so passen, falls nicht kann ich any ja einfach ändern.

                                    Ich melde mich dann nochmal spätestens heute Abend...

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

                                      @saeft_2003 ok, aber wie gesagt, "any" triggert immer egal ob dein Wert von true nach false ider von false nach true wechselt

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

                                        @coyote

                                        ja das weiß ich, ist auch so gewollt.

                                        ich habe das skript jetzt angepasst, wenn ich es starte kommt kein Fehler. Sobald ich dann trigger, geht der Playbutton vom skript von grün auf gelb und das steht im log:

                                        avascript.0	2020-02-12 09:51:06.519	info	(821) script.js.test_test.Skript_2: Webcam Bild gespeichert
                                        host.iobroker	2020-02-12 09:50:46.056	warn	"system.host.iobroker-slave" is offline
                                        javascript.0	2020-02-12 09:50:32.916	info	(821) script.js.test_test.Skript_2: Webcam Bild gespeichert
                                        javascript.0	2020-02-12 09:50:25.136	info	(821) script.js.test_test.Skript_2: Webcam Bild gespeichert
                                        javascript.0	2020-02-12 09:50:18.803	info	(821) script.js.test_test.Skript_2: Webcam Bild gespeichert
                                        javascript.0	2020-02-12 09:50:18.530	error	(821) at processImmediate (timers.js:658:5)
                                        javascript.0	2020-02-12 09:50:18.520	error	(821) at tryOnImmediate (timers.js:676:5)
                                        javascript.0	2020-02-12 09:50:18.518	error	(821) at runCallback (timers.js:705:18)
                                        javascript.0	2020-02-12 09:50:18.515	error	(821) at Immediate.setImmediate (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:4848:37)
                                        javascript.0	2020-02-12 09:50:18.514	error	(821) at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:439:25)
                                        javascript.0	2020-02-12 09:50:18.513	error	(821) at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1101:38)
                                        javascript.0	2020-02-12 09:50:18.513	error	(821) at Object.<anonymous> (script.js.test_test.Skript_2:63:26)
                                        javascript.0	2020-02-12 09:50:18.512	error	(821) at ProtectFs.readFileSync (/opt/iobroker/node_modules/iobroker.javascript/lib/protectFs.js:23:36)
                                        javascript.0	2020-02-12 09:50:18.512	error	(821) at readFileSync (fs.js:343:35)
                                        javascript.0	2020-02-12 09:50:18.511	error	(821) at Object.openSync (fs.js:443:3)
                                        javascript.0	2020-02-12 09:50:18.510	error	(821) Error in callback: Error: ENOENT: no such file or directory, open '/tmp/dafangcurrentpic.jpg'
                                        

                                        hier das skript, Bilder speichern von der xiaomi dafang Kamera mit blockly über exec wget output document geht:

                                        
                                         
                                        
                                        var source_url = 'http://yyyyy:xxxxxxxxx@192.168.178.zzz/cgi-bin/currentpic.cgi',
                                        
                                        dest_path = '/opt/iobroker/iobroker-data/files/vis.0/';
                                        
                                         
                                        
                                         
                                        
                                        var request = require("request");
                                        
                                        var fs      = require('fs');
                                        
                                         
                                        
                                         
                                        
                                        on({id: 'meine-datenpunkte.0.Stoppe_intervall.Stoppe_intervall_kameras', change: "any"}, function (obj) {
                                        
                                            request.get({url: source_url, encoding: 'binary'}, function (err, response, body) {
                                        
                                         
                                        
                                                fs.writeFile('/tmp/' + 'dafangcurrentpic.jpg', body, 'binary', function(err) {
                                        
                                         
                                        
                                          if (err) {
                                        
                                         
                                        
                                                    log('Fehler beim Bild speichern: ' + err, 'warn');
                                        
                                         
                                        
                                                } else {
                                        
                                         
                                        
                                                    log('Webcam Bild gespeichert');  
                                        
                                         
                                        
                                                }
                                        
                                         
                                        
                                                })
                                        
                                         
                                        
                                            })
                                        
                                         
                                        
                                            // Bilder werden nach vis gespeichert
                                        
                                         
                                        
                                                const bild1 = fs.readFileSync('/tmp/dafangcurrentpic.jpg');
                                        
                                         
                                        
                                                writeFile('vis.0','/dafangcurrentpic.jpg', bild1);
                                        
                                         
                                        
                                        });
                                        
                                        

                                        Vielleicht mal hiermit probieren? Weil ich vermute er kann kein Bild speichern... bzw. könnte ich die bilder auch weiter mit blockly halt dann jetzt in tmp speichern. Und das script müsste schauen wenn es ein neues bild in dem ordner tmp gibt wird es dann vis.0 verschoben. Ob das aber dann gehn würde keine Ahnung 🤔

                                        exec('wget --output-document /opt/iobroker/iobroker-data/files/vis.0/dafang.png http://yyyyy:xxxxxxxxx@192.168.178.zzzz/cgi-bin/currentpic.cgi');
                                        
                                        coyote 1 Reply Last reply Reply Quote 0
                                        • coyote
                                          coyote Most Active @saeft_2003 last edited by

                                          @saeft_2003 probier mal mit dem exec befehl, das hat bei meiner Cam nicht funktioniert, deshalb hatte ich es umgeschrieben.
                                          Ja, er findet wohl kein Bild unter /tmp

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

                                            @coyote

                                            Ok muss ich dann nur das durch den exec befehl ersetzen?

                                            var source_url = 'http://yyyyy:xxxxxxxxx@192.168.178.zzz/cgi-bin/currentpic.cgi',
                                            
                                            
                                            coyote 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            1.1k
                                            Online

                                            32.3k
                                            Users

                                            81.0k
                                            Topics

                                            1.3m
                                            Posts

                                            vis
                                            6
                                            39
                                            3192
                                            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