Bonjour, excellent travail sur cette nouvelle version 5. C’est vraiment bien fait. Merci beaucoup.
J’ai toutefois un petit problème pour le moment :
La version 5.0.1 ne reçoit plus de données via MQTT ?
Une scène simple envoie un message MQTT :
2.) MQTT reçoit les données, les traite et renvoie les résultats au format MQTT. (voir Débogage)
3.) Résultat : rien n’est arrivé, les données ne sont pas enregistrées ni affichées dans Gladys, etc.
Alors, c’est pas logique mais ça m’arrive souvent avec les topics personnalisés. Il te suffit de cliquer à nouveau sur ‹ sauvegarder › dans le device concerné et tout réapparaît !
Parfait, merci beaucoup, c’est l’astuce qu’il fallait. C’est un peu fastidieux de passer en revue chaque appareil virtuel, mais ça marche. Merci
Salut tout le monde !
Ce sujet est désormais en cours de développement .
Une PR a été ouverte pour rétablir la souscription aux topics MQTT personnalisés à la connexion au broker :
master ← claude/mqtt-scenes-feedback-5o9ogp
ouvert 05:29PM - 28 Aug 26 UTC
### Description
A user reported on the forum that, since 5.0.1, MQTT data sent … back to Gladys was no longer received: the scene published its message fine, the external system answered on the expected topic, but nothing arrived in Gladys. The workaround found on the forum was to open each virtual device and click "save" again.
This is a real regression, not a UX issue, and it affects every device with a custom MQTT topic (not only those used in scenes).
Root cause:
- Custom topics of device features are registered by `listenToCustomMqttTopicIfNeeded`, called from `device.add` when devices are loaded in RAM. That function only sends a `SUBSCRIBE` if `this.mqttClient` already exists.
- In the new boot sequence, `device.init()` runs **before** `service.startAll()`, so at that point the MQTT service is loaded but not started: `mqttClient` is `null`. The topics are pushed into `deviceFeatureCustomMqttTopics`, but no `SUBSCRIBE` is ever sent.
- Unlike topics registered through `subscribe()` (default topics, Home Assistant state topics), the device custom topics are not part of `topicBinds`, so the `connect` handler did not replay them either.
Result: after a restart, the broker never forwards those topics to Gladys, until the user saves the device again (`device.add` runs a second time, this time with a connected client). The same happened after saving the MQTT configuration, since that builds a brand new client.
Fix: the `connect` handler now also subscribes to the custom topics registered so far, deduplicated by topic. A regression test covers the exact sequence (topics registered while `mqttClient` is `null`, then connection) and fails on `master`.
## Forum
Forum: https://community.gladysassistant.com/t/question-about-the-mqtt-in-scenes/10739
### Checklist
- [x] Tests pass: `npm_config_service=mqtt npm run test-service` → 253 passing, including the new regression test (which fails without the fix)
- [x] Linter and prettier pass on the changed files (`npx eslint`, `npx prettier --check`)
- [x] No undocumented breaking change
---
_Generated by [Claude Code](https://claude.ai/code/session_0118ndMFrKoZ3XWYdgPpk7RF)_
## Summary by CodeRabbit
* **New Features**
* Custom device MQTT topics are now automatically subscribed to when the MQTT connection is established.
* Duplicate and empty topics are ignored to prevent unnecessary subscriptions.
* **Bug Fixes**
* Ensures custom topics registered before connection become active after connecting.
N’hésitez pas à suivre la PR, à tester (optionnel, surtout pour les petites demandes) et à faire vos retours ici si besoin.
Merci du retour @ruegerth , je corrige ça
J’ai eu le même problème avec mes topics personnalisés pour ma téléinformation.
Le truc c’est que ça va me fausser mes calculs de conso pour 2026 (bon, à qq euros près, ce n’est pas trop grave).