NEWS
Problemen mit Typ
-
javascript.0 2020-04-26 15:02:11.625 warn (30281) at script.js.DEV.a2:40:13 javascript.0 2020-04-26 15:02:11.625 warn (30281) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1354:20) javascript.0 2020-04-26 15:02:11.625 warn (30281) You are assigning a string to the state "javascript.0.Devices.ebus.currenterror.1.ErrorText" which expects a String. Please fix your code to use a String or change the state type to string. T javascript.0 2020-04-26 15:02:11.624 warn (30281) at script.js.DEV.a2:39:13 javascript.0 2020-04-26 15:02:11.624 warn (30281) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1354:20) javascript.0 2020-04-26 15:02:11.624 warn (30281) You are assigning a number to the state "javascript.0.Devices.ebus.currenterror.1.ErrorCode" which expects a Number. Please fix your code to use a Number or change the state type to number. TYou are assigning a string to the state "javascript.0.Devices.ebus.currenterror.1.ErrorText" which expects a String. Please fix your code to use a String or change the state type to string.
Was soll ich noch machen? Die gleiche Warnung erhalte ich bei number. Dabei spielt es keine Rolle ob ich ein number gebe oder sogar nach number konvertiere.
Was mache ich falsch?
for(var i=0; i<5; i++) { if (!getObject(storeDP + "." + i + ".ErrorCode")) { createState(storeDP + "." + i + ".ErrorCode", "", { "desc": "ErrorCode", "name": "ErrorCode", "type": "number", "role": "", "unit": "" }); } if (!getObject(storeDP + "." + i + ".ErrorText")) { createState(storeDP + "." + i + ".ErrorText", "", { "desc": "ErrorText", "name": "ErrorText", "type": "string", "role": "", "unit": "" }); } } for(i=0;i<5;i++) { stat = getState(id+"."+i+".value").val; if(stat){ setState(storeDP+"."+i+".ErrorCode", Number(stat)); setState(storeDP+"."+i+".ErrorText", meldungen.get(stat)); log(stat); log(meldungen.get(stat)); } } -
javascript.0 2020-04-26 15:02:11.625 warn (30281) at script.js.DEV.a2:40:13 javascript.0 2020-04-26 15:02:11.625 warn (30281) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1354:20) javascript.0 2020-04-26 15:02:11.625 warn (30281) You are assigning a string to the state "javascript.0.Devices.ebus.currenterror.1.ErrorText" which expects a String. Please fix your code to use a String or change the state type to string. T javascript.0 2020-04-26 15:02:11.624 warn (30281) at script.js.DEV.a2:39:13 javascript.0 2020-04-26 15:02:11.624 warn (30281) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1354:20) javascript.0 2020-04-26 15:02:11.624 warn (30281) You are assigning a number to the state "javascript.0.Devices.ebus.currenterror.1.ErrorCode" which expects a Number. Please fix your code to use a Number or change the state type to number. TYou are assigning a string to the state "javascript.0.Devices.ebus.currenterror.1.ErrorText" which expects a String. Please fix your code to use a String or change the state type to string.
Was soll ich noch machen? Die gleiche Warnung erhalte ich bei number. Dabei spielt es keine Rolle ob ich ein number gebe oder sogar nach number konvertiere.
Was mache ich falsch?
for(var i=0; i<5; i++) { if (!getObject(storeDP + "." + i + ".ErrorCode")) { createState(storeDP + "." + i + ".ErrorCode", "", { "desc": "ErrorCode", "name": "ErrorCode", "type": "number", "role": "", "unit": "" }); } if (!getObject(storeDP + "." + i + ".ErrorText")) { createState(storeDP + "." + i + ".ErrorText", "", { "desc": "ErrorText", "name": "ErrorText", "type": "string", "role": "", "unit": "" }); } } for(i=0;i<5;i++) { stat = getState(id+"."+i+".value").val; if(stat){ setState(storeDP+"."+i+".ErrorCode", Number(stat)); setState(storeDP+"."+i+".ErrorText", meldungen.get(stat)); log(stat); log(meldungen.get(stat)); } }@a200 sagte in Problemen mit Typ:
or change the state type to string.
ich habe da irgendwie den Verdacht, dass die bisherige sehr kryptische Fehlermeldung jetzt zwar länger ist, aber so nicht passt.
Welchen Typ hat denn der Datenpunkt?
-
javascript.0 2020-04-26 15:02:11.625 warn (30281) at script.js.DEV.a2:40:13 javascript.0 2020-04-26 15:02:11.625 warn (30281) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1354:20) javascript.0 2020-04-26 15:02:11.625 warn (30281) You are assigning a string to the state "javascript.0.Devices.ebus.currenterror.1.ErrorText" which expects a String. Please fix your code to use a String or change the state type to string. T javascript.0 2020-04-26 15:02:11.624 warn (30281) at script.js.DEV.a2:39:13 javascript.0 2020-04-26 15:02:11.624 warn (30281) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1354:20) javascript.0 2020-04-26 15:02:11.624 warn (30281) You are assigning a number to the state "javascript.0.Devices.ebus.currenterror.1.ErrorCode" which expects a Number. Please fix your code to use a Number or change the state type to number. TYou are assigning a string to the state "javascript.0.Devices.ebus.currenterror.1.ErrorText" which expects a String. Please fix your code to use a String or change the state type to string.
Was soll ich noch machen? Die gleiche Warnung erhalte ich bei number. Dabei spielt es keine Rolle ob ich ein number gebe oder sogar nach number konvertiere.
Was mache ich falsch?
for(var i=0; i<5; i++) { if (!getObject(storeDP + "." + i + ".ErrorCode")) { createState(storeDP + "." + i + ".ErrorCode", "", { "desc": "ErrorCode", "name": "ErrorCode", "type": "number", "role": "", "unit": "" }); } if (!getObject(storeDP + "." + i + ".ErrorText")) { createState(storeDP + "." + i + ".ErrorText", "", { "desc": "ErrorText", "name": "ErrorText", "type": "string", "role": "", "unit": "" }); } } for(i=0;i<5;i++) { stat = getState(id+"."+i+".value").val; if(stat){ setState(storeDP+"."+i+".ErrorCode", Number(stat)); setState(storeDP+"."+i+".ErrorText", meldungen.get(stat)); log(stat); log(meldungen.get(stat)); } } -
-
javascript.0 2020-04-26 15:02:11.625 warn (30281) at script.js.DEV.a2:40:13 javascript.0 2020-04-26 15:02:11.625 warn (30281) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1354:20) javascript.0 2020-04-26 15:02:11.625 warn (30281) You are assigning a string to the state "javascript.0.Devices.ebus.currenterror.1.ErrorText" which expects a String. Please fix your code to use a String or change the state type to string. T javascript.0 2020-04-26 15:02:11.624 warn (30281) at script.js.DEV.a2:39:13 javascript.0 2020-04-26 15:02:11.624 warn (30281) at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1354:20) javascript.0 2020-04-26 15:02:11.624 warn (30281) You are assigning a number to the state "javascript.0.Devices.ebus.currenterror.1.ErrorCode" which expects a Number. Please fix your code to use a Number or change the state type to number. TYou are assigning a string to the state "javascript.0.Devices.ebus.currenterror.1.ErrorText" which expects a String. Please fix your code to use a String or change the state type to string.
Was soll ich noch machen? Die gleiche Warnung erhalte ich bei number. Dabei spielt es keine Rolle ob ich ein number gebe oder sogar nach number konvertiere.
Was mache ich falsch?
for(var i=0; i<5; i++) { if (!getObject(storeDP + "." + i + ".ErrorCode")) { createState(storeDP + "." + i + ".ErrorCode", "", { "desc": "ErrorCode", "name": "ErrorCode", "type": "number", "role": "", "unit": "" }); } if (!getObject(storeDP + "." + i + ".ErrorText")) { createState(storeDP + "." + i + ".ErrorText", "", { "desc": "ErrorText", "name": "ErrorText", "type": "string", "role": "", "unit": "" }); } } for(i=0;i<5;i++) { stat = getState(id+"."+i+".value").val; if(stat){ setState(storeDP+"."+i+".ErrorCode", Number(stat)); setState(storeDP+"."+i+".ErrorText", meldungen.get(stat)); log(stat); log(meldungen.get(stat)); } }@a200 sagte:
"javascript.0.Devices.ebus.currenterror.1.ErrorText" which expects a String
"javascript.0.Devices.ebus.currenterror.1.ErrorCode" which expects a NumberDiese beiden Datenpunkte enthalten offenbar einen falsch geschriebenen common.type.
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden