Sur la base du nouveau thermostat qui est top pour faire des programmations beaucoup plus facilement qu’avec les scènes, est ce qu’il serait possible d’en faire une variante de type « Programmateur ». Comme pour le thermostat une programmation hebdo mais avec juste 2 modes de fonctionnement « On / Off ».
Actuellement pour déclencher des allumages de prise à heure fixe on peut le faire par les scène mais c’est hyper fastidieux si il doit y avoir plusieurs allumage à des heures différentes donc une programmation serait top
Je me suis permis de déplacer ton sujet en demande de fonctionnalités
Et j’ai voté pour
Ce n’est pas un planning comme le thermostat, mais j’ai une PR en cours pour faire à peu près la même chose dans une scène.
master ← William-De71:feature/scene-trigger-time-ranges
ouvert 09:33PM - 26 Aug 26 UTC
## Scenes: add a "time ranges" scheduled trigger
Today, driving a device from… a weekly planning requires two scenes: one to
turn it on, one to turn it off, each with its own scheduled trigger, kept in
sync by hand. This PR adds a `time-range` scheduler type so a whole planning
lives in a single scene.
### The trigger
A new **Time ranges** option in the scheduled trigger. You configure a list of
ranges (`start` → `end`, "HH:mm") and the days of the week they apply to. The
scene runs at the **start** and at the **end** of every range, and the trigger
tells the scene which boundary fired.
- A range is active from its start (included) to its end (excluded), so two
consecutive ranges (`10:00 → 12:00` then `12:00 → 14:00`) never report the
same minute twice.
- Ranges crossing midnight are supported (`22:00 → 06:00`). The days of the
week always apply to the **start** of the range: configured on monday, that
range runs from monday 22:00 to tuesday 06:00.
- A range whose start equals its end covers nothing and is never scheduled.
- Ranges are sorted in the editor, and a new one is no longer pre-filled.
### The condition
A new **`scene.in-time-range`** action, meant to sit in an `If… Then… Else`
block: "then" is the inside of the planning, "else" is the outside. One scene,
one device, on at the start of every range and off at the end.
When the scene was started by one of its own time-range jobs, the condition
trusts the boundary carried by the trigger instead of re-computing it — a job
firing exactly at the end of a range could otherwise still be seen as "inside"
a few milliseconds later. Started any other way (manually, by another trigger,
by another scene), the state is computed from the ranges of the scene's
time-range triggers. The scene selector check matters here: `scene.start` hands
a child scene a clone of the scope, so without it a called scene would answer
for the ranges of its caller.
### Resume on startup
Jobs are scheduled for the future only, so a boundary crossed while Gladys was
down is never replayed: a pool pump stopped by a power cut would stay off for
the rest of the range, and one left on would keep running long after the range
ended.
With the optional **resume on startup** checkbox, the scene is executed once at
startup with `range_event = 'resume'` and `in_range` telling whether we are
currently inside the planning. The scene re-applies the wanted state itself —
Gladys does not know which device it drives, so re-applying is both simpler and
safer than guessing. The resume runs **once per boot**: `init()` also runs when
the user changes the timezone in the settings, and re-applying the planning
then would run these scenes again for no reason.
<img width="1133" height="638" alt="image" src="https://github.com/user-attachments/assets/3d12f634-aed8-4af5-ba82-05beea28a6be" />
<img width="1142" height="271" alt="image" src="https://github.com/user-attachments/assets/01455b56-2074-4d08-b5d8-e01e4cf366a4" />
### 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
## Summary by CodeRabbit
## New Features
- Added time-range scheduling for scenes with configurable weekdays, start/end times, overnight ranges, and optional startup resumption.
- Added an “In time range” condition for scene actions.
- Added localized English, German, and French labels, guidance, and menu scrolling controls.
## Bug Fixes
- Improved validation for invalid times, empty schedules, and identical start/end times.
- Improved handling of overlapping and adjacent ranges.
- Preserved edits made while a scene save is in progress.