Problème lancement module MQTT

Mon problème

Bonjour,
en essayant de refaire ma configuration zigbee/Z2M, je me rends compte que mon module MQTT mosquito broker ne se « connecte » plus.
et donc quand j’installe ZigbeetoMQTT, il ne trouve pas mqtt
J’ai beau chercher, je ne trouve pas le problème ni la solution

Merci

image

Pourtant, dans les "Appareils et services, MQTT fonctionne :
image

Voici la configuration de Mosquitto broker :

logins:
  - username: Cédric
    password: XXX
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
  active: false
  folder: mosquitto

Le journal me dit ceci :

2024-05-10 14:34:39: New connection from 10.0.0.15:59467 on port 1883.
2024-05-10 14:34:39: New client connected from 10.0.0.15:59467 as 2C7d9GWvhnTLLbvzYh5Hsa (p2, c1, k60, u’Cédric’).
2024-05-10 14:34:39: Client 2C7d9GWvhnTLLbvzYh5Hsa disconnected.
2024-05-10 14:34:42: New connection from 10.0.0.15:55981 on port 1883.
2024-05-10 14:34:42: New client connected from 10.0.0.15:55981 as 22qSpzAN48mMWrBavDrFEf (p2, c1, k60, u’Cédric’).
2024-05-10 14:36:18: Client 0bm9le8HsAunpmhb4Yv7rE has exceeded timeout, disconnecting.
2024-05-10 14:37:50: Saving in-memory database to /data//mosquitto.db.
2024-05-10 14:54:59: New connection from 10.0.0.46:61728 on port 1883.
2024-05-10 14:54:59: New client connected from 10.0.0.46:61728 as mqtt-explorer-41ee81b4 (p2, c1, k60, u’Cédric’).
2024-05-10 14:55:19: Client mqtt-explorer-41ee81b4 disconnected.

Quand j’utilise MQTT Explore ca me donne ceci et ca semble fonctionner :

image

Salut, es-tu sur que ton problème vient de MQTT? tu as quoi dans les journaux?

le journal de mqtt :

2024-05-10 14:34:39: New connection from 10.0.0.15:59467 on port 1883.
2024-05-10 14:34:39: New client connected from 10.0.0.15:59467 as 2C7d9GWvhnTLLbvzYh5Hsa (p2, c1, k60, u’Cédric’).
2024-05-10 14:34:39: Client 2C7d9GWvhnTLLbvzYh5Hsa disconnected.
2024-05-10 14:34:42: New connection from 10.0.0.15:55981 on port 1883.
2024-05-10 14:34:42: New client connected from 10.0.0.15:55981 as 22qSpzAN48mMWrBavDrFEf (p2, c1, k60, u’Cédric’).
2024-05-10 14:36:18: Client 0bm9le8HsAunpmhb4Yv7rE has exceeded timeout, disconnecting.
2024-05-10 14:37:50: Saving in-memory database to /data//mosquitto.db.
2024-05-10 14:54:59: New connection from 10.0.0.46:61728 on port 1883.
2024-05-10 14:54:59: New client connected from 10.0.0.46:61728 as mqtt-explorer-41ee81b4 (p2, c1, k60, u’Cédric’).
2024-05-10 14:55:19: Client mqtt-explorer-41ee81b4 disconnected.
2024-05-10 15:07:51: Saving in-memory database to /data//mosquitto.db.
2024-05-10 15:37:52: Saving in-memory database to /data//mosquitto.db.

Le journal de HA :

Enregistreur: homeassistant.components.mqtt.client
Source: components/mqtt/client.py:1107
intégration: MQTT (documentation, problèmes)
S’est produit pour la première fois: 14:36:18 (1 occurrences)
Dernier enregistrement: 14:36:18

Disconnected from MQTT server core-mosquitto:1883 (7)

tu as créé une personne pour le broker?

non, j’avais repris ma personne

=> j’ai créé mqtt_adm pass : mqtt

j’ai désintaller mqtt mosquitto, relancé HA
reinstaller mosquitto
puis démarré => appareil et service : configurer mqtt

je retourne dans module complémentaire
je vais dans config :

logins:
  - username: mqtt_adm
    password: mqtt
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
  active: false
  folder: mosquitto

et ca marche pas

voici le journal :

