Découverte, questions basiques et remerciements

Bonjour,

je découvre la domotique ainsi que Gladys qui est fort agréable et super user friendly, tout fonctionne bien en quelques minutes (Sonoff avec Tasmota, du zigbee Xiaomi avec une clé zzh!).

Vraiment, c’est un excellent taf, merci beaucoup !

J’ai deux questions auxquelles je n’ai pas trouvé de réponse :

  • Est il possible d’exécuter une commande externe (genre un script bash ou python) lors d’une action ?
  • Est il possible de jouer un son lors d’une action ? (Dans le but de se faire une alarme sonore si la porte s’ouvre par exemple).
    Le 1er point pourrait aisément gérer le 2e si ce dernier n’existe pas.

Un très grand merci aux créateurs et à la communauté autour :slight_smile:

Salut @Hizo et merci pour ton message !

Alors oui, tu peux passer par l’intégration MQTT pour déclencher un script externe dans une scène :slight_smile:

J’ai fais un tutoriel vidéo sur YouTube:

Regarde le tutoriel à partir de 6:39

Je créé un actionneur dans l’intégration MQTT (une lampe), et ensuite dans mon script j’écoute un topic MQTT.

Quand le périphérique est déclenché côté Gladys (dans une scène, ou via le dashboard), je reçois une valeur (0 ou 1) côté script, et je peux déclencher ce que je veux.

Bien-sûr ce tuto je l’ai fais en Node.js mais c’est possible en Python ou n’importe quel autre script.

Ce n’est pas possible actuellement, mais effectivement si tu te fais un petit device MQTT “sonore” qui envoie un 1 quand il faut jouer un son, tu peux faire jouer le son dans ton script dès que ton script reçoit 1 :slight_smile:

N’hésite pas si tu as des questions, c’est assez clair ?

Merci beaucoup,

mes tests en bash fonctionnement bien en utilisant mosquitto.

Par contre, je ne pige pas pourquoi mais le lien entre MQTT et Zeegbee2MQTT n’est plus fonctionnel, Gladys affiche une croix rouge entre les deux…
Les deux sont indiqués comme démarré pourtant.
J’ai redémarré les dockers et le raspberry mais ça ne change rien…
Une idée ?

Salut, stp, donne nous les retours de:

docker ps
docker logs gladys

Merci de ton aide :

hizoka@hizoka-pi:~$ docker ps
CONTAINER ID   IMAGE                       COMMAND                  CREATED       STATUS                          PORTS     NAMES
3c36ac33fd16   koenkk/zigbee2mqtt:latest   "docker-entrypoint.s…"   13 days ago   Up Less than a second                     gladys-z2m-zigbee2mqtt
621c3b0a84f1   eclipse-mosquitto:2         "/docker-entrypoint.…"   13 days ago   Up 4 minutes                              gladys-z2m-mqtt
e403c7cec7b1   eclipse-mosquitto:2         "/docker-entrypoint.…"   3 weeks ago   Restarting (1) 34 seconds ago             eclipse-mosquitto
909c23621259   gladysassistant/gladys:v4   "docker-entrypoint.s…"   3 weeks ago   Up 5 hours                                gladys
hizoka@hizoka-pi:~$ docker logs gladys
...
2021-06-22T12:35:17+0200 <info> index.js:27 (shutdown) SIGTERM received.
2021-06-22T12:35:17+0200 <info> index.js:28 (shutdown) Closing database connection.
2021-06-22T12:35:17+0200 <info> index.js:31 (shutdown) Closing server connections.
2021-06-22T12:35:17+0200 <warn> connect.js:60 (MqttClient.<anonymous>) Disconnected from MQTT server
2021-06-22T12:35:17+0200 <warn> connect.js:44 (MqttClient.<anonymous>) Disconnected from MQTT server

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

