Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. GetState is not defined

    NEWS

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

    • Neues Video über Aliase, virtuelle Geräte und Kategorien

    • Wir empfehlen: Node.js 22.x

    GetState is not defined

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

      Moin Zusammen,

      ich würde gern den Status einer Lichtgruppe innerhalb von VIS auslesen und bekomme folgende Fehlermeldung:

      Uncaught ReferenceError: getState is not defined
      

      Folgende Scripte habe ich ausprobiert folgendermaßen aus:

        var state3 = getState('hue.0.Philips_hue.Büro.on').val;
                  console.log(state3); 
      
        var state2 = getState('hue.0.Philips_hue.Büro.on');
                  console.log(state2); 
      

      Objekt:

      ~~![](</s><URL url=)<link_text text="https://docs.google.com/uc?id=1IThhBDtH ... lQezT5mF48">https://docs.google.com/uc?id=1IThhBDtHEbMKu1eeboSpOxlQezT5mF48</link_text>" />

      Jemand eine Idee?

      Vielen Dank

      Mario~~

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

        Läuft das Skript im Javascript-Adapter ?

        1 Reply Last reply Reply Quote 0
        • M
          mario1001 last edited by

          Moin Paul,

          oh stimmt, das wird nicht deutlich. Nein, es läuft im VIS-Javascript per onmousedown (html-widget). Falls Du das meinst.

          VG

          Mario

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

            getState(id) gibt es nur im Javascript-Adapter.

            1 Reply Last reply Reply Quote 0
            • M
              mario1001 last edited by

              Danke. Sehr schade. Dachte getState wäre ebenso nutzbar wie getValue. Gibt es eine alternative Möglichkeit den Inhalt eines Datenpunkts im VIS-Javascript zu nutzen?

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

              Support us

              ioBroker
              Community Adapters
              Donate

              909
              Online

              32.1k
              Users

              80.7k
              Topics

              1.3m
              Posts

              2
              5
              988
              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