Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Entwicklung
    4. [VIS] value vom typ 'objekt' zur Laufzeit

    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

    [VIS] value vom typ 'objekt' zur Laufzeit

    This topic has been deleted. Only users with topic management privileges can see it.
    • Scrounger
      Scrounger Developer last edited by Negalein

      Hallo zusammen,

      ich habe einen Datenpunkt vom Typ 'objekt'.

      Wenn ich jetzt die Value per vis.states.attr(data.oid + '.val') auslese, wird mir im Vis Editor ein korrektes Json Objekt zurückgegeben. Mit JSON.stringfy bekomm ich dann folgenden Wert:

      [
      	{
      		"name": "test",
      		"ort": "test"
      	}, {
      		"name": "test2",
      		"ort": "test2"
      	}
      ]
      

      Der gleiche Befehl liefert mir aber zur Laufzeit folgendes zurück:

      {
      	"0": {
      		"_data": {
      			"name": "test",
      			"ort": "test"
      		},
      		"_cid": ".map7",
      		"_computedAttrs": {},
      		"name": "test",
      		"ort": "test"
      	},
      	"1": {
      		"_data": {
      			"name": "test2",
      			"ort": "test2"
      		},
      		"_cid": ".map5",
      		"_computedAttrs": {},
      		"name": "test2",
      		"ort": "test2"
      	},
      	"length": 2,
      	"_cid": ".map3",
      	"_computedAttrs": {}
      }
      

      Wie kann ich denn das Objekt umwandeln, das ich im Vis-Editor und zur Laufzeit ein "sauberes" JSON Objekt bekomme?

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

      Support us

      ioBroker
      Community Adapters
      Donate

      590
      Online

      31.9k
      Users

      80.2k
      Topics

      1.3m
      Posts

      vis
      1
      1
      175
      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