Además de permitir comparar variables creadas anteriormente, permitir tomar un valor instantáneo sin tener que crear una acción « obtener valor del dispositivo »
Solicitado aquí:
guim31
2 Noviembre, 2023 08:03
2
¡Nunca había visto esta solicitud, y creo que es muy importante para facilitar la creación de escenas, es decir, ayudar a la gente a imaginarse usando Gladys!
Totalmente de acuerdo contigo @guim31 , esto contribuye en gran medida a simplificar la creación de escenas cuando aún no se tiene experiencia.
guim31
2 Noviembre, 2023 08:06
4
De mi experiencia, creo que la gestión/creación de escenas es el elemento que me ha llevado más tiempo de aprendizaje.
Por lo tanto, creo que, dado que la filosofía del proyecto es fácil de usar, cualquier simplificación en este nivel será beneficiosa.
Hizo
29 Diciembre, 2023 12:45
5
Pequeña actualización de esta súper solicitud
guim31
16 Agosto, 2026 15:37
6
Lo subo… ¡Para mí es imprescindible!
@guim31 ¿dónde está esa caja « continuar solo si »?
mutmut
16 Agosto, 2026 16:35
8
Si no me equivoco, ya no existe porque tenemos el Si...Entonces...Si no que la reemplaza.
@pierre-gilles ¿lo confirmas?
Y en caso afirmativo, podemos cerrar este tema.
@pierre-gilles estoy elevando esta solicitud para la próxima semana. Solo para señalar que la caja ‹ continuar solo si › es la que ha sido renombrada como ‹ condición sobre variable ›.
¡Hola a todos!
Este tema ahora está en desarrollo .
Se ha abierto una PR para proponer los valores instantáneos de los dispositivos en « Continuar solo si »:
master ← claude/box-continuer-seulement-si-devu3t
ouvert 06:43PM - 23 Jul 26 UTC
### Pull Request check-list
To ensure your Pull Request can be accepted as fast… as possible, make sure to review and check all of these items:
- [x] If your changes affect the code, did you write the tests?
- [x] Are server tests passing with coverage? (`cd server && npm run coverage`) — Codecov requires **100% coverage on lines changed in this PR** (all scene, MCP and controller test suites pass locally; the new `device_feature` branches in `scene.actions.js` are each covered by a dedicated test)
- [ ] Did Cypress E2E tests pass? (`npm run cypress:run` from repo root, if UI changed) — no existing Cypress coverage for the "Only continue if" box
- [x] Is the linter passing? (`npm run eslint` on both front/server)
- [x] Did you run prettier? (`npm run prettier` on both front/server)
- [x] If you are adding a new feature/service, did you run the integration comparator? (`npm run compare-translations` on front) — only existing keys were modified, in all three languages (fr/en/de)
- [ ] Did you test this pull request in real life? With real devices? — not yet, community testing via the preview Docker image is welcome
- [x] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code) — no REST API change; the MCP scene schema was updated accordingly
- [ ] If you are adding a new features/services which needs explanation, did you modify the user documentation? — the scene documentation on the website should be updated to mention that device values are now available directly in conditions
- [x] Did you add fake requests data for the demo mode (`front/src/config/demo.js`) so that the demo website is working without a backend? (if needed) — the condition select reuses the existing `/api/v1/room?expand=devices` and `/api/v1/device` routes already mocked for the demo
### Description of change
Implements the community feature request [La box "Continuer seulement si" devrait proposer les valeurs instantanées des appareils par défaut](``https://community.gladysassistant.com/t/la-box-continuer-seulement-si-devrait-proposer-les-valeurs-instantanee-des-appareils-par-defaut/6502``) (opened in 2021, bumped several times since).
Until now, the "Only continue if" box only offered scene variables created by previous blocks, so comparing a device's current state required adding a "Get device value" block first — a common stumbling block for newcomers building their first scenes.
**Server** (`scene.actions.js`, `models/scene.js`, MCP `sceneSchemas.js`):
- A condition now accepts a `device_feature` selector as an alternative to a scope `variable`. The feature's instantaneous value is resolved from the state manager at evaluation time (`last_value`, or `last_value_string` for text features, mirroring the front's `DeviceFeatureTypesString` logic).
- If the selector doesn't resolve, the scene aborts with `DEVICE_FEATURE_NOT_FOUND`, consistent with existing `AbortScene` codes.
- The Joi schema enforces exactly one of `variable` / `device_feature` (`xor`), so existing scenes remain valid unchanged. The MCP Zod schema accepts both forms with the same exclusivity rule.
**Front** (`OnlyContinueIfParams.jsx`, `Condition.jsx`, i18n fr/en/de):
- The condition select now lists all device features grouped by room (same data source as `SelectDeviceFeature`), after the scene-variable groups from previous blocks. With no prior "Get device value" block, devices are proposed by default — which is the exact ask of the topic.
- The selection stores `condition.device_feature` or `condition.variable` depending on the chosen option, and re-selects correctly when reopening the scene.
- Label renamed to "Device or variable" and the explanation text updated in all three languages.
Since the "If/Then/Else" box reuses the same component and the same server handler for its `if` conditions, it benefits from this automatically.
**Tests**: 4 new server tests cover the `device_feature` path (numeric condition verified/not verified, text feature, unknown feature). Full scene (232), MCP (92) and scene controller/model (15) suites pass.
## Summary by CodeRabbit
* **New Features**
* Scene conditions can now compare values directly from devices or scene variables.
* Device features are available as selectable, room-organized options in the scene editor.
* Numeric and text device values are supported for condition checks.
* **Bug Fixes**
* Improved validation ensures each condition references exactly one device feature or variable.
* Missing device features now produce a clear condition error.
* Updated English, German, and French guidance for configuring scene conditions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01MqXp8m7ZvLenVXiBuhsqqS
## Summary by CodeRabbit
* **New Features**
* Scene conditions can compare values directly from devices or scene variables.
* Device feature options are available in the condition editor, organized and grouped by room.
* Supports comparisons using current numeric or text device values.
* **Bug Fixes**
* Improved condition validation and handling when selecting devices or variables.
* Clear errors are shown when a referenced device feature is missing or unavailable.
* Device references in nested scene conditions are updated during migrations.
* **Documentation**
* Updated English, German, and French descriptions to explain device and variable comparisons.
No duden en seguir la PR, probarla lo antes posible y dar sus comentarios aquí.