[16:50:55] INFO: Successfully send discovery information to Home Assistant.
[16:50:56] INFO: Successfully send service information to the Supervisor.
2024-05-10 16:51:59: New connection from 172.30.32.1:33101 on port 1883.
2024-05-10 16:51:59: New client connected from 172.30.32.1:33101 as 6Mc4kaUUcy7qEOtC64uaCz (p2, c1, k60, u’homeassistant’).
2024-05-10 16:51:59: Client 6Mc4kaUUcy7qEOtC64uaCz disconnected.
2024-05-10 16:51:59: New connection from 172.30.32.1:58459 on port 1883.
2024-05-10 16:51:59: New client connected from 172.30.32.1:58459 as 7BKLcZGsov4TSd7ML0De7z (p2, c1, k60, u’homeassistant’).
2024-05-10 16:52:17: New connection from 10.0.0.15:47319 on port 1883.
2024-05-10 16:52:17: New client connected from 10.0.0.15:47319 as 2Rr77HmPW1EduhUjvNM1kZ (p2, c1, k60, u’mqtt_adm’).
2024-05-10 16:52:17: Client 2Rr77HmPW1EduhUjvNM1kZ disconnected.
2024-05-10 16:52:22: New connection from 10.0.0.15:49219 on port 1883.
2024-05-10 16:52:22: New client connected from 10.0.0.15:49219 as 50fUv0tpotYGrEYcwpwENA (p2, c1, k60, u’mqtt_adm’).
2024-05-10 16:53:06: New connection from 10.0.0.46:57932 on port 1883.
2024-05-10 16:53:06: Client mqtt-explorer-41ee81b4 disconnected, not authorised.
2024-05-10 16:53:13: New connection from 10.0.0.46:57954 on port 1883.
2024-05-10 16:53:13: New client connected from 10.0.0.46:57954 as mqtt-explorer-41ee81b4 (p2, c1, k60, u’mqtt_adm’).
2024-05-10 16:53:53: Client 7BKLcZGsov4TSd7ML0De7z has exceeded timeout, disconnecting.

Citation

journal de HA :

Enregistreur: homeassistant.components.mqtt.client
Source: components/mqtt/client.py:1107
intégration: MQTT (documentation, problèmes)
S’est produit pour la première fois: 16:53:53 (1 occurrences)
Dernier enregistrement: 16:53:53

Disconnected from MQTT server core-mosquitto:1883 (7)

Bonjour

dans ma configuration de mosquito broker, je n’ai rien dans logins

logins: []
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
  active: false
  folder: mosquitto

Ça ne vient peut-être pas de ça, mais tu peux toujours essayer.

