PHP Fehler bei mehreren Tasmotageräten
Verfasst: Fr 18. Nov 2022, 11:21
Grüß ecuh,
ich habe in meiner Anlage u.a. mehrere Tasmotadevices im Einsatz.
Wenn ich jedes alleine für sich betreibe funktioniert alles soweit.
Werden beide abgearbeitet, dann spiesst es sich beim zweiten Gerät mit PHP-Hinweisen.
PHP Notice: Undefined index: MQTTMessageReturnText in /var/www/html/sonoff_mqtt.php on line 159
PHP Notice: Undefined index: MQTTNachricht in /var/www/html/sonoff_mqtt.php on line 166
PHP Notice: Undefined index: MQTTTopic in /var/www/html/sonoff_mqtt.php on line 167
PHP Notice: Undefined index: MQTTNachricht in /var/www/html/sonoff_mqtt.php on line 168
PHP Notice: Undefined index: MQTTNachricht in /var/www/html/sonoff_mqtt.php on line 186
Problem:
In der sonoff_mqtt.php ist anscheinend die Variable $TopicTeile beim 2. Aufruf noch gesetzt, und er arbeitet die If-Abfrage ab, hat aber keine MQTT-Daten
if ((isset($MQTTDaten["MQTTMessageReturnText"]) and $MQTTDaten["MQTTMessageReturnText"] == "RX-OK") or isset($TopicTeile))
Meine Lösung:
Am Schluss habe ich die Variable gelöscht mit
unset($TopicTeile);
und den Client ordnungsgemäß mit
$rc = $client->disconnect();
geschlossen.
Falls mal wer das gleiche Problem hat.
LG,
Michael
ich habe in meiner Anlage u.a. mehrere Tasmotadevices im Einsatz.
Wenn ich jedes alleine für sich betreibe funktioniert alles soweit.
Werden beide abgearbeitet, dann spiesst es sich beim zweiten Gerät mit PHP-Hinweisen.
PHP Notice: Undefined index: MQTTMessageReturnText in /var/www/html/sonoff_mqtt.php on line 159
PHP Notice: Undefined index: MQTTNachricht in /var/www/html/sonoff_mqtt.php on line 166
PHP Notice: Undefined index: MQTTTopic in /var/www/html/sonoff_mqtt.php on line 167
PHP Notice: Undefined index: MQTTNachricht in /var/www/html/sonoff_mqtt.php on line 168
PHP Notice: Undefined index: MQTTNachricht in /var/www/html/sonoff_mqtt.php on line 186
Problem:
In der sonoff_mqtt.php ist anscheinend die Variable $TopicTeile beim 2. Aufruf noch gesetzt, und er arbeitet die If-Abfrage ab, hat aber keine MQTT-Daten
if ((isset($MQTTDaten["MQTTMessageReturnText"]) and $MQTTDaten["MQTTMessageReturnText"] == "RX-OK") or isset($TopicTeile))
Meine Lösung:
Am Schluss habe ich die Variable gelöscht mit
unset($TopicTeile);
und den Client ordnungsgemäß mit
$rc = $client->disconnect();
geschlossen.
Falls mal wer das gleiche Problem hat.
LG,
Michael