MQTT sendet nicht

Alles was speziell mit der Anbindung der HomeMatic Zentrale und anderen Smart Home Zentralen zu tun hat. (FHEM, ioBroker usw.) Fragen Ideen und Erfolgsmeldungen.

Moderator: Ulrich

Kowi030
Beiträge: 6
Registriert: Mo 4. Sep 2023, 14:03

MQTT sendet nicht

Beitrag von Kowi030 »

Hallo Leute,

ich bin vor einigen Tagen durch Zufall bei Solaranzeige.de gelandet und war begeistert.
Die Installation auf dem Pi hat problemlos funktioniert, ebenso das Auslesen der Daten aus meinem 3kW Chinakracher über Modell 59 in Verbindung mit einem RS232 to USB Adapter.
Vielen Dank an dieser Stelle für die tollen Anleitungen.

Nun wollte ich jedoch die Daten per MQTT an meine Home assistant Installation senden (dort funktioniert der MQTT Server und bedient einige Tasmota Schalter), leider sendet die Solaranzeige nichts.
Wenn ich

Code: Alles auswählen

systemctl status mosquitto
eingebe, sehe ich ihn laufen (siehe Anhang)
Wenn ich

Code: Alles auswählen

mosquitto_sub -h localhost -v -t solaranzeige/box1/#
dann hängt Putty sich auf, bzw. es passiert nichts.
In der Config habe ich MQTT auf true gesetzt und natürlich auch Port, Username und Passwort eingetragen.

Was mache ich falsch?
Dateianhänge
mqtt_okay.JPG

Online
Benutzeravatar
Ulrich
Administrator
Beiträge: 5538
Registriert: Sa 7. Nov 2015, 10:33
Wohnort: Essen
Hat sich bedankt: 124 Mal
Danksagung erhalten: 834 Mal

Re: MQTT sendet nicht

Beitrag von Ulrich »

-----------------------------------------------------
Ulrich . . . . . . . . [Projekt Administrator]

Kowi030
Beiträge: 6
Registriert: Mo 4. Sep 2023, 14:03

Re: MQTT sendet nicht

Beitrag von Kowi030 »

Hallo Ulrich,

ich bin genau nach dieser Vorlage vorgegangen, einziger Unterschied ich logge per pi ein und nicht als root, macht das einen Unterschied?
Falls nicht, nach der Eingabe von

Code: Alles auswählen

mosquitto_sub -h localhost -v -t solaranzeige/box1/#
passiert gar nichts, in der Config habe ich keine bestimmten Werte eingetragen, sondern wollte alle zum HA schicken.

Gruß
Reiner

Online
Benutzeravatar
Ulrich
Administrator
Beiträge: 5538
Registriert: Sa 7. Nov 2015, 10:33
Wohnort: Essen
Hat sich bedankt: 124 Mal
Danksagung erhalten: 834 Mal

Re: MQTT sendet nicht

Beitrag von Ulrich »

Bitte gebe einmal folgendes ein:


mosquitto_sub -h localhost -v -t +/#
-----------------------------------------------------
Ulrich . . . . . . . . [Projekt Administrator]

Kowi030
Beiträge: 6
Registriert: Mo 4. Sep 2023, 14:03

Re: MQTT sendet nicht

Beitrag von Kowi030 »

Hallo Ulrich,

gleiches Problem bei

Code: Alles auswählen

mosquitto_sub -h localhost -v -t +/#
, siehe SS
mqtt_okay_neu.JPG
Ich habe die Config nachträglch bearbeitet und einen Neustart gemacht, kann es daran liegen?

Online
Benutzeravatar
Ulrich
Administrator
Beiträge: 5538
Registriert: Sa 7. Nov 2015, 10:33
Wohnort: Essen
Hat sich bedankt: 124 Mal
Danksagung erhalten: 834 Mal

Re: MQTT sendet nicht

Beitrag von Ulrich »