Tu as probablement un conflit entre le nom d’utilisateur et le mot de passe de MQTT et celui enregistré sur Z2M. Il faut vérifier d’une part ce que tu as dans ton fichier « configuration.yaml » du répertoire zigbee2mqtt, d’autre part ce que tu as dans l’intégration MQTT (cliquer sur « CONFIGURER » puis « RE-CONFIGURER MQTT » et comparer.

Sinon, comme le dit @pascal_ha il n’y a plus besoin de configurer le nom d’utilisateur et le mot de passe dans Mosquitto. Tu peux donc enlever ces deux lignes et redémarrer l’add-on (Mosquitto Broker).

Poste ici ce que tu as dans ton fichier « configuration.yaml » du répertoire zigbee2mqtt et ce que tu as dans ton intégration MQTT.

Si le nom d’utilisateur inscrit dans ton fichier « configuration.yaml » est différent de celui de MQTT et idem pour le mot de passe, il faudra les remplacer par ceux de MQTT, sauvegarder le fichier puis supprimer ce qu’il y a dans le paragraphe logins de Mosquitto, arrêter l’add-on et redémarrer HA.

Il faudra peut être supprimer aussi le fichier « coordinator_backup.json » du répertoire zigbee2mqtt.

Sinon, si ton problème principal c’est l’installation de Z2M, je te conseille ce tuto:

je viens de ce tuto là à la base justement

C’est partir de la que j’ai remarqué que j’avais perdu la connexion à mqtt mosquitto

je dois aller au travail
je regarderai du weekend
Merci

1 « J'aime »

En effet, les user et password n’étaient pas les memes

homeassistant: true
advanced:
  network_key:
    - 222
    - 187
    - 238
    - 66
    - 26
    - 40
    - 149
    - 138
    - 40
    - 128
    - 229
    - 207
    - 246
    - 47
    - 165
    - 212
  pan_id: 51429
  ext_pan_id:
    - 235
    - 170
    - 71
    - 124
    - 204
    - 249
    - 60
    - 212
mqtt:
  server: mqtt://10.0.0.15:1883  ***[u](au lieu de core.mosquitto)[/u]***
  user: addons
  password: woolarei6theleeph2haivei2gu8phaig5uTh7AhGoo8ib6Io7eichiiyaexuQue
frontend:
  port: 8099

j’ai changé le user et pass en mqtt_adm et son pass,
enregistré
supprimé les login dans la configuration de Mosquitto Broker,
je relance HA

Ca ne marche poas :

journal de mosquitto :

s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/mosquitto.sh
[18:08:42] INFO: Setting up user Cédric
[18:08:43] INFO: Certificates found: SSL is available
cont-init: info: /etc/cont-init.d/mosquitto.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun mosquitto (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
[18:08:44] INFO: Starting NGINX for authentication handling…
s6-rc: info: service legacy-services successfully started
[18:08:45] INFO: Starting mosquitto MQTT broker…
2024-05-10 18:08:45: Warning: Mosquitto should not be run as root/administrator.
2024-05-10 18:08:45: mosquitto version 2.0.18 starting
2024-05-10 18:08:45: Config loaded from /etc/mosquitto/mosquitto.conf.
2024-05-10 18:08:45: Loading plugin: /usr/share/mosquitto/go-auth.so
2024-05-10 18:08:45: ├── Username/password checking enabled.
2024-05-10 18:08:45: ├── TLS-PSK checking enabled.
2024-05-10 18:08:45: └── Extended authentication not enabled.
2024-05-10 18:08:45: Opening ipv4 listen socket on port 1883.
2024-05-10 18:08:45: Opening ipv6 listen socket on port 1883.
2024-05-10 18:08:45: Opening websockets listen socket on port 1884.
2024-05-10 18:08:45: Opening ipv4 listen socket on port 8883.
2024-05-10 18:08:45: Opening ipv6 listen socket on port 8883.
2024-05-10 18:08:45: Opening websockets listen socket on port 8884.
2024-05-10 18:08:45: mosquitto version 2.0.18 running
2024-05-10 18:08:45: New connection from 127.0.0.1:50940 on port 1883.
2024-05-10 18:08:45: Client disconnected due to protocol error.
[18:08:46] INFO: Successfully send discovery information to Home Assistant.
2024-05-10 18:08:46: New connection from 10.0.0.46:62835 on port 1883.
2024-05-10 18:08:46: Client mqtt-explorer-41ee81b4 disconnected, not authorised.
[18:08:47] INFO: Successfully send service information to the Supervisor.
2024-05-10 18:11:23: New connection from 172.30.32.1:34771 on port 1883.
2024-05-10 18:11:23: New client connected from 172.30.32.1:34771 as 5lKb7RHUEFq0OB45ieU0dP (p2, c1, k60, u’homeassistant’).
2024-05-10 18:38:46: Saving in-memory database to /data//mosquitto.db.
2024-05-10 19:08:47: Saving in-memory database to /data//mosquitto.db.
2024-05-10 19:38:48: Saving in-memory database to /data//mosquitto.db.
2024-05-10 20:08:49: Saving in-memory database to /data//mosquitto.db.
2024-05-10 20:38:50: Saving in-memory database to /data//mosquitto.db.
2024-05-10 21:08:51: Saving in-memory database to /data//mosquitto.db.
2024-05-10 21:38:52: Saving in-memory database to /data//mosquitto.db.
2024-05-10 22:08:53: Saving in-memory database to /data//mosquitto.db.
2024-05-10 22:38:54: Saving in-memory database to /data//mosquitto.db.
2024-05-10 23:08:55: Saving in-memory database to /data//mosquitto.db.
2024-05-10 23:38:56: Saving in-memory database to /data//mosquitto.db.
2024-05-11 00:08:57: Saving in-memory database to /data//mosquitto.db.
2024-05-11 00:38:58: Saving in-memory database to /data//mosquitto.db.
2024-05-11 01:08:59: Saving in-memory database to /data//mosquitto.db.
2024-05-11 01:39:00: Saving in-memory database to /data//mosquitto.db.
2024-05-11 02:09:01: Saving in-memory database to /data//mosquitto.db.
2024-05-11 02:39:02: Saving in-memory database to /data//mosquitto.db.
2024-05-11 03:09:03: Saving in-memory database to /data//mosquitto.db.
2024-05-11 03:39:04: Saving in-memory database to /data//mosquitto.db.
2024-05-11 04:09:05: Saving in-memory database to /data//mosquitto.db.
2024-05-11 04:39:06: Saving in-memory database to /data//mosquitto.db.
2024-05-11 05:09:07: Saving in-memory database to /data//mosquitto.db.
2024-05-11 05:39:08: Saving in-memory database to /data//mosquitto.db.
2024-05-11 06:09:09: Saving in-memory database to /data//mosquitto.db.
2024-05-11 06:39:10: Saving in-memory database to /data//mosquitto.db.
2024-05-11 07:09:11: Saving in-memory database to /data//mosquitto.db.
2024-05-11 07:39:12: Saving in-memory database to /data//mosquitto.db.
2024-05-11 08:09:13: Saving in-memory database to /data//mosquitto.db.
2024-05-11 08:39:14: Saving in-memory database to /data//mosquitto.db.
2024-05-11 09:09:15: Saving in-memory database to /data//mosquitto.db.
2024-05-11 09:39:16: Saving in-memory database to /data//mosquitto.db.
2024-05-11 10:09:17: Saving in-memory database to /data//mosquitto.db.
2024-05-11 10:39:18: Saving in-memory database to /data//mosquitto.db.
2024-05-11 11:09:19: Saving in-memory database to /data//mosquitto.db.
2024-05-11 11:39:20: Saving in-memory database to /data//mosquitto.db.
2024-05-11 12:09:21: Saving in-memory database to /data//mosquitto.db.
2024-05-11 12:39:22: Saving in-memory database to /data//mosquitto.db.
2024-05-11 13:09:23: Saving in-memory database to /data//mosquitto.db.
2024-05-11 13:39:24: Saving in-memory database to /data//mosquitto.db.
2024-05-11 14:09:25: Saving in-memory database to /data//mosquitto.db.
2024-05-11 14:39:26: Saving in-memory database to /data//mosquitto.db.
2024-05-11 15:09:27: Saving in-memory database to /data//mosquitto.db.
2024-05-11 15:39:28: Saving in-memory database to /data//mosquitto.db.
2024-05-11 16:09:29: Saving in-memory database to /data//mosquitto.db.
2024-05-11 16:39:30: Saving in-memory database to /data//mosquitto.db.
2024-05-11 17:09:31: Saving in-memory database to /data//mosquitto.db.
2024-05-11 17:39:32: Saving in-memory database to /data//mosquitto.db.
2024-05-11 18:09:33: Saving in-memory database to /data//mosquitto.db.
2024-05-11 18:39:34: Saving in-memory database to /data//mosquitto.db.
2024-05-11 18:44:47: New connection from 172.30.32.1:46357 on port 1883.
2024-05-11 18:44:47: New client connected from 172.30.32.1:46357 as 1Sz4zJ7sLnJNNmhR38rZXC (p2, c1, k60, u’mqtt_adm’).
2024-05-11 18:44:48: Client 1Sz4zJ7sLnJNNmhR38rZXC disconnected.
2024-05-11 18:44:50: New connection from 172.30.32.1:50889 on port 1883.
2024-05-11 18:44:50: New client connected from 172.30.32.1:50889 as 3XbrcKTwBmwK56DCbavy16 (p2, c1, k60, u’mqtt_adm’).
2024-05-11 18:46:21: Client 5lKb7RHUEFq0OB45ieU0dP has exceeded timeout, disconnecting.
2024-05-11 18:48:47: Client 3XbrcKTwBmwK56DCbavy16 closed its connection.
2024-05-11 18:49:11: New connection from 172.30.32.1:53931 on port 1883.
2024-05-11 18:49:11: New client connected from 172.30.32.1:53931 as 5HYbr4ynY5zsuaO1vUr0nH (p2, c1, k60, u’mqtt_adm’).

au passage, j’ai changer l’adresse du mosquitto de core.mosquitto à l’adresse ip de mon HA 10.0.0.15
le programme mqtt explore se connecte sur le 10.0.0.15 mais pas sur le core.mosquitto

je pense que je fais finir par remttre mon HA à zero et voir si c’est pas mieux ^^

regarde aussi du coté du config.yaml si les changements ont été effectué.