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
    617

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

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

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.
  • 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 Online
                        I Online
                        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 Online
                            I Online
                            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

                            706

                            Online

                            32.7k

                            Users

                            82.6k

                            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