Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. JavaScript
  5. Gelöst: Bild von Motioneye nach VIS kopieren mit JavaScript

NEWS

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    17
    1
    369

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    17
    1
    4.9k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.3k

Gelöst: Bild von Motioneye nach VIS kopieren mit JavaScript

Scheduled Pinned Locked Moved JavaScript
javascript
24 Posts 6 Posters 2.4k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Digi-Bit

    Hallo,

    Ich habe mir Motioneye installiert und es Funktioniert auch alles wunderbar !

    Ich habe 3 Kameras wo auch die Bilder im VIS angezeigt werden....

    Ich möchte aber den Letzten Snapshot den Motioneye gemacht hat und der Path in einem datenpunkt "0_userdata.0.10_VIS-TAB8.motioneye.getLastPic" -> "/var/snap/motioneye/common/media/Camera3/2022-11-20/16-35-35_02.jpg"

    gesetzt hat als Snapshot verwenden und das nach 'vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png" kopieren.

    Momentan mach ich das mit einem hier gefunden Javascript aber mit einem Bild direkt von der Kamera.
    Da dies dann aber verzögert passiert sieht man nicht das was wirklich von Motioneye "Gesehen " wurde.

    hier mal das Javascript:

    var fs = require('fs');
    
    var timeout1
    
    exec('ffmpeg -loglevel fatal -i rtsp://xxxxx:yxyxyxyx@xxx.xxx.xxx.xxx:554/h264Preview_01_main -vframes 1 -y -r 1 /tmp/Vorne.jpg');
    
    
    
       timeout1 = setTimeout(function () {
    
          
    
            const picture= fs.readFileSync('/tmp/Vorne.jpg');
    
           writeFile('vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png', picture, function (error) { });
    
    
    
       }, 10000);
       
       
       
    

    Da ich von Javascript 0 Ahnung habe kann mir da hier einer helfen wie man das script abändern muss damit er das gewollte Bild nach VIS.. Kopiert ?

    Mfg

    Digi-Bit

    crunchipC Away
    crunchipC Away
    crunchip
    Forum Testing Most Active
    wrote on last edited by
    #7

    @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

    Javascript aber mit einem Bild direkt von der Kamera.

    dann hol es doch von motioneye
    ich mach das z.b. so, allerdings ausserhalb des iobroker Ordners, wegen dem nicht mehr diekt hineinschreiben dürfen, dazu gibt es aber mehrere Threads dazu

    var request = require('request');
    var fs      = require('fs');
     
    function sendImage() {
        request.get({url: 'http://deinebildquelle', encoding: 'binary'}, function (err, response, body) {
            fs.writeFile("/opt/iobroker/ipcam/pi.jpg", body, 'binary', function(err) {
     
            if (err) {
                console.error(err);
            } else {
                //console.log('Snapshot sent');
                sendTo('telegram.1', '/opt/iobroker/ipcam/pi.jpg');
                //sendTo('telegram.0', {text: '/tmp/snap.jpg', caption: 'Snapshot'});
             }
           });
         });
     }
    

    umgestiegen von Proxmox auf Unraid

    D 1 Reply Last reply
    0
    • bahnuhrB bahnuhr

      @digi-bit

      du holst das bild von deiner cam und speicherst dies in /tmp/Vorne.jpg

      10 Sek. später holst du /tmp/Vorne.jpg und speicherst es in ...Sonstige/snapshot.png

      Warum soll das Bild 1 von dem Bild 2 abweichen.

      kann doch eigentlich gar nicht sein, oder ?

      crunchipC Away
      crunchipC Away
      crunchip
      Forum Testing Most Active
      wrote on last edited by
      #8

      @bahnuhr stimmt schon, du kannst dir ein Bild von der Cam holen, oder wenn motioneye etwas erkennt und ein Bild macht, vergleichst du dann beide, stellst man einen Versatz fest.

      umgestiegen von Proxmox auf Unraid

      bahnuhrB 1 Reply Last reply
      0
      • crunchipC crunchip

        @bahnuhr stimmt schon, du kannst dir ein Bild von der Cam holen, oder wenn motioneye etwas erkennt und ein Bild macht, vergleichst du dann beide, stellst man einen Versatz fest.

        bahnuhrB Online
        bahnuhrB Online
        bahnuhr
        Forum Testing Most Active
        wrote on last edited by bahnuhr
        #9

        @crunchip sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

        @bahnuhr stimmt schon, du kannst dir ein Bild von der Cam holen, oder wenn motioneye etwas erkennt und ein Bild macht, vergleichst du dann beide, stellst man einen Versatz fest.

        ja, genau.

        Aber sein Script war ja, direkt von der cam und dann speichern.
        Dürfte kein Unterschied sein.

        Die Frage ist halt, was er will ?!?!


        Wenn ich helfen konnte, dann Daumen hoch (Pfeil nach oben)!
        Danke.
        gute Forenbeiträge: https://forum.iobroker.net/topic/51555/hinweise-f%C3%BCr-gute-forenbeitr%C3%A4ge
        ScreenToGif :https://www.screentogif.com/downloads.html

        crunchipC 1 Reply Last reply
        0
        • bahnuhrB bahnuhr

          @crunchip sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

          @bahnuhr stimmt schon, du kannst dir ein Bild von der Cam holen, oder wenn motioneye etwas erkennt und ein Bild macht, vergleichst du dann beide, stellst man einen Versatz fest.

          ja, genau.

          Aber sein Script war ja, direkt von der cam und dann speichern.
          Dürfte kein Unterschied sein.

          Die Frage ist halt, was er will ?!?!

          crunchipC Away
          crunchipC Away
          crunchip
          Forum Testing Most Active
          wrote on last edited by
          #10

          @bahnuhr sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

          was er will

          das Bild was motioneye selbst gemacht hat, soweit ich verstanden habe

          @Digi-Bit oder schau mal HIER

          umgestiegen von Proxmox auf Unraid

          D 1 Reply Last reply
          0
          • crunchipC crunchip

            @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

            Javascript aber mit einem Bild direkt von der Kamera.

            dann hol es doch von motioneye
            ich mach das z.b. so, allerdings ausserhalb des iobroker Ordners, wegen dem nicht mehr diekt hineinschreiben dürfen, dazu gibt es aber mehrere Threads dazu

            var request = require('request');
            var fs      = require('fs');
             
            function sendImage() {
                request.get({url: 'http://deinebildquelle', encoding: 'binary'}, function (err, response, body) {
                    fs.writeFile("/opt/iobroker/ipcam/pi.jpg", body, 'binary', function(err) {
             
                    if (err) {
                        console.error(err);
                    } else {
                        //console.log('Snapshot sent');
                        sendTo('telegram.1', '/opt/iobroker/ipcam/pi.jpg');
                        //sendTo('telegram.0', {text: '/tmp/snap.jpg', caption: 'Snapshot'});
                     }
                   });
                 });
             }
            
            D Offline
            D Offline
            Digi-Bit
            wrote on last edited by
            #11

            @crunchip sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

            @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

            Javascript aber mit einem Bild direkt von der Kamera.

            dann hol es doch von motioneye
            ich mach das z.b. so, allerdings ausserhalb des iobroker Ordners, wegen dem nicht mehr diekt hineinschreiben dürfen, dazu gibt es aber mehrere Threads dazu

            var request = require('request');
            var fs      = require('fs');
             
            function sendImage() {
                request.get({url: 'http://deinebildquelle', encoding: 'binary'}, function (err, response, body) {
                    fs.writeFile("/opt/iobroker/ipcam/pi.jpg", body, 'binary', function(err) {
             
                    if (err) {
                        console.error(err);
                    } else {
                        //console.log('Snapshot sent');
                        sendTo('telegram.1', '/opt/iobroker/ipcam/pi.jpg');
                        //sendTo('telegram.0', {text: '/tmp/snap.jpg', caption: 'Snapshot'});
                     }
                   });
                 });
             }
            

            Hi,

            Ja denke das kommt schon fast so hin in die richtung.

            ich will ja keine URL sonder einen datenpunkt haben "0_userdata.0.10_VIS-TAB8.motioneye.takeSnapshot"
            in diesen datenpunkt steht ja der Path zu dem letzten snapshot von M*Eye im meinem fall grade der " /var/snap/motioneye/common/media/Camera2/2022-11-20/18-05-30_04.jpg "

            /opt/iobroker/ipcam/pi.jpg

            das müste nach meinem script ja dann " 'vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png' " sein.....

            nur wen ich das so in deinem script einsetze sieht das sehr komisch aus

            var request = require('request');
            var fs      = require('fs');
             
            function sendImage() {
                request.get({'0_userdata.0.10_VIS-TAB8.motioneye.takeSnapshot', encoding: 'binary'}, function (err, response, body) {
                    fs.writeFile("vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png", body, 'binary', function(err) {
             
                    if (err) {
                        console.error(err);
                    } else {
                        //console.log('Snapshot sent');
                        sendTo('telegram.1', '/opt/iobroker/ipcam/pi.jpg');
                        //sendTo('telegram.0', {text: '/tmp/snap.jpg', caption: 'Snapshot'});
                     }
                   });
                 });
             }
            
            

            kann das noch einer richtig stellen in dem script das es geht ? :innocent:

            mfg

            Digi-Bit

            Router: Ubiquiti UniFi Dream Machine Pro|Iobroker I.NUCi5/Debian, 6 x Switche, 3 x APs, 3 x Cam, 2 x Nas(Qnap 4 & 8 Bay's)
            7 x Echos, 76 x Tasmota, 58 x ZigBee, Homatic Ip, 2 x USV

            1 Reply Last reply
            0
            • crunchipC crunchip

              @bahnuhr sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

              was er will

              das Bild was motioneye selbst gemacht hat, soweit ich verstanden habe

              @Digi-Bit oder schau mal HIER

              D Offline
              D Offline
              Digi-Bit
              wrote on last edited by
              #12

              @crunchip sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

              @bahnuhr sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

              was er will

              das Bild was motioneye selbst gemacht hat, soweit ich verstanden habe

              @Digi-Bit oder schau mal HIER

              Naja.... eigentlich nicht weil das das bild ja auch von HTTP kommt.

              ich habe ein Bild..... nur ebent mit verschiedenen Endungen und Datums Merkmale was in verschiedenen dir's liegt von M*Eye

              das einzige was ich konstant habe ist der "Lagerort" des Path's zum Bild nämlich "0_userdata.0.10_VIS-TAB8.motioneye.getLastPic"

              mfg

              Router: Ubiquiti UniFi Dream Machine Pro|Iobroker I.NUCi5/Debian, 6 x Switche, 3 x APs, 3 x Cam, 2 x Nas(Qnap 4 & 8 Bay's)
              7 x Echos, 76 x Tasmota, 58 x ZigBee, Homatic Ip, 2 x USV

              D 1 Reply Last reply
              0
              • D Digi-Bit

                @crunchip sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                @bahnuhr sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                was er will

                das Bild was motioneye selbst gemacht hat, soweit ich verstanden habe

                @Digi-Bit oder schau mal HIER

                Naja.... eigentlich nicht weil das das bild ja auch von HTTP kommt.

                ich habe ein Bild..... nur ebent mit verschiedenen Endungen und Datums Merkmale was in verschiedenen dir's liegt von M*Eye

                das einzige was ich konstant habe ist der "Lagerort" des Path's zum Bild nämlich "0_userdata.0.10_VIS-TAB8.motioneye.getLastPic"

                mfg

                D Offline
                D Offline
                Digi-Bit
                wrote on last edited by
                #13

                Wie muss man den das Script ändern das es dann geht ?

                var request = require('request');
                var fs      = require('fs');
                 
                function sendImage() {
                    request.get({'0_userdata.0.10_VIS-TAB8.motioneye.takeSnapshot', encoding: 'binary'}, function (err, response, body) {
                                  [^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^]
                        fs.writeFile("vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png", body, 'binary', function(err) {
                 
                        if (err) {
                            console.error(err);
                        } else {
                            //console.log('Snapshot sent');
                            sendTo('telegram.1', '/opt/iobroker/ipcam/pi.jpg');
                            //sendTo('telegram.0', {text: '/tmp/snap.jpg', caption: 'Snapshot'});
                         }
                       });
                     });
                 }
                 
                
                

                kann mir da noch jemand Helfen ?

                mfg

                Digi-Bit

                Router: Ubiquiti UniFi Dream Machine Pro|Iobroker I.NUCi5/Debian, 6 x Switche, 3 x APs, 3 x Cam, 2 x Nas(Qnap 4 & 8 Bay's)
                7 x Echos, 76 x Tasmota, 58 x ZigBee, Homatic Ip, 2 x USV

                D 1 Reply Last reply
                0
                • D Digi-Bit

                  Wie muss man den das Script ändern das es dann geht ?

                  var request = require('request');
                  var fs      = require('fs');
                   
                  function sendImage() {
                      request.get({'0_userdata.0.10_VIS-TAB8.motioneye.takeSnapshot', encoding: 'binary'}, function (err, response, body) {
                                    [^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^]
                          fs.writeFile("vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png", body, 'binary', function(err) {
                   
                          if (err) {
                              console.error(err);
                          } else {
                              //console.log('Snapshot sent');
                              sendTo('telegram.1', '/opt/iobroker/ipcam/pi.jpg');
                              //sendTo('telegram.0', {text: '/tmp/snap.jpg', caption: 'Snapshot'});
                           }
                         });
                       });
                   }
                   
                  
                  

                  kann mir da noch jemand Helfen ?

                  mfg

                  Digi-Bit

                  D Offline
                  D Offline
                  Digi-Bit
                  wrote on last edited by
                  #14

                  also eigentlich reicht ja das

                  var fs = require('fs');
                   
                  var timeout1
                   
                   
                      timeout1 = setTimeout(function () {
                   
                         
                   
                           const picture= fs.readFileSync('/var/snap/motioneye/common/media/Camera2/2022-11-20/20-25-50_02.jpg');
                   
                          writeFile('vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png', picture, function (error) { });
                   
                   
                   
                      }, 10000);
                  

                  Also so funktioniert das ja.

                  nur ändert sich der Path ja immer da ich ja 3 Kammeras habe

                  der Aktuelle Path steht in 0_userdata.0.10_VIS-TAB8.motioneye.getLastPic drin.

                  wie bekomme ich das jetzt als variable ind die zele da rein.

                  irgend wie muss das ja so in der art sein

                  var fs = require('fs');
                   
                  var timeout1
                   
                   
                      timeout1 = setTimeout(function () {
                   
                          phat+dateiname = ist wert aus datenpunkt =  0_userdata.0.10_VIS-TAB8.motioneye.getLastPic
                   
                          const picture= fs.readFileSync('/path+dateiname.jpg');
                   
                          writeFile('vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png', picture, function (error) { });
                   
                   
                   
                      }, 10000);
                  
                  

                  kann mir das einer in Java Script übersetzen ?

                  mfg

                  Digi-Bit

                  Router: Ubiquiti UniFi Dream Machine Pro|Iobroker I.NUCi5/Debian, 6 x Switche, 3 x APs, 3 x Cam, 2 x Nas(Qnap 4 & 8 Bay's)
                  7 x Echos, 76 x Tasmota, 58 x ZigBee, Homatic Ip, 2 x USV

                  1 Reply Last reply
                  0
                  • crunchipC Away
                    crunchipC Away
                    crunchip
                    Forum Testing Most Active
                    wrote on last edited by
                    #15

                    @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                    sonder einen datenpunkt haben

                    eigentlich willst du doch das direkt abgespeicherte Bild was durch motioneye abgelegt wurde?

                    @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                    was in verschiedenen dir's liegt

                    ja und?

                    @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                    nur ändert sich der Path ja immer da ich ja 3 Kammeras habe

                    ich blicks grad nicht, wo willst du ein Bild holen und woher kommt das bzw wie?

                    umgestiegen von Proxmox auf Unraid

                    ChaotC D 2 Replies Last reply
                    0
                    • crunchipC crunchip

                      @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                      sonder einen datenpunkt haben

                      eigentlich willst du doch das direkt abgespeicherte Bild was durch motioneye abgelegt wurde?

                      @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                      was in verschiedenen dir's liegt

                      ja und?

                      @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                      nur ändert sich der Path ja immer da ich ja 3 Kammeras habe

                      ich blicks grad nicht, wo willst du ein Bild holen und woher kommt das bzw wie?

                      ChaotC Offline
                      ChaotC Offline
                      Chaot
                      wrote on last edited by Chaot
                      #16

                      @crunchip
                      Ich glaube ich habe das jetzt kapiert.

                      Unter dem Datenpunkt
                      0_userdata.0.10_VIS-TAB8.motioneye.getLastPic
                      steht der aktuelle Pfad zum Bild.

                      Das soll dann von dem Pfad (der sich wegen der 3 Kameras ständig ändert) geholt werden und in dem Pfad
                      'vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png'
                      umbenannt und gespeichert werden.

                      ioBroker auf NUC unter Proxmox; VIS: 12" Touchscreen und 17" Touch; Lichtsteuerung, Thermometer und Sensoren: Tasmota (39); Ambiente Beleuchtung: WLED (9); Heizung: DECT Thermostate (9) an Fritz 6690; EMS-ESP; 1 Echo V2; 3 Echo DOT; 1 Echo Connect; 2 Echo Show 5; Unifi Ap-Ac Lite.

                      D 1 Reply Last reply
                      0
                      • crunchipC crunchip

                        @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                        sonder einen datenpunkt haben

                        eigentlich willst du doch das direkt abgespeicherte Bild was durch motioneye abgelegt wurde?

                        @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                        was in verschiedenen dir's liegt

                        ja und?

                        @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                        nur ändert sich der Path ja immer da ich ja 3 Kammeras habe

                        ich blicks grad nicht, wo willst du ein Bild holen und woher kommt das bzw wie?

                        D Offline
                        D Offline
                        Digi-Bit
                        wrote on last edited by
                        #17

                        @crunchip sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                        @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                        sonder einen datenpunkt haben

                        eigentlich willst du doch das direkt abgespeicherte Bild was durch motioneye abgelegt wurde?

                        Genau

                        @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                        was in verschiedenen dir's liegt

                        ja und?

                        ahha

                        @digi-bit sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                        nur ändert sich der Path ja immer da ich ja 3 Kammeras habe

                        ich blicks grad nicht, wo willst du ein Bild holen und woher kommt das bzw wie?

                        ich weiss nicht, drück ich mich so doof aus ?

                        das bild kommt von Motioneye wird in /var/snap/motioneye/common/media/Camerax/datum/ gespeichtert.

                        der speicherpunkt liegt in den userdaten "0_userdata.0.10_VIS-TAB8.motioneye.getLastPic"

                        steht aber eigentlich alles schon Paar mal da !

                        mfg

                        Router: Ubiquiti UniFi Dream Machine Pro|Iobroker I.NUCi5/Debian, 6 x Switche, 3 x APs, 3 x Cam, 2 x Nas(Qnap 4 & 8 Bay's)
                        7 x Echos, 76 x Tasmota, 58 x ZigBee, Homatic Ip, 2 x USV

                        1 Reply Last reply
                        0
                        • ChaotC Chaot

                          @crunchip
                          Ich glaube ich habe das jetzt kapiert.

                          Unter dem Datenpunkt
                          0_userdata.0.10_VIS-TAB8.motioneye.getLastPic
                          steht der aktuelle Pfad zum Bild.

                          Das soll dann von dem Pfad (der sich wegen der 3 Kameras ständig ändert) geholt werden und in dem Pfad
                          'vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png'
                          umbenannt und gespeichert werden.

                          D Offline
                          D Offline
                          Digi-Bit
                          wrote on last edited by
                          #18

                          @chaot sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                          @crunchip
                          Ich glaube ich habe das jetzt kapiert.

                          Unter dem Datenpunkt
                          0_userdata.0.10_VIS-TAB8.motioneye.getLastPic
                          steht der aktuelle Pfad zum Bild.

                          Das soll dann von dem Pfad (der sich wegen der 3 Kameras ständig ändert) geholt werden und in dem Pfad
                          'vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png'
                          umbenannt und gespeichert werden.

                          Treffer

                          mfg

                          Router: Ubiquiti UniFi Dream Machine Pro|Iobroker I.NUCi5/Debian, 6 x Switche, 3 x APs, 3 x Cam, 2 x Nas(Qnap 4 & 8 Bay's)
                          7 x Echos, 76 x Tasmota, 58 x ZigBee, Homatic Ip, 2 x USV

                          D 1 Reply Last reply
                          0
                          • D Digi-Bit

                            @chaot sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                            @crunchip
                            Ich glaube ich habe das jetzt kapiert.

                            Unter dem Datenpunkt
                            0_userdata.0.10_VIS-TAB8.motioneye.getLastPic
                            steht der aktuelle Pfad zum Bild.

                            Das soll dann von dem Pfad (der sich wegen der 3 Kameras ständig ändert) geholt werden und in dem Pfad
                            'vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png'
                            umbenannt und gespeichert werden.

                            Treffer

                            mfg

                            D Offline
                            D Offline
                            Digi-Bit
                            wrote on last edited by
                            #19

                            Ich hab es es selber rausgefunden obwohl ich keine Ahnung von Java eigentlich habe

                            var fs = require('fs');
                            
                                dest_path = getState("0_userdata.0.10_VIS-TAB8.motioneye.getLastPic").val;
                            
                            var timeout1
                             
                             
                                timeout1 = setTimeout(function () {
                             
                                   
                             
                                     const picture= fs.readFileSync(dest_path);
                             
                                    writeFile('vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png', picture, function (error) { });
                             
                             
                             
                                }, 20000);
                            
                                
                            

                            trotzdem danke ^^

                            mfg

                            Digi-Bit

                            Router: Ubiquiti UniFi Dream Machine Pro|Iobroker I.NUCi5/Debian, 6 x Switche, 3 x APs, 3 x Cam, 2 x Nas(Qnap 4 & 8 Bay's)
                            7 x Echos, 76 x Tasmota, 58 x ZigBee, Homatic Ip, 2 x USV

                            ChaotC 1 Reply Last reply
                            1
                            • D Digi-Bit

                              Ich hab es es selber rausgefunden obwohl ich keine Ahnung von Java eigentlich habe

                              var fs = require('fs');
                              
                                  dest_path = getState("0_userdata.0.10_VIS-TAB8.motioneye.getLastPic").val;
                              
                              var timeout1
                               
                               
                                  timeout1 = setTimeout(function () {
                               
                                     
                               
                                       const picture= fs.readFileSync(dest_path);
                               
                                      writeFile('vis.0','/Samsung-Tab8/Meine_Icons/Sonstige/snapshot.png', picture, function (error) { });
                               
                               
                               
                                  }, 20000);
                              
                                  
                              

                              trotzdem danke ^^

                              mfg

                              Digi-Bit

                              ChaotC Offline
                              ChaotC Offline
                              Chaot
                              wrote on last edited by
                              #20

                              @digi-bit Da war ich wohl zu langsam beim Schreiben.
                              Ich denke das das mit dem variablen Pfad keiner (auch ich) richtig verstanden hat am Anfang.

                              ioBroker auf NUC unter Proxmox; VIS: 12" Touchscreen und 17" Touch; Lichtsteuerung, Thermometer und Sensoren: Tasmota (39); Ambiente Beleuchtung: WLED (9); Heizung: DECT Thermostate (9) an Fritz 6690; EMS-ESP; 1 Echo V2; 3 Echo DOT; 1 Echo Connect; 2 Echo Show 5; Unifi Ap-Ac Lite.

                              D 1 Reply Last reply
                              0
                              • ChaotC Chaot

                                @digi-bit Da war ich wohl zu langsam beim Schreiben.
                                Ich denke das das mit dem variablen Pfad keiner (auch ich) richtig verstanden hat am Anfang.

                                D Offline
                                D Offline
                                Digi-Bit
                                wrote on last edited by
                                #21

                                @chaot sagte in Bild von Motioneye nach VIS kopieren mit JavaScript:

                                @digi-bit Da war ich wohl zu langsam beim Schreiben.
                                Ich denke das das mit dem variablen Pfad keiner (auch ich) richtig verstanden hat am Anfang.

                                ja, so kommt mir das auch vor obwohl ich das oben geschrieben habe und mehrmals erwähnt habe.....

                                schade eigentlich aber nun geht es ja.....

                                ich weis nur nicht ob das so "sauber" geschrieben ist , vielleicht hat der eine oder andere ja noch Verbesserungen einzubringen ............

                                mfg

                                Digi-Bit

                                Router: Ubiquiti UniFi Dream Machine Pro|Iobroker I.NUCi5/Debian, 6 x Switche, 3 x APs, 3 x Cam, 2 x Nas(Qnap 4 & 8 Bay's)
                                7 x Echos, 76 x Tasmota, 58 x ZigBee, Homatic Ip, 2 x USV

                                1 Reply Last reply
                                0
                                • I Offline
                                  I Offline
                                  intruder7
                                  wrote on last edited by
                                  #22

                                  Moin,

                                  ist zwar schon etwas her. aber ich stehe vor einem ähnlichen Problem und brauche das Bild welches Motioneye gemacht habe. Sprich den Pfad dorthin.
                                  Hier sprecht ihr von einem DP " 0_userdata.0.10_VIS-TAB8.motioneye.getLastPic " . wie bekommt ihr den Pfad in diesen DP?
                                  Also bei mir sieht der Pfad so aus.
                                  http://192.168.+++.+++:8765/picture/1/preview/2023-01-20/08-03-15.jpg?_username=++++&_signature=**************************************

                                  Grüße

                                  M 1 Reply Last reply
                                  0
                                  • I intruder7

                                    Moin,

                                    ist zwar schon etwas her. aber ich stehe vor einem ähnlichen Problem und brauche das Bild welches Motioneye gemacht habe. Sprich den Pfad dorthin.
                                    Hier sprecht ihr von einem DP " 0_userdata.0.10_VIS-TAB8.motioneye.getLastPic " . wie bekommt ihr den Pfad in diesen DP?
                                    Also bei mir sieht der Pfad so aus.
                                    http://192.168.+++.+++:8765/picture/1/preview/2023-01-20/08-03-15.jpg?_username=++++&_signature=**************************************

                                    Grüße

                                    M Offline
                                    M Offline
                                    michihorn
                                    wrote on last edited by
                                    #23

                                    @intruder7 etwa so, am Beispiel einer Reolink Kamera, siehe Zeile 6:

                                            request({
                                                url: "http://192.168.178.xxx/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wudddUCeI9WG7C&user=admin&password=rxxxx", encoding: null,
                                            },
                                                (error, response, body) => {
                                                    if (!error && body) {
                                                        writeFile("vis.0", "/klingelbild/Klingel.jpg", body);
                                                    }
                                                }
                                    
                                    I 1 Reply Last reply
                                    0
                                    • M michihorn

                                      @intruder7 etwa so, am Beispiel einer Reolink Kamera, siehe Zeile 6:

                                              request({
                                                  url: "http://192.168.178.xxx/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wudddUCeI9WG7C&user=admin&password=rxxxx", encoding: null,
                                              },
                                                  (error, response, body) => {
                                                      if (!error && body) {
                                                          writeFile("vis.0", "/klingelbild/Klingel.jpg", body);
                                                      }
                                                  }
                                      
                                      I Offline
                                      I Offline
                                      intruder7
                                      wrote on last edited by
                                      #24

                                      @michihorn das verstehe ich schon. nur ich brauche den Pfad von Motioneye zum zuletzt aufgenommen Bild

                                      1 Reply Last reply
                                      0
                                      Reply
                                      • Reply as topic
                                      Log in to reply
                                      • Oldest to Newest
                                      • Newest to Oldest
                                      • Most Votes


                                      Support us

                                      ioBroker
                                      Community Adapters
                                      Donate

                                      691

                                      Online

                                      32.7k

                                      Users

                                      82.5k

                                      Topics

                                      1.3m

                                      Posts
                                      Community
                                      Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                      ioBroker Community 2014-2025
                                      logo
                                      • Login

                                      • Don't have an account? Register

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Home
                                      • Recent
                                      • Tags
                                      • Unread 0
                                      • Categories
                                      • Unreplied
                                      • Popular
                                      • GitHub
                                      • Docu
                                      • Hilfe