<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MQTT Adapter als Client Upgrade auf 4.0.0]]></title><description><![CDATA[<p dir="auto">Also,</p>
<p dir="auto">ich nutze einen Mosquitto als MQTT Broker und den MQTT Adapter als Client.<br />
Nach einem Upgrade auf 4.0.0 sieht es aus 2 Gründen düster aus:</p>
<ol>
<li>Konvertiert der Adapter nach dem Update jede Menge Datenpunkte von Zahl zu Text:</li>
</ol>
<pre><code>2022-05-13 08:58:51.048  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow146.sensor.tilt" from "number" to "string"
2022-05-13 08:58:51.048  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow146.sensor.vibration" from "number" to "string"
2022-05-13 08:58:51.049  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow146.sensor.temperature" from "number" to "string"
2022-05-13 08:58:51.049  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow146.sensor.lux" from "number" to "string"
2022-05-13 08:58:51.128  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow146.sensor.battery" from "number" to "string"
2022-05-13 08:58:51.129  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow146.sensor.error" from "number" to "string"
2022-05-13 08:58:51.130  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow147.sensor.tilt" from "number" to "string"
2022-05-13 08:58:51.130  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow147.sensor.vibration" from "number" to "string"
2022-05-13 08:58:51.130  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow147.sensor.temperature" from "number" to "string"
2022-05-13 08:58:51.131  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow147.sensor.lux" from "number" to "string"
2022-05-13 08:58:51.131  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow147.sensor.battery" from "number" to "string"
2022-05-13 08:58:51.131  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow147.sensor.error" from "number" to "string"
2022-05-13 08:58:51.132  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow148.sensor.tilt" from "number" to "string"
2022-05-13 08:58:51.132  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow148.sensor.vibration" from "number" to "string"
2022-05-13 08:58:51.133  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow148.sensor.temperature" from "number" to "string"
2022-05-13 08:58:51.133  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow148.sensor.lux" from "number" to "string"
2022-05-13 08:58:51.134  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow148.sensor.battery" from "number" to "string"
2022-05-13 08:58:51.134  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.DoorWindow148.sensor.error" from "number" to "string"
2022-05-13 08:58:51.134  - info: mqtt.0 (1611075) Client: Changed type of "mqtt.0.shellies.shellydw2-146.sensor.tilt" from "number" to "string"
</code></pre>
<p dir="auto">Ja, und natürlich beschweren sich seit dem jede Menge Skripte das es nun nicht mehr mit den Formaten passt, unter anderem der SourceAnalytics, aber auch viele meiner Blockly-Skripte:</p>
<pre><code>2022-05-13 08:59:30.005  - warn: javascript.1 (2008) You are assigning a string to the state "0_userdata.0.shellies.3EM-Stromzaehler.Total-Power" which expects a number. Please fix your code to use a number or change the state type to string. This warning might become an error in future versions.
2022-05-13 09:02:41.181  - error: sql.0 (1607169) Cannot insert INSERT INTO `iobroker`.ts_number (id, ts, val, ack, _from, q) VALUES (undefined, 1652424760996, NULL, 1, 2, 64),(undefined, 1652424820072, 14303, 1, 1, 0),(undefined, 1652425239392, 14303, 1, 1, 0);: Error: Unknown column 'undefined' in 'field list' (id: mqtt.0.esp32.esp32gas.zaehlerstand)
2022-05-13 09:02:32.449  - info: sourceanalytix.0 (1275363) Updating SourceAnalytix configuration for : mqtt.0.esp32.esp32gas.zaehlerstand
2022-05-13 09:02:34.411  - error: sourceanalytix.0 (1275363) Input value for mqtt.0.esp32.esp32gas.zaehlerstand, type = string but should be a number, cannot handle calculation
</code></pre>
<ol start="2">
<li>Noch schlimmer ist das das Senden von States nun auch fehlschlägt, zum Beispiel das Senden von "ON" an ein tasmota-gerät:</li>
</ol>
<pre><code>2022-05-13 09:09:34.861  - info: mqtt.0 (1617963) starting. Version 4.0.0 in /opt/iobroker/node_modules/iobroker.mqtt, node: v14.19.2, js-controller: 4.0.23
2022-05-13 09:09:35.258  - info: mqtt.0 (1617963) Try to connect to mqtt://127.0.0.1:1883 with clientId=mqtt.mqtt.0and credentials mqtt:*******************
2022-05-13 09:09:35.306  - info: mqtt.0 (1617963) Connected to 127.0.0.1
2022-05-13 09:09:35.308  - info: mqtt.0 (1617963) Subscribe on "#"
2022-05-13 09:09:59.720  - info: mqtt.0 (1617963) send2Server mqtt.0.cmnd.K51-Buero-Licht.POWER[undefined]
2022-05-13 09:09:59.724  - info: mqtt.0 (1617963) send2Server mqtt.0.cmnd.K51-Buero-Licht.POWER[cmnd/K51-Buero-Licht/POWER]
2022-05-13 09:09:59.726  - error: mqtt.0 (1617963) uncaught exception: Cannot read property 'obj' of undefined
2022-05-13 09:09:59.727  - error: mqtt.0 (1617963) TypeError: Cannot read property 'obj' of undefined
    at publishMessage (/opt/iobroker/node_modules/iobroker.mqtt/lib/client.js:95:29)
    at send2Server (/opt/iobroker/node_modules/iobroker.mqtt/lib/client.js:77:9)
    at Immediate.&lt;anonymous&gt; (/opt/iobroker/node_modules/iobroker.mqtt/lib/client.js:57:17)
    at processImmediate (internal/timers.js:466:21)
2022-05-13 09:09:59.728  - error: mqtt.0 (1617963) Cannot read property 'obj' of undefined
2022-05-13 09:09:59.729  - error: mqtt.0 (1617963) uncaughtException: TypeError: Cannot read property 'obj' of undefined
2022-05-13 09:09:59.744  - info: mqtt.0 (1617963) Disconnected from 127.0.0.1: undefined
2022-05-13 09:10:00.238  - info: mqtt.0 (1617963) terminating
2022-05-13 09:10:00.240  - warn: mqtt.0 (1617963) Terminated (UNCAUGHT_EXCEPTION): Without reason
2022-05-13 09:10:00.915  - error: host.iobroker instance system.adapter.mqtt.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
</code></pre>
<p dir="auto">Ich habe erst einmal mein Backup getestet und die ganze VM zurück auf vor dem Upgrade gesetzt.<br />
Die gute Nachricht ist: Mein Backup funktioniert einwandfrei :-)</p>
<p dir="auto">Bei den problemen weis ich gar nicht wo ich anfangen soll. In meinen Skripten müsste ich sicherstellen das Zahlen auch immer als Zahlen geschrieben werden, ok. Warum er aus den "number" nun "Strings" macht, keine Ahnung. Das kann ich auch noch mühsam von hand Rückgängig machen und überlebt wohl den Neustart.<br />
Aber warum das Publishen nicht geht .. keine Ahnung.</p>
<p dir="auto">Ich bin ja gewillt auf GitHub ein Issue zu eröffnen, im Moment wäre aber meine Fehlerbeschreibung nicht besser als obiges.</p>
]]></description><link>https://forum.iobroker.net/topic/54868/mqtt-adapter-als-client-upgrade-auf-4-0-0</link><generator>RSS for Node</generator><lastBuildDate>Thu, 21 May 2026 13:26:39 GMT</lastBuildDate><atom:link href="https://forum.iobroker.net/topic/54868.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 13 May 2022 07:27:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MQTT Adapter als Client Upgrade auf 4.0.0 on Fri, 13 May 2022 07:47:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bananajoe" aria-label="Profile: bananajoe">@<bdi>bananajoe</bdi></a> Und für den Crash auch:<br />
<a href="https://github.com/ioBroker/ioBroker.mqtt/issues/290" rel="nofollow ugc">https://github.com/ioBroker/ioBroker.mqtt/issues/290</a></p>
]]></description><link>https://forum.iobroker.net/post/801535</link><guid isPermaLink="true">https://forum.iobroker.net/post/801535</guid><dc:creator><![CDATA[BananaJoe]]></dc:creator><pubDate>Fri, 13 May 2022 07:47:22 GMT</pubDate></item><item><title><![CDATA[Reply to MQTT Adapter als Client Upgrade auf 4.0.0 on Fri, 13 May 2022 07:41:19 GMT]]></title><description><![CDATA[<p dir="auto">Für das Umwandeln habe ich ein Issue eröffnet:<br />
<a href="https://github.com/ioBroker/ioBroker.mqtt/issues/289" rel="nofollow ugc">https://github.com/ioBroker/ioBroker.mqtt/issues/289</a></p>
]]></description><link>https://forum.iobroker.net/post/801532</link><guid isPermaLink="true">https://forum.iobroker.net/post/801532</guid><dc:creator><![CDATA[BananaJoe]]></dc:creator><pubDate>Fri, 13 May 2022 07:41:19 GMT</pubDate></item></channel></rss>