Skip to main content

Canonical technical source, synchronized from the repository at build time. GitHub

Feature specification: continuous Shabbat and Yom Tov planning

Status: multi-day compilation and reviewed copy-day are implemented. Feature 008 adds the installed Jewish Calendar provider; Feature 010 adds frozen observe snapshots and the accepted future execution policy. General v1 migration, full observance-conditioned automation forecasts and live execution remain pending. The original v1 preview remains single-Shabbat.

User scenarios​

A household plans the whole upcoming observance before it starts, whether one day, two days, or three consecutive days. Each evening/day has its own meals, sleeping/recreation uses, lighting and HVAC profiles. Copying a day is an explicit convenience; it does not silently assume identical plans.

The preferred live status source is the configured “issur melacha in effect” entity. Future calendar data supplies dated boundaries and anchors. An on/off signal alone cannot tell the planner when future meals, sunrise or the next evening occur.

Functional requirements​

  • MD-FR-001: Model a continuous observance period containing ordered dated segments, each categorized as Shabbat or Yom Tov (with optional holiday metadata). Support at least one, two and three consecutive days, including two-day Rosh Hashanah in Israel and Shabbat adjoining two-day Yom Tov in diaspora settings. Israel/diaspora observance is an explicit installation setting, independent of UI language and timezone.
  • MD-FR-002: Map the live active-state signal to an owner-selected entity; preserve on, off, unknown and unavailable distinctly. Do not infer a specific integration from its display name. Missing/contradictory status and calendar coverage must be visible. Before execution, define and test mismatch/outage policy; unknown is never treated as off.
  • MD-FR-003: Require future dated coverage for the full period, including preparation before its start, each evening’s applicable candle-lighting anchor, each sunrise and the final agreed end. Preserve source, calculation/observance settings, timezone and snapshot version. Never infer future boundaries from binary transitions or blindly add 24 hours.
  • MD-FR-004: Provide dated meal slots per segment (evening/daytime and configurable additional meals), with away, household or hosting choices and explicit unset status. Permit a no-meal profile; never assume every holiday has meals. Separate meal setup, serving and cleanup windows where configured. All required choices must be resolved before approval.
  • MD-FR-005: Plan home/away and room uses by time window, including overnight stays across segment boundaries. Apply shared-resource dependencies across all overlapping uses. Keep independent lighting and HVAC offsets and room-specific sleep/wake profiles; do not reset occupancy or turn everything off at an internal day boundary.
  • MD-FR-006: Every relative rule identifies its dated anchor and segment explicitly. Evening offsets remain relative to applicable candle lighting, not sunset. First-evening and subsequent-evening candle times are separate provider-supplied values under the owner’s conventions; do not assume a later evening uses the first evening’s pre-sunset offset. Sunrise offsets and fixed local times remain distinct. Show actual dates and times in the preview.
  • MD-FR-007: Compile and approve the entire period before its earliest preparation action. Freeze one version covering all segments. Internal calendar changes or the active signal staying on do not require a new manual activation or terminate the plan. Late changes require an explicit future execution policy, not a hidden automatic recompile.
  • MD-FR-008: Show a whole-period overview and separate dated day panels with meal and room-use completeness, per-day overrides and a combined timeline. Offer explicit copy-to-next-day with review of resulting times. Label source status and future coverage separately. Support English/Hebrew and RTL through multilingual catalogs.
  • MD-FR-009: Resolve shared loads and contradictory events across segment boundaries as well as within a day. Give each event stable period/segment/rule identity. Keep per-night catch-all rules and temporary extensions scoped to a specific dated night, with one owner.
  • MD-FR-010: End-of-period restoration occurs only at the final agreed end under the approved execution policy. Existing boiler or other automation suspension, when selected, spans its configured window without accidental restoration at intermediate day boundaries.

Data model direction​

A versioned period contains period_id, timezone, observance settings, start/end and provenance; ordered segments contain stable IDs, local dates, categories and named dated anchors. Meals and room-use windows refer to segment IDs or explicit intervals. Rules reference anchors explicitly. Live sensor observations are separate from the immutable calendar snapshot and plan digest. Version 1 drafts remain readable via an explicit migration; do not reinterpret their Friday/Saturday fields silently.

Nonfunctional requirements​

  • MD-NFR-001: Identical normalized inputs and calendar snapshot produce identical events/digest, irrespective of language or current sensor rollover.
  • MD-NFR-002: Compare instants in UTC, display with the configured IANA timezone, and validate ambiguous/nonexistent fixed local times. Elapsed offsets and calendar-day recurrence must remain distinct across DST.
  • MD-NFR-003: Full-period coverage and validation errors block approval; never silently truncate a three-day plan to one day. Bound period/event sizes and document supported limits before implementation.
  • MD-NFR-004: Synthetic fixtures only; no home-specific entity IDs or family information in the repository. No new calendar dependency without owner review.

