NEWS
*gelöst* wrong type of "number"
-
Hallo Zs,
ich habe ein problem mit einem Script für ein Wetterupload.
Es produziert bei jedem Durchlauf folgenden Fehler:javascript.0 2019-03-08 15:08:50.681 warn at TCP.onread (net.js:601:20) javascript.0 2019-03-08 15:08:50.681 warn at Socket.Readable.push (_stream_readable.js:208:10) javascript.0 2019-03-08 15:08:50.681 warn at readableAddChunk (_stream_readable.js:250:11) javascript.0 2019-03-08 15:08:50.681 warn at addChunk (_stream_readable.js:263:12) javascript.0 2019-03-08 15:08:50.681 warn at Socket.emit (events.js:211:7) javascript.0 2019-03-08 15:08:50.681 warn at emitOne (events.js:116:13) javascript.0 2019-03-08 15:08:50.681 warn at Socket._ultron.on (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/WebSocket.js:138:22) javascript.0 2019-03-08 15:08:50.681 warn at Receiver.add (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/Receiver.js:139:10) javascript.0 2019-03-08 15:08:50.681 warn at Receiver.startLoop (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/Receiver.js:165:16) javascript.0 2019-03-08 15:08:50.681 warn at Receiver.getData (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/Receiver.js:330:12) javascript.0 2019-03-08 15:08:50.681 warn at Receiver.dataMessage (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/Receiver.js:389:14) javascript.0 2019-03-08 15:08:50.681 warn at Receiver._receiver.onmessage (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/WebSocket.js:141:47) javascript.0 2019-03-08 15:08:50.680 warn at WebSocket.emit (events.js:211:7) javascript.0 2019-03-08 15:08:50.680 warn at emitOne (events.js:116:13) javascript.0 2019-03-08 15:08:50.680 warn at WebSocket.onMessage (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ws/lib/EventTarget.js:99:16) javascript.0 2019-03-08 15:08:50.680 warn at WebSocket.ws.onmessage (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/engine.io-client/lib/transports/websocket.js:147:10) javascript.0 2019-03-08 15:08:50.680 warn at WS.Transport.onData (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/engine.io-client/lib/transport.js:137:8) javascript.0 2019-03-08 15:08:50.680 warn at WS.Transport.onPacket (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/engine.io-client/lib/transport.js:145:8) javascript.0 2019-03-08 15:08:50.680 warn at WS.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-08 15:08:50.680 warn at WS.<anonymous> (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/engine.io-client/lib/socket.js:273:10) javascript.0 2019-03-08 15:08:50.680 warn at Socket.onPacket (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/engine.io-client/lib/socket.js:456:14) javascript.0 2019-03-08 15:08:50.680 warn at Socket.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-08 15:08:50.680 warn at Socket.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-08 15:08:50.680 warn at Manager.ondata (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/manager.js:335:16) javascript.0 2019-03-08 15:08:50.680 warn at Decoder.add (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-parser/index.js:251:12) javascript.0 2019-03-08 15:08:50.680 warn at Decoder.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-08 15:08:50.680 warn at Decoder.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-08 15:08:50.680 warn at Manager.ondecoded (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/manager.js:345:8) javascript.0 2019-03-08 15:08:50.680 warn at Manager.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-08 15:08:50.680 warn at Manager.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-08 15:08:50.680 warn at Socket.onpacket (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:236:12) javascript.0 2019-03-08 15:08:50.680 warn at Socket.onevent (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:278:10) javascript.0 2019-03-08 15:08:50.680 warn at Socket.Emitter.emit (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-08 15:08:50.680 warn at Socket.<anonymous> (/opt/iobroker/node_modules/iobroker.js-controller/lib/states/statesInMemClient.js:52:30) javascript.0 2019-03-08 15:08:50.680 warn at Object.change (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:3425:37) javascript.0 2019-03-08 15:08:50.680 warn at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:358:25) javascript.0 2019-03-08 15:08:50.680 warn at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:756:38) javascript.0 2019-03-08 15:08:50.680 warn at Object.<anonymous> (script.js.Schalter.wetterupload:9:3) javascript.0 2019-03-08 15:08:50.679 warn at setState (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1236:28) javascript.0 2019-03-08 15:08:50.679 warn Wrong type of mqtt.0.Wetterstation.Wetter.Fahrenheit: "number". Please fix, while deprecated and will not work in next versions.
Das script schaut so aus:
<block xmlns="http://www.w3.org/1999/xhtml" type="on_ext" id=";|^#zEAG3eOW*X~.5RQ." x="38" y="-263"> <mutation items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="_@px^Xq@{e^JtFJBE1x9"> <field name="oid">mqtt.0.Wetterstation.Wetter.Temperatur</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="EZVIxR{GacCGF89[vp%?"> <value name="IF0"> <block type="get_value" id="m*`#(rIK;e2n:LuE}O7H"> <field name="ATTR">val</field> <field name="OID">mqtt.0.Wetterstation.Wetter.Temperatur</field> </block> </value> <statement name="DO0"> <block type="variables_set" id="bP|8b60*bXdqM}hJSk*v"> <field name="VAR">TempC</field> <value name="VALUE"> <block type="get_value" id="}vFMoYXzWKiWs}Dlbe-w"> <field name="ATTR">val</field> <field name="OID">mqtt.0.Wetterstation.Wetter.Temperatur</field> </block> </value> <next> <block type="update" id="R0ROgqA^P[Y-HV^?su!J"> <mutation delay_input="false"></mutation> <field name="OID">mqtt.0.Wetterstation.Wetter.Fahrenheit</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_arithmetic" id="gD9[c}G/~8,L?8|IBdBA"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="o0RBo.MAL,O4onRazsgt"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="hF0OQP9?@p#-U+%Ro-!L"> <field name="OP">MULTIPLY</field> <value name="A"> <shadow type="math_number" id="o0RBo.MAL,O4onRazsgt"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="seB8D689)e+P;@eyy:L_"> <field name="VAR">TempC</field> </block> </value> <value name="B"> <shadow type="math_number" id="{zlvMLIeWAL%xBgRiS,@"> <field name="NUM">1.8</field> </shadow> </value> </block> </value> <value name="B"> <shadow type="math_number" id="dKtE?RYei+4iSI+uL;yz"> <field name="NUM">32</field> </shadow> </value> </block> </value> </block> </next> </block> </statement> </block> </statement> </block> <block xmlns="http://www.w3.org/1999/xhtml" type="on_ext" id=";|^#zEAG3eOW*X~.5RQ." x="38" y="-263"> <mutation items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="_@px^Xq@{e^JtFJBE1x9"> <field name="oid">mqtt.0.Wetterstation.Wetter.Temperatur</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="EZVIxR{GacCGF89[vp%?"> <value name="IF0"> <block type="get_value" id="m*`#(rIK;e2n:LuE}O7H"> <field name="ATTR">val</field> <field name="OID">mqtt.0.Wetterstation.Wetter.Temperatur</field> </block> </value> <statement name="DO0"> <block type="variables_set" id="bP|8b60*bXdqM}hJSk*v"> <field name="VAR">TempC</field> <value name="VALUE"> <block type="get_value" id="}vFMoYXzWKiWs}Dlbe-w"> <field name="ATTR">val</field> <field name="OID">mqtt.0.Wetterstation.Wetter.Temperatur</field> </block> </value> <next> <block type="update" id="R0ROgqA^P[Y-HV^?su!J"> <mutation delay_input="false"></mutation> <field name="OID">mqtt.0.Wetterstation.Wetter.Fahrenheit</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_arithmetic" id="gD9[c}G/~8,L?8|IBdBA"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="o0RBo.MAL,O4onRazsgt"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="hF0OQP9?@p#-U+%Ro-!L"> <field name="OP">MULTIPLY</field> <value name="A"> <shadow type="math_number" id="o0RBo.MAL,O4onRazsgt"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="seB8D689)e+P;@eyy:L_"> <field name="VAR">TempC</field> </block> </value> <value name="B"> <shadow type="math_number" id="{zlvMLIeWAL%xBgRiS,@"> <field name="NUM">1.8</field> </shadow> </value> </block> </value> <value name="B"> <shadow type="math_number" id="dKtE?RYei+4iSI+uL;yz"> <field name="NUM">32</field> </shadow> </value> </block> </value> </block> </next> </block> </statement> </block> </statement> </block>
Es rechnet einen Wert in Celsius in Fahrenheit um den ich für einen upload zu einem Wetterservice benötige.
Ich habe schon versucht den Matheblock hinter einen "erstelle Text aus " zu hängen, klappt aber auch nicht. Hat jemand einen Tipp für mich?Dank Euch!
-
@SoerenKaiser99 Wie ist denn der Datenpunkt formatiert (Zeichenkette, Zahl, Feld,...)? Entweder diesen richtig stellen, oder den Wert vor dem Schreiben konvertieren.
-
dank dir! Hab den Datenpunkt auf "gemischt" umgestellt und der Fehler ist weg!