Zigbee2mqtt : Image docker de test basée Gladys v4

Oui oui je sais, suis pas pressé :beer: :slight_smile: ( le login ne change rien )

J’ai dû bricoler pour avoir les 3 conteneurs qui tournent, impossible d’avoir le conteneur zigbee2mqtt ( j’ai du virer les pass sur la conf mqtt pour pouvoir utiliser mon ancien conteneur , bref )

Du coup normalement c’est bon car coté status

image

Par contre dans les logs:

Edit: ça a fini par fonctionner

Bien jouer @Reno , j’ai jamais été aussi content de voir mes sensors sur le dashboard

image

2 « J'aime »

Je recois ma clé demain hate de tester tout ca :slight_smile:

Cool que ça te plaise.
J’espère que ça fonctionnera du premier coup avec les installations standards.

Il faut que je fasse une PR pour la pression atm qui devrait s’afficher en hPa.

Salut @Reno et congrats pour ce travail monstrueux ! :slight_smile:

Effectivement, c’est une intégration qui est très attendue et qui va faire des heureux.

Génial, tout ce qui fallait. Beau travail.

Clairement. ça va éviter d’avoir des problèmes à l’avenir, et surtout ça permet de supporter les gens qui ont un broker externe pour le MQTT, mais qui ne veulent pas forcément l’utiliser pour le Zigbee2mqtt (ça n’aurais pas de sens)

Petite question: comment appelle tu le container mosquitto ? Il faut que son nom soit bien distincte de celui du service MQTT.

Je me permet de répondre:

z2m-mqtt pour mqtt
zigbee2mqtt pour z2m

