NEWS
[gelöst]Fehler im log - Erstellung eines DPs
-
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 aufgefallenjavascript.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 -
@wszene
Beim default-Wert sind wohl die Anführungsstriche zuviel.'def':false
-
@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