Hola, excelente trabajo en esta nueva versión 5. Está realmente bien hecho. Muchas gracias.
Sin embargo, tengo un pequeño problema en este momento:
¿La versión 5.0.1 ya no recibe datos a través de MQTT?
Una escena simple envía un mensaje MQTT:
2.) MQTT recibe los datos, los procesa y devuelve los resultados en formato MQTT. (ver Depuración)
3.) Resultado: no ha llegado nada, los datos no se registran ni se muestran en Gladys, etc.
Bueno, no es lógico, pero me pasa a menudo con los temas personalizados. Solo tienes que volver a hacer clic en ‹ guardar › en el dispositivo correspondiente y todo reaparece.
Perfecto, muchas gracias, era el truco que necesitaba. Es un poco tedioso revisar cada dispositivo virtual, pero funciona. Gracias
¡Hola a todos!
Este tema ahora está en desarrollo .
Se ha abierto una PR para restaurar la suscripción a los temas MQTT personalizados al conectarse al 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.
No duden en seguir la PR, probar (opcional, especialmente para pequeñas solicitudes) y dar sus comentarios aquí si es necesario.
Gracias por el aviso @ruegerth , lo corrijo
mutmut
28 Agosto, 2026 18:36
6
He tenido el mismo problema con mis temas personalizados para mi teleinformación.
Lo malo es que esto me va a desvirtuar mis cálculos de consumo para 2026 (bueno, a unos euros cerca, no es tan grave).
¡Voy a hacer una 5.0.2 hoy!
mutmut
29 Agosto, 2026 14:17
8
Estoy reorganizando un poco mi infraestructura de red y me he dado cuenta de que si Gladys pierde el contacto con su broker MQTT (externo en mi caso), los temas personalizados no se vuelven a activar solos. Hay que hacer una copia de seguridad para « reactivarlos ».
¿Incluso después de la 5.0.2?
mutmut
30 Agosto, 2026 11:07
10
Había escrito antes del lanzamiento de la 5.0.2, tengo que volver a probar.
EDICIÓN: ¡Funciona con la 5.0.2, reconexión automática a los temas personalizados!