Je penses qu’il faut mettre en place une règle pour les conteneurs gladys , un prefix ga- par exemple (pour gladys assistant

J’ai également changé le port pour le broker (1884) pour pouvoir avoir les 2 en //.

Pour le container Zigbee2mqtt, je comptais mettre z2m-z2m mais c’est pas très joli ! :wink:
Non, en fait, j’ai oublié, tellement pressé de publier l’image…

effectivement bonne idée. Après il faut voir comment gérer l’existant car on ne peut pas migrer comme ça ^^

Oui important ! Très bien.

Merci @Reno pour tout ton travail !
Il me tarde de tester ça rapidement !

Juste une petite question, j’ai un RPi qui tourne avec l’image officielle de Gladys (v4)
Je peux utiliser ton image en parallèle sur le même RPi sans créer de conflits (en changeant les ports pour l’UI forcément) ? Ou bien il serait judicieux de faire des tests sur une carte dédiée à ça ?

Tu peux changer le port et le nom de la DB

Par exemple

docker run -d \
--log-opt max-size=10m \
--restart=always \
--privileged \
--network=host \
--name gladys-zigbee2mqtt \
-e NODE_ENV=production \
-e SERVER_PORT=1080 \
-e TZ=Europe/Paris \
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-zigbee2mqtt.db \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/gladysassistant:/var/lib/gladysassistant \
-v /dev:/dev \
-v /run/udev:/run/udev:ro \
r6n0/gladys-zigbee2mqtt:latest 
1 « J'aime »

Au top @VonOx ! Je fais ça et je vous ferai quelques retours rapidement avec mon matériel Xiaomi (ouverture de porte, vibration, luminosité, bouton poussoir, etc…)

Bon j’obtiens ça … :

docker logs gladys-zigbee2mqtt

pi@gladys:~ $ docker logs gladys-zigbee2mqtt

gladys-server@ start:prod /src/server
cross-env NODE_ENV=production node index.js

Initialising OpenZWave 1.6.1051 binary addon for Node.JS.
	OpenZWave Security API is ENABLED
	ZWave device db    : /usr/local/etc/openzwave
	User settings path : /src/server/services/zwave/node_modules/openzwave-shared/build/Release/../../
	Option Overrides : --Logging false --ConsoleOutput false --SaveConfiguration true
2020-11-16T11:59:39+0100 <info> service.start.js:53 (Service.start) Service mqtt is not configured, so it was not started.
2020-11-16T11:59:39+0100 <info> index.js:20 (Object.start) Starting Open Weather service
2020-11-16T11:59:39+0100 <info> service.start.js:53 (Service.start) Service openweather is not configured, so it was not started.
2020-11-16T11:59:39+0100 <info> init.js:38 (Zigbee2mqttManager.init) Zigbee2mqtt USB dongle not attached
2020-11-16T11:59:39+0100 <info> index.js:15 (Object.start) Starting Bluetooth service
2020-11-16T11:59:40+0100 <info> index.js:16 (Object.start) Starting zwave service
2020-11-16T11:59:40+0100 <info> service.start.js:53 (Service.start) Service zwave is not configured, so it was not started.
2020-11-16T11:59:40+0100 <info> index.js:13 (Object.start) Starting usb service
2020-11-16T11:59:40+0100 <info> index.js:19 (Object.start) Starting telegram service
2020-11-16T11:59:40+0100 <info> service.start.js:53 (Service.start) Service telegram is not configured, so it was not started.
2020-11-16T11:59:40+0100 <info> index.js:63 (Server.<anonymous>) Server listening on port 1080
2020-11-16T12:02:59+0100 <info> init.js:49 () Zigbee2mqtt USB dongle attached to /dev/ttyACM0
2020-11-16T12:03:10+0100 <info> init.js:49 () Zigbee2mqtt USB dongle attached to /dev/ttyACM0
2020-11-16T12:03:10+0100 <info> installMqttContainer.js:30 (Zigbee2mqttManager.installMqttContainer) MQTT broker is being installed as Docker container...
2020-11-16T12:03:10+0100 <info> installMqttContainer.js:31 (Zigbee2mqttManager.installMqttContainer) Pulling eclipse-mosquitto:latest image...
2020-11-16T12:03:21+0100 <info> installMqttContainer.js:34 (Zigbee2mqttManager.installMqttContainer) Preparing broker environment...
2020-11-16T12:03:21+0100 <info> installMqttContainer.js:38 (Zigbee2mqttManager.installMqttContainer) Creating container...
2020-11-16T12:03:21+0100 <info> installMqttContainer.js:52 (Zigbee2mqttManager.installMqttContainer) Zigbee2MQTT MQTT broker is starting...
2020-11-16T12:03:27+0100 <info> installMqttContainer.js:58 (Zigbee2mqttManager.installMqttContainer) Creating user/pass...
2020-11-16T12:03:27+0100 <info> installMqttContainer.js:69 (Zigbee2mqttManager.installMqttContainer) MQTT broker container successfully started
2020-11-16T12:03:27+0100 <info> installZ2mContainer.js:29 (Zigbee2mqttManager.installZ2mContainer) Zigbee2mqtt is being installed as Docker container...
2020-11-16T12:03:27+0100 <info> installZ2mContainer.js:30 (Zigbee2mqttManager.installZ2mContainer) Pulling koenkk/zigbee2mqtt:latest image...
2020-11-16T12:04:10+0100 <info> installZ2mContainer.js:33 (Zigbee2mqttManager.installZ2mContainer) Preparing Zigbee2mqtt environment...
2020-11-16T12:04:10+0100 <info> installZ2mContainer.js:39 (Zigbee2mqttManager.installZ2mContainer) Creating container...
2020-11-16T12:04:14+0100 <info> installZ2mContainer.js:47 (Zigbee2mqttManager.installZ2mContainer) Zigbee2mqtt successfully installed as Docker container
2020-11-16T12:04:14+0100 <info> installZ2mContainer.js:59 (Zigbee2mqttManager.installZ2mContainer) Zigbee2mqtt is starting...
2020-11-16T12:04:20+0100 <info> installZ2mContainer.js:71 (Zigbee2mqttManager.installZ2mContainer) Zigbee2mqtt successfully started
2020-11-16T12:04:20+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:04:20+0100 <warn> connect.js:41 (MqttClient.<anonymous>) Disconnected from MQTT server
2020-11-16T12:04:25+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:04:30+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:04:35+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:04:40+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:04:45+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:04:50+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:04:55+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:05:00+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:05:05+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:05:10+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:05:15+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:05:20+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:05:25+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:05:30+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:05:35+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:05:40+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:05:45+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:05:50+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:05:55+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:06:00+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:06:05+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:06:10+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:06:15+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:06:21+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:06:26+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:06:31+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:06:36+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:06:41+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:06:46+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:06:51+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:06:56+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:07:01+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:07:06+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:07:11+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:07:16+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:07:21+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:07:26+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:07:31+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:07:36+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:07:41+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:07:46+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:07:51+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:07:56+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:08:01+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:08:06+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:08:11+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:08:16+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:08:21+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:08:26+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:08:31+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:08:36+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:08:41+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:08:46+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:08:51+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:08:56+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:09:01+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:09:06+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:09:11+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:09:16+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:09:21+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:09:26+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized
2020-11-16T12:09:31+0100 <warn> connect.js:32 (MqttClient.<anonymous>) Error while connecting to MQTT - Error: Connection refused: Not authorized

Je sais pourquoi

Execute ces 2 commandes :

docker restart z2m-mqtt
docker restart zigbee2mqtt

Puis revérifie dans Gladys

Tout est au vert ! Merci @VonOx !

J’espère que ces retours aideront à créer une install plus “simple” en tout cas qui ne nécessite pas ce genre de manips haha

L’objectif est bien celui-là !

Par contre, je pensais avoir résolu le problème car ça ne le faisait plus chez moi.
Une autre solution consiste à désactiver le service puis à le réactiver depuis l’interface.

1 « J'aime »

De ce que j’ai vu la conf mqtt n’est pas prise en compte et nécéssite un redémarrage du conteneur

@Reno je te conseille de voir ce qui a été fait sur le service MQTT, tu as regardé les derniers changements récents? Il y a eu des petits détails mis en place pour que ce genre de bug n’arrive pas. Notamment des temporisations et des checks pour ne lancer le container que quand c’est prêt.

Après quelques essais rapides les tests sont concluants pour le moment !!
J’ai trouvé viteuf 4 capteurs :

  • Ouverture de porte : OK
  • Switch 1 bouton : OK
  • Capteur vibration : OK
  • Capteur luminosité : PAS OK (mais je crois que la pile est morte en fait…)

Du tout bon jusqu’à présent !! Je continuerai mes tests un peu plus tard.

Merci BEAUCOUP @Reno !