Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. sento to photo

    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

    sento to photo

    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Kellerkind-86 last edited by

      Hallo zusammen,
      ich hab dieses script.. aber ich erhalte kein Foto per telegram. wo ist der Fehler ? danke schonmal für die Hilfe

      const basisPfad = '/mnt/motioneye-share/Gartenkamera';
      const zigbeeTriggerDP = 'zigbee.0.00158d000804b54f.single';
      const fs = require('fs');
      const path = require('path');
      
      on({ id: zigbeeTriggerDP, change: 'to true' }, () => {
          const jetzt = new Date();
          const zielZeit = new Date(jetzt.getTime() - 2000);
          const datumOrdner = zielZeit.toISOString().slice(0, 10);
          const stunde = String(zielZeit.getHours()).padStart(2, '0');
          const minute = String(zielZeit.getMinutes()).padStart(2, '0');
          const sekunde = String(zielZeit.getSeconds()).padStart(2, '0');
          const dateiname = `${stunde}-${minute}-${sekunde}.jpg`;
          const vollPfad = path.join(basisPfad, datumOrdner, dateiname);
      
          if (fs.existsSync(vollPfad)) {
              sendTo('telegram.0', 'send', {
                  text: vollPfad
              });
          }
      });
      
      
      M BananaJoe M 3 Replies Last reply Reply Quote 0
      • M
        MCU @Kellerkind-86 last edited by

        @kellerkind-86 Es gibt einige Beispiele dazu siehe Suche photo telegram

        https://forum.iobroker.net/topic/80994/telegram/9

        1 Reply Last reply Reply Quote 1
        • BananaJoe
          BananaJoe Most Active @Kellerkind-86 last edited by

          @kellerkind-86 du baust dir den Dateinamen auf Basis der Uhrzeit (-2 Sekunden) zusammen. Wie weist du denn das es diesen speziellen Namen wirklich gibt?
          Du solltest eher die neueste Datei oder so etwas nehmen.

          1 Reply Last reply Reply Quote 2
          • arteck
            arteck Developer Most Active last edited by

            @kellerkind-86 sagte in sento to photo:

            vollPfad

            lass dir mal den vollPfad ausgeben in Zeile 15

            console.warn('pfad ' +  vollPfad);
            

            dann nimmst du diesen pfad und schaust nach ob es da was gibt..

            1 Reply Last reply Reply Quote 0
            • M
              michihorn @Kellerkind-86 last edited by

              @kellerkind-86
              Sehr einfach ist auch die Variante über den Reolink Adapter

              /*****Bewegung Teich ****************************************************
              * Mai 2025
              * Adapter: Reolink
              * geä:
              *************************************************************************/
              const idtuer ="hm-rpc.0.LEQ1176852.1.STATE"
              const idmotion = "reolink.0.sensor.motion"
              on({ id: idmotion, change: "any" }, function (obj) {
                  if ((obj.state.val == true) && getState(idtuer).val == false) {
                      log("Motion Teich")
              
                      sendTo("reolink.0", { action: "snap" }, function (result) {
                          const buffer = Buffer.from(result.base64, "base64");
                          sendTo('telegram.0', {
                              text: buffer,
                              type: "photo",
                              caption: 'Teich'
                          });
                      });
                  }
              });
              
              
              
              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              Support us

              ioBroker
              Community Adapters
              Donate

              403
              Online

              31.9k
              Users

              80.2k
              Topics

              1.3m
              Posts

              5
              5
              229
              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