Nein, daran kann es nicht liegen. Die MQTT Daten kommen immer nur einmal pro Minute. Man muss etwas Geduld haben. So wie es aussieht ist aber MQTT in der user.config.php nicht (richtig) freigeschaltet. Schaue dir doch bitte noch einmal die user.config.php an.
-----------------------------------------------------
Ulrich . . . . . . . . [Projekt Administrator]

Kowi030
Beiträge: 6
Registriert: Mo 4. Sep 2023, 14:03

Re: MQTT sendet nicht

Beitrag von Kowi030 »

Hallo Ulrich, das mit der Wartezeit habe ich gelesen, aber auch nach 30 Minuten kommt nichts :(
Hier Mal der Auszug aus der Config:
$MQTT = true;
$MQTTBroker = "10.10.20.75";
$MQTTPort = 1883;
$MQTTBenutzer = "meinlogin";
$MQTTKennwort = "meinpassword";
$MQTTSSL = false;
$MQTTKeepAlive = 60;
$MQTTGeraet = "box1";
$MQTTAuswahl = "";

In der php Log Datei finden sich noch folgende Meldungen:

Code: Alles auswählen

Stack trace:
#0 /var/www/html/mqtt_prozess.php(185): Mosquitto\Client->loop()
#1 {main}
  thrown in /var/www/html/mqtt_prozess.php on line 185
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Netzspannung in /var/www/html/phpinc/funktionen.inc.php on line 759
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Netzfrequenz in /var/www/html/phpinc/funktionen.inc.php on line 760
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: AC_Ausgangsspannung in /var/www/html/phpinc/funktionen.inc.php on line 764
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: AC_Ausgangsfrequenz in /var/www/html/phpinc/funktionen.inc.php on line 765
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: AC_Scheinleistung in /var/www/html/phpinc/funktionen.inc.php on line 766
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: AC_Wirkleistung in /var/www/html/phpinc/funktionen.inc.php on line 767
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Ausgangslast in /var/www/html/phpinc/funktionen.inc.php on line 768
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Batteriespannung in /var/www/html/phpinc/funktionen.inc.php on line 772
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Batteriespannung in /var/www/html/phpinc/funktionen.inc.php on line 773
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Batterieladestrom in /var/www/html/phpinc/funktionen.inc.php on line 774
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Batteriekapazitaet in /var/www/html/phpinc/funktionen.inc.php on line 775
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Batterieentladestrom in /var/www/html/phpinc/funktionen.inc.php on line 776
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Solarspannung in /var/www/html/phpinc/funktionen.inc.php on line 781
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Solarstrom in /var/www/html/phpinc/funktionen.inc.php on line 782
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Solarleistung in /var/www/html/phpinc/funktionen.inc.php on line 783
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Temperatur in /var/www/html/phpinc/funktionen.inc.php on line 801
[11-Sep-2023 10:19:07 Europe/Berlin] PHP Notice:  Undefined index: Optionen in /var/www/html/phpinc/funktionen.inc.php on line 823
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Netzspannung in /var/www/html/phpinc/funktionen.inc.php on line 759
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Netzfrequenz in /var/www/html/phpinc/funktionen.inc.php on line 760
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: AC_Ausgangsspannung in /var/www/html/phpinc/funktionen.inc.php on line 764
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: AC_Ausgangsfrequenz in /var/www/html/phpinc/funktionen.inc.php on line 765
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: AC_Scheinleistung in /var/www/html/phpinc/funktionen.inc.php on line 766
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: AC_Wirkleistung in /var/www/html/phpinc/funktionen.inc.php on line 767
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Ausgangslast in /var/www/html/phpinc/funktionen.inc.php on line 768
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Batteriespannung in /var/www/html/phpinc/funktionen.inc.php on line 772
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Batteriespannung in /var/www/html/phpinc/funktionen.inc.php on line 773
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Batterieladestrom in /var/www/html/phpinc/funktionen.inc.php on line 774
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Batteriekapazitaet in /var/www/html/phpinc/funktionen.inc.php on line 775
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Batterieentladestrom in /var/www/html/phpinc/funktionen.inc.php on line 776
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Solarspannung in /var/www/html/phpinc/funktionen.inc.php on line 781
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Solarstrom in /var/www/html/phpinc/funktionen.inc.php on line 782
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Solarleistung in /var/www/html/phpinc/funktionen.inc.php on line 783
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Temperatur in /var/www/html/phpinc/funktionen.inc.php on line 801
[12-Sep-2023 03:53:07 Europe/Berlin] PHP Notice:  Undefined index: Optionen in /var/www/html/phpinc/funktionen.inc.php on line 823
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Netzspannung in /var/www/html/phpinc/funktionen.inc.php on line 759
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Netzfrequenz in /var/www/html/phpinc/funktionen.inc.php on line 760
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: AC_Ausgangsspannung in /var/www/html/phpinc/funktionen.inc.php on line 764
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: AC_Ausgangsfrequenz in /var/www/html/phpinc/funktionen.inc.php on line 765
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: AC_Scheinleistung in /var/www/html/phpinc/funktionen.inc.php on line 766
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: AC_Wirkleistung in /var/www/html/phpinc/funktionen.inc.php on line 767
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Ausgangslast in /var/www/html/phpinc/funktionen.inc.php on line 768
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Batteriespannung in /var/www/html/phpinc/funktionen.inc.php on line 772
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Batteriespannung in /var/www/html/phpinc/funktionen.inc.php on line 773
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Batterieladestrom in /var/www/html/phpinc/funktionen.inc.php on line 774
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Batteriekapazitaet in /var/www/html/phpinc/funktionen.inc.php on line 775
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Batterieentladestrom in /var/www/html/phpinc/funktionen.inc.php on line 776
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Solarspannung in /var/www/html/phpinc/funktionen.inc.php on line 781
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Solarstrom in /var/www/html/phpinc/funktionen.inc.php on line 782
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Solarleistung in /var/www/html/phpinc/funktionen.inc.php on line 783
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Temperatur in /var/www/html/phpinc/funktionen.inc.php on line 801
[13-Sep-2023 06:15:08 Europe/Berlin] PHP Notice:  Undefined index: Optionen in /var/www/html/phpinc/funktionen.inc.php on line 823
Gruß
Reiner

Online
Benutzeravatar
Ulrich
Administrator
Beiträge: 5538
Registriert: Sa 7. Nov 2015, 10:33
Wohnort: Essen
Hat sich bedankt: 124 Mal
Danksagung erhalten: 834 Mal

Re: MQTT sendet nicht

Beitrag von Ulrich »

Hallo Reiner,

du sendest doch gar nicht die Daten auf den Raspberry, sondern auf das Gerät mit der IP 10.10.20.75.
Dort musst du doch nachsehen, ob die Daten ankommen.
-----------------------------------------------------
Ulrich . . . . . . . . [Projekt Administrator]

Kowi030
Beiträge: 6
Registriert: Mo 4. Sep 2023, 14:03

Re: MQTT sendet nicht

Beitrag von Kowi030 »

Hallo Ulrich,

das ist ja das Problem, es kommt nichts an, MQTT funktioniert auf der 10.10.20.75 (auch ein Raspi mit HA) aber, da ich meine Tasmota Schalter auch darüber ansteuere.
In Home Assistant sollten die Signale sofort erkennbar sein wenn was kommt.

Gruß
Reiner

Kowi030
Beiträge: 6
Registriert: Mo 4. Sep 2023, 14:03

Re: MQTT sendet nicht

Beitrag von Kowi030 »

Sorry, Dein Ansatz hat mir zu denken geben, ich habe jetzt Mal den MQTT Explorer angeworfen und siehe da, die Daten kommen an, leider hat sie Home Assistant nicht automatisch erkannt.
Funktioniert also alles. Besten Dank für Deine Zeit.

Gruß
Reiner

Zurück zu „HomeMatic, FHEM, ioBroker, Smart Home Zentralen und Solaranzeige“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste