Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. Fehlermeldung " use a boolean or change the state"

    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

    Fehlermeldung " use a boolean or change the state"

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

      [gelöst] ich benötige Hilfe bei folgender Fehlermeldung:

      You are assigning a string to the state "hm-rega.0.4002" which expects a boolean. Please fix your code to use a boolean or change the state type to string. This warning might become an error in future versions.
      

      Ich habe diese Variable hier definiert:

      var idAnsageAlexaBadezimmer = 'hm-rega.0.4002'/*AnsageAlexaBadezimmer*/;
      

      und an dieser Stelle im Skript kommt die Fehlermeldung:

      setState(idAnsageAlexaBadezimmer,"false");
      

      Was mache ich falsch? Danke für Eure (Nach-)Hilfe!

      AlCalzone 1 Reply Last reply Reply Quote 0
      • AlCalzone
        AlCalzone Developer @skorpil last edited by AlCalzone

        @skorpil

        You are assigning a string to the state "hm-rega.0.4002" which expects a boolean.

        "false" in Anführungszeichen ist eine Zeichenkette (string).
        Du musst false (ohne Anführungszeichen, boolean) nutzen.

        Am besten mal ein bisschen mit den Grundlagen vertraut machen: https://developer.mozilla.org/de/docs/Web/JavaScript/Data_structures

        S 1 Reply Last reply Reply Quote 1
        • S
          skorpil @AlCalzone last edited by

          @alcalzone Dankeschön. Mache ich!

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

          Support us

          ioBroker
          Community Adapters
          Donate

          769
          Online

          31.8k
          Users

          80.0k
          Topics

          1.3m
          Posts

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