Initialising OpenZWave 1.6.0 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
2021-06-22T12:36:49+0200 <info> index.js:19 (Object.start) Starting example service
2021-06-22T12:36:49+0200 <info> index.js:20 (Object.start) Starting Open Weather service
2021-06-22T12:36:49+0200 <info> service.start.js:40 (Service.start) Service openweather is not configured, so it was not started.
2021-06-22T12:36:49+0200 <info> index.js:18 (Object.start) Starting Philips Hue service
2021-06-22T12:36:49+0200 <info> index.js:16 (Object.start) Starting MQTT service
2021-06-22T12:36:49+0200 <info> updateContainer.js:13 (MqttHandler.updateContainer) MQTT: checking for required changes...
2021-06-22T12:36:49+0200 <info> connect.js:38 (MqttClient.<anonymous>) Connected to MQTT server mqtt://localhost
2021-06-22T12:36:49+0200 <info> subscribe.js:12 (MqttHandler.subscribe) Subscribing to MQTT topic gladys/master/#
2021-06-22T12:36:50+0200 <info> init.js:47 () Zigbee2mqtt USB dongle attached to /dev/ttyUSB0
2021-06-22T12:36:50+0200 <info> installMqttContainer.js:103 (Zigbee2mqttManager.installMqttContainer) MQTT broker container successfully started
2021-06-22T12:36:50+0200 <info> installZ2mContainer.js:71 (Zigbee2mqttManager.installZ2mContainer) Zigbee2mqtt container successfully started
2021-06-22T12:36:51+0200 <info> connect.js:24 (MqttClient.<anonymous>) Connected to MQTT container mqtt://localhost:1884
2021-06-22T12:36:51+0200 <info> subscribe.js:12 (Zigbee2mqttManager.subscribe) Subscribing to MQTT topic zigbee2mqtt/#
2021-06-22T12:36:51+0200 <info> index.js:18 (Object.start) Starting TP-Link service
2021-06-22T12:36:51+0200 <info> index.js:17 (Object.start) Starting eWeLink service
2021-06-22T12:36:51+0200 <info> service.start.js:40 (Service.start) Service ewelink is not configured, so it was not started.
2021-06-22T12:36:51+0200 <info> index.js:15 (Object.start) Starting Bluetooth service
2021-06-22T12:36:51+0200 <info> bluetooth.initPresenceScanner.js:18 (BluetoothManager.initPresenceScanner) Bluetooth configuration: starting presence scanner
2021-06-22T12:36:52+0200 <info> index.js:15 (Object.start) Starting Tasmota service
2021-06-22T12:36:52+0200 <info> subscribe.js:12 (MqttHandler.subscribe) Subscribing to MQTT topic stat/+/+
2021-06-22T12:36:52+0200 <info> subscribe.js:12 (MqttHandler.subscribe) Subscribing to MQTT topic tele/+/+
2021-06-22T12:36:52+0200 <info> index.js:16 (Object.start) Starting zwave service
2021-06-22T12:36:52+0200 <info> service.start.js:40 (Service.start) Service zwave is not configured, so it was not started.
2021-06-22T12:36:52+0200 <info> index.js:14 (Object.start) Starting Xiaomi service
2021-06-22T12:36:52+0200 <info> index.js:13 (Object.start) Starting usb service
2021-06-22T12:36:52+0200 <info> index.js:19 (Object.start) Starting Telegram service
2021-06-22T12:36:52+0200 <info> service.start.js:40 (Service.start) Service telegram is not configured, so it was not started.
2021-06-22T12:36:52+0200 <info> index.js:16 (Object.start) Starting RTSP service
2021-06-22T12:36:52+0200 <info> index.js:60 (Object.start) Starting CalDAV service
2021-06-22T12:36:52+0200 <info> scene.dailyUpdate.js:58 () Sunrise today is at 5:50 today, in your timezone = Europe/Paris
2021-06-22T12:36:52+0200 <info> scene.dailyUpdate.js:59 () Sunset today is at 22:7 today, in your timezone = Europe/Paris
2021-06-22T12:36:52+0200 <info> scene.dailyUpdate.js:70 () The sun rose this morning. Not scheduling for today.
2021-06-22T12:36:52+0200 <info> scene.dailyUpdate.js:81 () Sunset is scheduled, in 10 hours.
2021-06-22T12:36:52+0200 <info> index.js:63 (Server.<anonymous>) Server listening on port 80
2021-06-22T13:21:32+0200 <info> index.js:27 (shutdown) SIGTERM received.
2021-06-22T13:21:32+0200 <info> index.js:28 (shutdown) Closing database connection.
2021-06-22T13:21:32+0200 <info> index.js:31 (shutdown) Closing server connections.

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

