Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. Anfängerfrage: Wert aus Smartmeter-Objekt-ID in Variable

    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

    Anfängerfrage: Wert aus Smartmeter-Objekt-ID in Variable

    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      TobiH last edited by

      Hallo,
      ich habe leider keine Ahnung von Javascript und scheitere an diesem Problem: ich möchte in eine Variable den Wert eines Smartmeter-Objekts speichern.

      var FieldValue = getState("smartmeter.0.1-0:16_7_0__255.value");
      

      Als Ausgabe auf der Konsole erhalte ich:

      {'val':116,'ack':true,'ts':1659194106017,'q':0,'from':'system.adapter.smartmeter.0','user':'system.user.admin','lc':1659194106017}
      

      Wie stelle ich es an, dass nur der Wert 'val' in meiner Variable landet?
      Vielen Dank für Starthilfe!
      Tobias

      paul53 1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @TobiH last edited by

        @tobih sagte: nur der Wert 'val'

        var FieldValue = getState("smartmeter.0.1-0:16_7_0__255.value").val;
        
        T 1 Reply Last reply Reply Quote 0
        • T
          TobiH @paul53 last edited by

          @paul53
          So einfach, perfekt, vielen Dank!

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

          Support us

          ioBroker
          Community Adapters
          Donate

          604
          Online

          31.8k
          Users

          80.0k
          Topics

          1.3m
          Posts

          2
          3
          147
          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