In addition to allowing the comparison of previously created variables, allow taking an instantaneous value without having to create a « get device value » action
Requested here:
guim31
November 2, 2023, 8:03am
2
I had never seen this request, and I actually think it’s very important to make creating scenes easier > so help people picture themselves using Gladys !!
Totally agree with you @guim31 , it really helps make creating scenes simpler when you don’t yet have any experience.
guim31
November 2, 2023, 8:06am
4
From my experience, I think that managing/creating scenes is the part that took me the longest to learn.
So I think that, given the project’s philosophy of aiming to be accessible, any simplification at that level will be beneficial!
Hizo
December 29, 2023, 12:45pm
5
Little bump for this awesome request
guim31
August 16, 2026, 3:37pm
6
I’m bringing this back… For me, it’s a must-have!
@guim31 where is this box « continue only if » located?
mutmut
August 16, 2026, 4:35pm
8
If I’m not mistaken, it no longer exists because we have the If...Then...Else that replaces it.
@pierre-gilles do you confirm?
And if so, we can close this topic.
@pierre-gilles I’m bringing this request forward for next week. Just note that the ‹ continue only if › box is the one that was renamed to ‹ condition on variable ›.
Hi everyone!
This topic is now in development .
A PR has been opened to propose the instant values of devices in “Continue only if”:
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.
Don’t hesitate to follow the PR, test as soon as possible, and share your feedback here.