Skip to content
  • 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
Logo
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Blockly
  5. Textdatei erstellen und füllen mit Blocky

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.0k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    1.8k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    15
    1
    2.0k

Textdatei erstellen und füllen mit Blocky

Textdatei erstellen und füllen mit Blocky

Scheduled Pinned Locked Moved Blockly
6 Posts 2 Posters 580 Views 2 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.
  • J Offline
    J Offline
    Jojo36
    wrote on last edited by
    #1

    Hallo,

    ich beschäftige mich seit kurzem mit dem IOBroker. Ist es möglich mit Blocky bzw. eines integrietem Java Scriptes, eine .txt Datei zu erstellen und zu füllen?

    Grüße

    paul53P 1 Reply Last reply
    0
    • J Jojo36

      Hallo,

      ich beschäftige mich seit kurzem mit dem IOBroker. Ist es möglich mit Blocky bzw. eines integrietem Java Scriptes, eine .txt Datei zu erstellen und zu füllen?

      Grüße

      paul53P Offline
      paul53P Offline
      paul53
      wrote on last edited by
      #2

      @Jojo36 sagte:

      Java Scriptes, eine .txt Datei zu erstellen und zu füllen?

      Ja.

      Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
      Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

      J 1 Reply Last reply
      0
      • paul53P paul53

        @Jojo36 sagte:

        Java Scriptes, eine .txt Datei zu erstellen und zu füllen?

        Ja.

        J Offline
        J Offline
        Jojo36
        wrote on last edited by
        #3

        @paul53
        Hi kannst du mir viellecht sagen wie? 🙂

        paul53P 1 Reply Last reply
        0
        • J Jojo36

          @paul53
          Hi kannst du mir viellecht sagen wie? 🙂

          paul53P Offline
          paul53P Offline
          paul53
          wrote on last edited by
          #4

          @Jojo36 sagte:

          wie?

          Mit der Funktion flog(txt) schreibe ich Logs in eine Datei:

          // Logging in Datei /opt/iobroker/iobroker-data/scripts.log
          
          var fs = require('fs');                     // enable write fuer externes log
          var fn = "/opt/iobroker/iobroker-data/scripts.log";
          
          function timestamp() {
              var ts = new Date();
              return formatDate(ts, "YYYY-MM-DD hh:mm:ss.sss") + " \t";
          }
          
          function flog(txt) {
              var ts = timestamp();
              fs.appendFileSync(fn, ts + txt + "\n");
          }
          

          Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
          Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

          J 2 Replies Last reply
          0
          • paul53P paul53

            @Jojo36 sagte:

            wie?

            Mit der Funktion flog(txt) schreibe ich Logs in eine Datei:

            // Logging in Datei /opt/iobroker/iobroker-data/scripts.log
            
            var fs = require('fs');                     // enable write fuer externes log
            var fn = "/opt/iobroker/iobroker-data/scripts.log";
            
            function timestamp() {
                var ts = new Date();
                return formatDate(ts, "YYYY-MM-DD hh:mm:ss.sss") + " \t";
            }
            
            function flog(txt) {
                var ts = timestamp();
                fs.appendFileSync(fn, ts + txt + "\n");
            }
            
            J Offline
            J Offline
            Jojo36
            wrote on last edited by
            #5

            @paul53
            Hi vielen Dank. Ich probiere das Skript aus!

            Vielen Dank für die schnelle Hilfe!

            1 Reply Last reply
            0
            • paul53P paul53

              @Jojo36 sagte:

              wie?

              Mit der Funktion flog(txt) schreibe ich Logs in eine Datei:

              // Logging in Datei /opt/iobroker/iobroker-data/scripts.log
              
              var fs = require('fs');                     // enable write fuer externes log
              var fn = "/opt/iobroker/iobroker-data/scripts.log";
              
              function timestamp() {
                  var ts = new Date();
                  return formatDate(ts, "YYYY-MM-DD hh:mm:ss.sss") + " \t";
              }
              
              function flog(txt) {
                  var ts = timestamp();
                  fs.appendFileSync(fn, ts + txt + "\n");
              }
              
              J Offline
              J Offline
              Jojo36
              wrote on last edited by
              #6

              @paul53

              Hi ich habe das Skript versucht in Blocky einzubinden.
              Ich denke bei mir hackt es noch an den Grundbedingungen:

              1. Muss ich die Datei zuerst anlegen?
              2. Die variable "txt" ist ja von mir anzugeben z.B. "Test"
              3. Das Skript wird ja dann in Blocky über den Block JS Funktion eingebaut?

              Sorry das ich mit den Fragen wahrschinlich nerve, aber ich versuch es zu kapieren.

              Gruß

              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

              601

              Online

              32.4k

              Users

              81.3k

              Topics

              1.3m

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

              • Don't have an account? Register

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