Required acceptance cases for implementation​

  1. Ordinary Shabbat: one evening/day, independent meals and room profiles.
  2. Two-day Rosh Hashanah under Israel settings: separate meals and anchors; no intermediate reset.
  3. Two-day Yom Tov followed by Shabbat, and Shabbat followed by two-day Yom Tov: three-day timelines, distinct evening conventions, final restoration only once.
  4. A live sensor remains on throughout: segment two/three events still occur from the approved dated plan.
  5. Different meal/home/room selections per day, overnight shared-bath dependencies and overlapping cross-day rules.
  6. No-meal profile and additional meal slots; unset required selections block approval.
  7. Missing final-day anchors, source rollover, unavailable sensor or conflicting status: visible diagnostics and no implicit approval or early restoration.
  8. DST, midnight-crossing offsets, fixed nightly catch-all and per-night extensions; locale change leaves event identity unchanged.

Implementation sequence and review points​

First settle the provider contract and inspect available future coverage read-only. Then implement a versioned period schema and compiler fixtures, followed by the dated multi-day dashboard, migration and full-period validation. Add execution/status reconciliation only in the separately reviewed executor phase. Confirm provider(s), subsequent-evening conventions, freeze timing and mismatch/outage behavior before production activation.

The v1 compiler deliberately still rejects multi-day input; the new v2 compiler accepts supplied multi-day snapshots. This specification promotes multi-day planning to the integration foundation rather than promising it in today’s preview.

Branded printable plan export (approved follow-up)​

  • MD-FR-011: Offer Export PDF alongside JSON for a complete, current preview. Use a dedicated branded print layout and the browser Save as PDF flow, explicitly identified in the UI. Include logo, preview-only status, timezone, dated period and per-day anchors, home/away windows, meals, room uses, warnings and every scheduled event with distinct action text/badges. Preserve JSON export.
  • MD-FR-012: Invalidate PDF availability after schedule edits until a new complete preview exists. Printing must never compile silently, mutate the plan or activate devices. Exclude editors, navigation and raw configuration; disclose that shared reports contain household plan details.
  • MD-NFR-005: Support English/Hebrew and RTL, readable A4 pagination, repeated table headers, unbroken event rows where possible, long-name wrapping and useful grayscale action labels. Generate locally with browser facilities and existing assets, without external requests or new runtime dependencies. Verify multi-day output and stale/incomplete gating. Native HA WebView print support may vary; provide guidance to open in a browser.

Calendar context and visual lighting schedule​

  • MD-FR-013: Retain dated all-day Jewish Calendar summaries (Hebrew date, weekly portion, holiday and other configured observance details) alongside each supplied segment. Display provider text in day cards and PDF without translating or guessing unavailable values. Manual/older snapshots remain valid; metadata never supplies timing anchors.
  • MD-FR-014: Present boxed day summaries and a lighting Gantt view in both HTML and PDF, grouped by explicitly mapped Bedroom, Bathroom, Common Area and Hallway, with a separate lane per main/night lighting load. Legacy/unmapped types remain explicitly unclassified. Preserve the event list and action badges.
  • MD-FR-015: Plot planned binary lighting On intervals on local midnight-to-midnight axes, covering preparation and the full observance. Carry planned state across dates; before the first state command show Unknown, not Off. Track-only entries do not establish state. Clip at report boundaries; an unreleased On continues to the boundary without implying an Off command. Show local clock ticks with UTC offsets, including 23/25-hour DST days.
  • MD-NFR-006: Use a shared HTML/PDF renderer, local assets and no chart dependency. Provide textual interval descriptions, EN/HE/RTL, grayscale distinctions, bounded day/lane pagination and horizontal scrolling on small screens. Presentation metadata must not change event output or semantic digest. Test carryover, unknown state, final release suppression, DST, safe provider strings, old snapshots and metadata validation. Upgrade preserves saved setup; new workspaces capture new presentation metadata.

Whole-period HVAC chart​

  • MD-FR-016: Show all HVAC units with planned control events on one continuous candle-lighting-to-final-observance-end timeline, alongside the lighting map and event list in HTML and PDF. Use actual supplied anchors (typically about 25 hours, potentially several days), not a fixed duration or daily reset. Represent both profile HVAC and power-only HVAC as On/Off without altering settings or events.
  • MD-FR-017: Use small cells representing 30 elapsed minutes. Split mixed cells at exact transition positions rather than rounding short episodes away; scale the last partial cell to its duration. Carry pre-candle commands into the chart, mark initial unknown explicitly, omit track-only commands from state inference, and show each physical HVAC unit once. Hover/accessibility text must identify exact interval boundaries in local time with offsets. An On carried to the final boundary does not imply an Off command there.
  • MD-NFR-007: Reuse local rendering and existing catalogs, support EN/HE/RTL, horizontal scrolling on narrow screens, and readable print chunks with a repeated full-period axis. Test exact boundaries, short episodes, mixed cells, heating/cooling/power-only modes, duplicate physical aliases, DST, multi-day periods, unknown initial state, incomplete previews and input immutability. No new runtime dependency or device calls. Deployment must respect the homeowner's requested screen-use restrictions.

