Rules configuration guide

Rules Engine

Backup is the recovery source

Use Export rules backup before changing a working configuration. Keep that JSON file on your computer. It includes the complete editable configuration: devices, calculated fields and expressions, system fields, events, logging, notification settings and disabled definitions. It includes current unsaved form edits. It excludes Firebase revisions, published identities and application credentials.

Download runtime JSON is different. It is compiled for Tab5 and does not preserve the full editable configuration. It cannot be imported as a backup. Neither file restores Firebase credentials/security rules, installed Tab5 software or its connection settings.

Load working rules

Use Load… and choose Seed, Last saved, a published version (the 10 most recent), or Load Backup JSON. Every choice replaces only the editor contents. Loading never saves, publishes or delivers. If you have unsaved work, confirm discarding it first.

Save Draft saves the complete working configuration regardless of where it came from. To cancel unsaved changes, use Load → Last saved. Validate does not save. Export rules backup includes unsaved changes.

A backup can initialize an empty V3 authoring store when you save it. Seed also loads only into the editor. Malformed backup files leave the editor unchanged; structurally complete unfinished or unsupported rules can load and save, but cannot publish until corrected. Save replaces all four sections in one revision-checked transaction; a conflict leaves the stored draft unchanged.

AI-assisted changes

Provide your current exported backup and describe the requested changes. Ask for a revised complete authoring backup, preserving all unrelated definitions and references. There is no partial/additive import or automatic conflict merging. Supply this guide when helpful. The backup envelope is:

{
  "kind": "well-pump-rules-authoring-backup",
  "backupVersion": 1,
  "authoringPackage": {
    "schemaVersion": 3,
    "devices": [...],
    "calculatedFields": [...],
    "systemFields": [...],
    "events": [...]
  }
}

The ellipses illustrate the format, not an importable file. Use an actual exported backup as the complete example. Do not add credentials, revision metadata, release IDs or compiled runtime properties. Partial files and V2/runtime packages are rejected. The browser import limit is 500,000 bytes.

Edit and validate

Devices define named measurements and the supported relay mapping. Calculated Fields define arithmetic expressions and the Boyle tank model. System Fields define session values and occurrences. Events define independent opening and closing policies, qualifications, assignments and guards.

System names use 2–64 characters: a letter first, then letters, digits or underscores. Put spaces in display names. Field names are references; renaming one does not automatically rename its users. Validation identifies unresolved references and duplicate names. Select a finding to navigate to its definition/control.

Validate checks the current editor contents without saving. Save Draft replaces all sections together. If saving fails, your edits remain in the browser; export a backup before reloading after a conflict. Changing a draft invalidates its runtime preview.

Online validation targets Tab5 M6.33. It checks the current binding catalog, expression and function restrictions, typed assignments, ownership restrictions, ADC prerequisites and package limits. It is host verification, not proof that a device is connected or a sensor commissioned. Missing live evidence remains unavailable on Tab5.

Publish and Deliver

  1. Select Publish and Deliver. It validates and shows any warnings, then saves and publishes if you continue.
  2. Each deliberate publication creates a new immutable version, even when the configuration is unchanged.
  3. Delivery requests that Tab5 download the release. If delivery fails or the response is interrupted, Retry delivery uses the published version without creating another version. If publication itself has an uncertain outcome, the editor attempts to identify the committed version. If it cannot confirm it, Load → Last saved and inspect the last published version before publishing again. A new deliberate Publish creates another version.
  4. Refresh Tab5 status. Compare the release ID and hash with the staged identity. The report includes its timestamp and is not proof of a live connection.
  5. Restart Tab5 through your normal procedure. Refresh status and confirm the running identity matches the intended release. Downloading alone never replaces the running kernel.

Published means stored on the server. Delivery requested means the server pointer was sent. Staged means Tab5 reported a validated next-restart package. Running means Tab5 reported the adopted package. The refresh result shows when the check completed and distinguishes no report, invalid format, timeout, access denial, configuration failure and other read failures. An unavailable or old report cannot confirm the current device state. A rejection shows the reported reason.

Supported relay command

The supported write is Switch.Set for relay 0. The mapping {"id":0,"valueParameter":"on"} inserts the rule's Boolean assignment into {"id":0,"on":false} or {"id":0,"on":true}. “Use supported relay mapping” sets the approved mapping; arbitrary methods are not supported. The current runtime requires the names PumpEnable and IsLocked for relay ownership and lock evidence.

False inhibits; true releases Tab5 inhibition to mechanical control, subject to current lock evidence and other owners. It does not create ordinary pump demand. Device addresses in this editor describe the devices; installed Tab5 settings currently own the actual polling endpoints. Shelly-local and hardwired protections remain authoritative.

Current limits

Existing release restoration

Use Load → Published and choose a version. Its authoring rules load into the editor without saving. Validate and publish to restore those rules under a new version number. The selector shows the 10 most recent releases; this does not delete older releases. Long-term history is not required for recovery; keep your exported backup. Restoring source branches is also separate from restoring configuration or installed Tab5 software.