Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [gelöst]Fehler im log - Erstellung eines DPs

    NEWS

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

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    [gelöst]Fehler im log - Erstellung eines DPs

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

      Hallo Zusammen,

      Ich lege in einem Blockly via Javascript einen DP an

      ['001_Alexa.01_Stube.Lampen.Stehlampe', {'name':'Stehlampe', 'type':'boolean', 'read':true, 'write':true, 'role':'switch', 'def':'false', "smartName": {"de": Alexa_SmartName_Stehlampe,"smartType": "LIGHT"} }],
      

      Das funktioniert auch
      jetzt habe ich meinen Broker auf v.4 geupdatet und mir ist folgendes im log aufgefallen

      
      javascript.0
      2022-02-09 08:46:10.988	warn	at processTimers (internal/timers.js:500:7)
      
      javascript.0
      2022-02-09 08:46:10.988	warn	at listOnTimeout (internal/timers.js:557:17)
      
      javascript.0
      2022-02-09 08:46:10.988	warn	at Timeout._onTimeout (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:2117:34)
      
      javascript.0
      2022-02-09 08:46:10.988	warn	at Object.<anonymous> (script.js.01-Stube.Lampen.Stehlampe_-_An_Aus:115:29)
      
      javascript.0
      2022-02-09 08:46:10.988	warn	at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1437:20)
      
      javascript.0
      2022-02-09 08:46:10.987	warn	You are assigning a string to the state "0_userdata.0.001_Alexa.01_Stube.Lampen.Stehlampe" 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.
      
      javascript.0
      2022-02-09 08:46:10.933	warn	This object will not be created in future versions. Please report this to the developer.
      
      javascript.0
      2022-02-09 08:46:10.933	warn	Object 0_userdata.0.001_Alexa.01_Stube.Lampen.Stehlampe is invalid: Default value has to be type "boolean" but received type "string"
      

      Wenn ich jetzt im Blockly die Änderung von "boolean" auf "string" vornehme ist die Meldung weg

      Wenn ich nun die Lampe schalte dann bekomme ich aber folgende Meldung im log

      iot.0
      2022-02-09 08:53:12.859	info	State value to set for "0_userdata.0.001_Alexa.01_Stube.Lampen.Stehlampe" has to be type "string" but received type "boolean"
      

      Kann mir evtl. jemand sagen wo mein Fehler ist?

      Danke im Voraus
      Gruß
      Marcel

      M 1 Reply Last reply Reply Quote 0
      • M
        mrjeschke @Wszene last edited by

        @wszene
        Beim default-Wert sind wohl die Anführungsstriche zuviel.

        'def':false
        
        Wszene 1 Reply Last reply Reply Quote 0
        • Wszene
          Wszene @mrjeschke last edited by

          @maik-0 sagte in Fehler im log - Erstellung eines DPs:

          @wszene
          Beim default-Wert sind wohl die Anführungsstriche zuviel.

          'def':false
          

          Vielen Dank
          Genau das war der Fehler

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

          Support us

          ioBroker
          Community Adapters
          Donate

          805
          Online

          32.0k
          Users

          80.5k
          Topics

          1.3m
          Posts

          blockly javascript
          2
          3
          118
          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