Bedroom rest extension: Feature 009 US12 (WIZ-FR-036–041, WIZ-NFR-018–019) specifies independently dated naps and wake-up overrides for each room/day. This extends MD-FR-005 and the HVAC chart requirements; it is implemented in preview 0.10.0 with optional nap records and independent HVAC wake-up overrides.

Shabbat afternoon hosting (approved for implementation)​

  • MD-FR-018: Offer an optional Shabbat afternoon hosting / Seudah Shlishit activity on each Shabbat segment. Default disabled; enable only by explicit choice, without guessing from season/day length. Default start is 150 minutes before the supplied Shabbat end and end is that boundary, with editable timing and participating meal lighting/HVAC groups. Reuse lunch groups initially and allow explicit group review. No automatic night-background switchover is introduced by this activity.
  • MD-FR-019: Show the activity separately from lunch, with a Hosting/Not planned choice and local dated times. Compatible meal/activity/room demands union without premature release. Existing daylight breaks still apply to lighting and must be explained. If Shabbat is followed by Yom Tov and the supplied segment boundary is a candle transition rather than a reliable Shabbat-end anchor, require an explicit reviewed activity window instead of claiming a known Shabbat-end offset.
  • MD-NFR-008: Preserve old snapshots, disabled default, power-only HVAC intent, end-of-period no-shutoff policy, multilingual UI and PDF/chart summaries. Test disabled versus enabled demand, timing/bounds, room selection, overlap and multi-day Shabbat boundaries.

Existing HA automation overlay (specification only)​

  • MD-FR-020: Read existing enabled HA automation definitions and display predictable scheduled actions alongside planner events, explicitly labeled Existing HA automation. Initial scope: fixed local time/date triggers, supported sun triggers/offsets, and triggers/conditions on the homeowner-mapped issur-melacha state when its future value/transition can be resolved from the dated calendar snapshot. Keep automation identity, provenance and snapshot freshness visible; no copied automations or ownership transfer.
  • MD-FR-021: Evaluate supported time/weekday and known observance-state conditions against the dated snapshot. Include direct light/switch/HVAC actions and explicitly supported finite delays; expand supported bounded sequences only. Disabled automations do not run. Unknown templates, unresolvable helper times, additional unknown conditions/actions, scripts that cannot be expanded, or missing observance-transition anchors must be labeled unresolved rather than assigned invented times. Never equate candle lighting or an internal multi-day boundary with issur-melacha transitions unless the mapped provider contract explicitly establishes that relationship.
  • MD-FR-022: Combine this read-only overlay with planner schedule/chart/PDF using visually distinct badges and legends; offer include/exclude filters. Highlight potentially contradictory actions on the same physical devices with source attribution. Overlay events do not become planner commands and cannot silently modify the planner's demand union. Time-based automations remain owned and executed by HA.
  • MD-NFR-009: Use supported read-only access where available; household definitions/IDs stay local. Freeze source definitions, enabled state, timezone and resolved observance assumptions for reproducible previews. Revalidate freshness before any future approval. Test fixed times, sun offsets, DST ambiguity, time-plus-known-issur conditions, known state-transition triggers, long observances, disabled automations, finite delays, duplicate targets and unresolved cases. This is a forecast under recorded assumptions, not a guarantee that HA will execute despite outages or intervening edits. Implementation is a separate follow-up.

Home presence from explicit planning selections (0.16.4)​

  • MD-FR-023: Selecting a used sleeping/recreation room (including existing-control intent), adding a nap, or selecting family/hosting for a meal automatically sets the relevant simple day-level availability to Home, including that day's preparation coverage. Reflect this immediately in Someone home. Do not infer presence from observed device activity. Removing a choice never automatically marks everyone away.
  • MD-FR-024: Preserve explicit advanced partial-day/mixed availability windows and explain that these must be reviewed when adding room/meal use. Do not silently overwrite away intervals. A later explicit Away selection retains normal conflict review. Changes on one day must not change another day's availability or profiles.
  • MD-NFR-010: Immutable model operations, EN/HE explanatory copy, existing export/storage schema, deterministic compilation, and tests for meals, naps, existing-control rooms, removal, custom windows, multi-day isolation and input immutability. No implicit saving, observation activation or device execution.

Simpler PDF font embedding​

  • MD-FR-025: Use a print-only Arial, Tahoma, sans-serif font stack for plan and observation reports, preserving the screen font, semantic emphasis, English/Hebrew text and RTL. Use a stylesheet cache marker so refreshed reports load the updated font preference. Let the browser embed available font subsets; do not bundle proprietary font files or fetch fonts remotely.
  • MD-NFR-011: Verify a fictional bilingual browser-exported comparison for embedded font format and visual legibility. Document browser/platform fallback limits and distinguish font simplification from measured mobile performance; do not claim a phone speed improvement without a phone test.