Es wäre nützlich, von einer Szene aus eine andere Szene aktivieren oder deaktivieren zu können.
Ich beschreibe einen Anwendungsfall:
Ich habe einen kleinen Wassertank zur Wassersammlung. Bei Trockenheit muss ich ihn manchmal aus einem Trinkwasserhahn auffüllen, aber in diesem Fall möchte ich ihn nicht mehr als 40 % füllen.
Eine Szene A überprüft alle 5 Minuten die Wassermenge in meinem Tank und warnt mich, wenn er zu mindestens 40 % gefüllt ist. Dann weiß ich, dass ich den Hahn abstellen muss.
Ich möchte nicht, dass diese Szene A kontinuierlich läuft, sonst werde ich unnötig gewarnt, wenn der Füllstand aufgrund eines Regens 40 % übersteigt.
Eine Szene B ermöglicht es mir, die Szene A zu aktivieren, und ich platziere eine Schaltfläche dieser Szene B auf meinem Dashboard.
Es ist bereits möglich, über ein virtuelles MQTT-Gerät zu gehen, um dies zu „basteln“, aber das ist nicht sehr intuitiv.
Es gibt bereits ein Thema von @guim31 , das darüber sprach ( Möglichkeit, eine Szene von einer Szene aus zu aktivieren/deaktivieren ), aber es war eher eine Diskussion als eine Funktionsanfrage, und ich dachte, es wäre besser, wenn dies von der KI behandelt wird, ein neues Thema zu beginnen.
Hallo zusammen!
Dieses Thema ist nun in Entwicklung .
Ein Pull Request wurde eröffnet, um die Aktionen „Szene aktivieren“ und „Szene deaktivieren“ hinzuzufügen:
master ← claude/scene-enable-disable-action
ouvert 02:53AM - 17 Aug 26 UTC
Implements feature request: https://community.gladysassistant.com/t/pouvoir-acti… ver-desactiver-une-scene-depuis-une-autre-scene/10580
### Description
Scenes already have an `active` flag, but until now it could only be toggled by hand in the scene UI. This PR adds two new scene actions that let a scene turn another scene's `active` flag on or off:
- **Enable a scene** (`scene.enable`)
- **Disable a scene** (`scene.disable`)
This removes the need for the virtual MQTT device workaround people currently use to arm/disarm a scene from another scene.
The use case described on the forum: a scene checks a water tank level every 5 minutes and notifies when it reaches 40%. It should only be armed while the tank is being filled. With these actions, the checking scene can disable itself once it has notified, and a second scene (bound to a dashboard button) re-enables it when a new filling starts.
Details:
- New `ACTIONS.SCENE.ENABLE` / `ACTIONS.SCENE.DISABLE` constants.
- Server handlers persist the flag through `scene.update`, which already cancels or re-schedules the target scene's triggers, so a disabled scene really stops listening immediately.
- A scene is allowed to target **itself**: that is what makes the "run once, then disarm until re-armed" pattern possible. Contrary to the "Start scene" action, the current scene is therefore kept in the scene selector.
- Edge cases: `AbortScene('SCENE_NOT_FOUND')` when no scene is selected or when the target scene no longer exists (deleted in the meantime); unexpected errors are propagated.
- The two actions are also exposed in the MCP scene creation schemas, so the AI assistant can build such scenes.
- Front: shared action card component, entry in the action selector, and translations in `en`, `fr` and `de`.
This pull request was produced by an automated run.
## Forum
Forum: https://community.gladysassistant.com/t/pouvoir-activer-desactiver-une-scene-depuis-une-autre-scene/10580
### Checklist
- [x] Tests pass: `cd server && npm run coverage` (Codecov requires 100% coverage on changed lines) and Cypress (`npm run cypress:run`) if the UI changed
- [x] Linter and prettier pass on both front and server (`npm run eslint`, `npm run prettier`)
- [x] No undocumented breaking change
---
_Generated by [Claude Code](https://claude.ai/code/session_01REGRUvErzpwtSrsi9gKh4J)_
Zögert nicht, dem PR zu folgen, es so früh wie möglich zu testen und euer Feedback hier zu hinterlassen.