Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. [erl.]wie speichert man Array von Arrays

    NEWS

    • Amazon Alexa - ioBroker Skill läuft aus ?

    • Monatsrückblick – September 2025

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

    [erl.]wie speichert man Array von Arrays

    This topic has been deleted. Only users with topic management privileges can see it.
    • liv-in-sky
      liv-in-sky last edited by liv-in-sky

      bekomme immer info im log!

      	State value to set for "javascript.2.Tabellen@Liv.NMAPTabelleVIS.Device_Collection" has to be stringified but received type "object"
      

      erstellt wird das ganze so:

      (in einer schleife)
        let help=[var1.trim(),var2.trim(),var3,valMAC,varNew]
         if (!(var1=="na" || var2=="na")) myObj.push(help) 
                         }
      ...
      ...
      setState("javascript." + instance + ".Tabellen@Liv."+dpVIS+".Device_Collection", myObj)
      
      
      

      gespeichert wird es in einen datenpunkt vom type "array"

      egal was ich probiere, den datenp. type ändern (string,object), mit stringify sichern und parse holen - immer gibt es fehler

      hat jmd einen tipp

      Asgothian 1 Reply Last reply Reply Quote 0
      • Asgothian
        Asgothian Developer @liv-in-sky last edited by

        @liv-in-sky sagte in wie speichert man Array von Arrays:

        bekomme immer info im log!

        	State value to set for "javascript.2.Tabellen@Liv.NMAPTabelleVIS.Device_Collection" has to be stringified but received type "object"
        

        erstellt wird das ganze so:

        (in einer schleife)
          let help=[var1.trim(),var2.trim(),var3,valMAC,varNew]
           if (!(var1=="na" || var2=="na")) myObj.push(help) 
                           }
        ...
        ...
        setState("javascript." + instance + ".Tabellen@Liv."+dpVIS+".Device_Collection", myObj)
        
        
        

        gespeichert wird es in einen datenpunkt vom type "array"

        egal was ich probiere, den datenp. type ändern (string,object), mit stringify sichern und parse holen - immer gibt es fehler

        hat jmd einen tipp

        der einfachste weg:

        JSON.stringify([[1, 1, 1],[2,2],[3]])

        Restaurieren dann mit JSON.parse(string)

        Siehe auch hier:
        Screenshot 2025-10-18 at 21.02.23.png

        paul53 1 Reply Last reply Reply Quote 1
        • paul53
          paul53 @Asgothian last edited by

          @asgothian sagte: der einfachste weg:

          Nicht mit
          @liv-in-sky sagte in wie speichert man Array von Arrays:

          datenpunkt vom type "array"

          , denn dann nimmt der Javascript-Adapter die Wandlung nach/von JSON vor.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post

          Support us

          ioBroker
          Community Adapters
          Donate

          549
          Online

          32.3k
          Users

          81.1k
          Topics

          1.3m
          Posts

          3
          3
          111
          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