Initialising OpenZWave 1.6.0 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
2021-06-22T13:21:57+0200 <info> index.js:19 (Object.start) Starting example service
2021-06-22T13:21:57+0200 <info> index.js:20 (Object.start) Starting Open Weather service
2021-06-22T13:21:57+0200 <info> service.start.js:40 (Service.start) Service openweather is not configured, so it was not started.
2021-06-22T13:21:57+0200 <info> index.js:16 (Object.start) Starting RTSP service
2021-06-22T13:21:57+0200 <info> index.js:18 (Object.start) Starting Philips Hue service
2021-06-22T13:21:57+0200 <info> init.js:47 () Zigbee2mqtt USB dongle attached to /dev/ttyUSB0
2021-06-22T13:21:57+0200 <info> installMqttContainer.js:103 (Zigbee2mqttManager.installMqttContainer) MQTT broker container successfully started
2021-06-22T13:21:58+0200 <info> installZ2mContainer.js:71 (Zigbee2mqttManager.installZ2mContainer) Zigbee2mqtt container successfully started
2021-06-22T13:21:58+0200 <info> connect.js:24 (MqttClient.<anonymous>) Connected to MQTT container mqtt://localhost:1884
2021-06-22T13:21:58+0200 <info> subscribe.js:12 (Zigbee2mqttManager.subscribe) Subscribing to MQTT topic zigbee2mqtt/#
2021-06-22T13:21:58+0200 <info> index.js:18 (Object.start) Starting TP-Link service
2021-06-22T13:21:58+0200 <info> index.js:17 (Object.start) Starting eWeLink service
2021-06-22T13:21:58+0200 <info> service.start.js:40 (Service.start) Service ewelink is not configured, so it was not started.
2021-06-22T13:21:58+0200 <info> index.js:15 (Object.start) Starting Bluetooth service
2021-06-22T13:21:58+0200 <info> bluetooth.initPresenceScanner.js:18 (BluetoothManager.initPresenceScanner) Bluetooth configuration: starting presence scanner
2021-06-22T13:21:58+0200 <info> index.js:15 (Object.start) Starting Tasmota service
2021-06-22T13:21:58+0200 <info> index.js:16 (Object.start) Starting zwave service
2021-06-22T13:21:58+0200 <info> service.start.js:40 (Service.start) Service zwave is not configured, so it was not started.
2021-06-22T13:21:58+0200 <info> index.js:14 (Object.start) Starting Xiaomi service
2021-06-22T13:21:58+0200 <info> index.js:13 (Object.start) Starting usb service
2021-06-22T13:21:58+0200 <info> index.js:19 (Object.start) Starting Telegram service
2021-06-22T13:21:58+0200 <info> service.start.js:40 (Service.start) Service telegram is not configured, so it was not started.
2021-06-22T13:21:58+0200 <info> index.js:16 (Object.start) Starting MQTT service
2021-06-22T13:21:59+0200 <info> updateContainer.js:13 (MqttHandler.updateContainer) MQTT: checking for required changes...
2021-06-22T13:21:59+0200 <info> connect.js:38 (MqttClient.<anonymous>) Connected to MQTT server mqtt://localhost
2021-06-22T13:21:59+0200 <info> subscribe.js:12 (MqttHandler.subscribe) Subscribing to MQTT topic stat/+/+
2021-06-22T13:21:59+0200 <info> subscribe.js:12 (MqttHandler.subscribe) Subscribing to MQTT topic tele/+/+
2021-06-22T13:21:59+0200 <info> subscribe.js:12 (MqttHandler.subscribe) Subscribing to MQTT topic gladys/master/#
2021-06-22T13:21:59+0200 <info> index.js:60 (Object.start) Starting CalDAV service
2021-06-22T13:21:59+0200 <info> scene.dailyUpdate.js:58 () Sunrise today is at 5:50 today, in your timezone = Europe/Paris
2021-06-22T13:21:59+0200 <info> scene.dailyUpdate.js:59 () Sunset today is at 22:7 today, in your timezone = Europe/Paris
2021-06-22T13:21:59+0200 <info> scene.dailyUpdate.js:70 () The sun rose this morning. Not scheduling for today.
2021-06-22T13:21:59+0200 <info> scene.dailyUpdate.js:81 () Sunset is scheduled, in 9 hours.
2021-06-22T13:21:59+0200 <info> index.js:63 (Server.<anonymous>) Server listening on port 80
2021-06-22T15:21:59+0200 <info> gateway.checkIfBackupNeeded.js:9 (Gateway.checkIfBackupNeeded) Instance not connected to Gladys Gateway, not backing up.
2021-06-22T15:37:42+0200 <info> init.js:47 () Zigbee2mqtt USB dongle attached to /dev/ttyUSB0
2021-06-22T15:37:42+0200 <info> installMqttContainer.js:97 (Zigbee2mqttManager.installMqttContainer) MQTT broker is starting...
2021-06-22T15:37:47+0200 <info> installMqttContainer.js:103 (Zigbee2mqttManager.installMqttContainer) MQTT broker container successfully started
2021-06-22T15:37:47+0200 <info> installZ2mContainer.js:65 (Zigbee2mqttManager.installZ2mContainer) Zigbee2mqtt container is starting...
2021-06-22T15:37:53+0200 <info> installZ2mContainer.js:71 (Zigbee2mqttManager.installZ2mContainer) Zigbee2mqtt container successfully started
2021-06-22T15:37:53+0200 <info> connect.js:24 (MqttClient.<anonymous>) Connected to MQTT container mqtt://localhost:1884
2021-06-22T15:37:53+0200 <info> subscribe.js:12 (Zigbee2mqttManager.subscribe) Subscribing to MQTT topic zigbee2mqtt/#
2021-06-22T17:21:59+0200 <info> gateway.checkIfBackupNeeded.js:9 (Gateway.checkIfBackupNeeded) Instance not connected to Gladys Gateway, not backing up.
2021-06-22T18:12:05+0200 <info> init.js:47 () Zigbee2mqtt USB dongle attached to /dev/ttyUSB0
2021-06-22T18:12:05+0200 <info> installMqttContainer.js:97 (Zigbee2mqttManager.installMqttContainer) MQTT broker is starting...
2021-06-22T18:12:11+0200 <info> installMqttContainer.js:103 (Zigbee2mqttManager.installMqttContainer) MQTT broker container successfully started
2021-06-22T18:12:11+0200 <info> installZ2mContainer.js:65 (Zigbee2mqttManager.installZ2mContainer) Zigbee2mqtt container is starting...
2021-06-22T18:12:16+0200 <info> installZ2mContainer.js:71 (Zigbee2mqttManager.installZ2mContainer) Zigbee2mqtt container successfully started
2021-06-22T18:12:16+0200 <info> connect.js:24 (MqttClient.<anonymous>) Connected to MQTT container mqtt://localhost:1884
2021-06-22T18:12:16+0200 <info> subscribe.js:12 (Zigbee2mqttManager.subscribe) Subscribing to MQTT topic zigbee2mqtt/#

J’ai limité aux log depuis ce midi (limite de la taille du post).
En sachant que j’ai fait pas mal de tests :stuck_out_tongue:

1 Like

Donne le résultat de ces commandes aussi stp

docker logs gladys-z2m-zigbee2mqtt
docker logs gladys-z2m-mqtt

J’ai changer l’emplacement du raspberry et là tout fonctionne alors que je n’ai rien changé à la config…

Merci :slight_smile:

2 Likes