Multi-record clausal programs are now editable end-to-end. A chain
spans N consecutive slots — head (WHEN/AT/EVERY) + zero-or-more
AND/OR condition records + one-or-more THEN action records — so
"editing" means rewriting the whole run, validating that any
expansion doesn't trample adjacent programs, and clearing any old
slots when the chain shrinks.
H1 — backend:
* programs/get for chains now returns chain_members[] with each
member's slot + role + raw fields. The editor uses this to seed
one editable form-row per slot.
* New programs/chain/write command: takes head_slot + head dict +
conditions[] + actions[], does N sequential download_program
calls, then clears any old chain slots that fell outside the new
range. Validates:
- head_slot + new_len doesn't extend past slot 1500
- any expansion-into slot not already part of THIS chain is FREE
(anti-trample: refuse rather than overwrite an adjacent program)
- at least one THEN action present (empty chain rejected)
Updates coordinator.data.programs immediately so subsequent list
calls reflect the edit before the next poll.
H2 — TS helpers:
* AND-record encoding mirrors compact-form cond family bytes
(0x04 ZONE / 0x08 CTRL / 0x0C TIME / 0x00 OTHER + 0x10+ SEC) but
with a slightly different bit layout: the family byte lives at
fields.cond & 0xFF (disk byte 1) and the instance at
(fields.cond2 >> 8) & 0xFF (disk byte 3). The selector bit is
family's bit 0x02 instead of cond's 0x0200. decodeAndCondition /
encodeAndCondition handle both directions; round-trip exact.
* isStructuredAnd helper detects records with OP > 0 (TEMP > N
comparisons etc.); those render read-only in the chain editor
with a warning banner.
* emptyAndRecord / emptyOrRecord / emptyThenRecord helpers for
the add-condition / add-action buttons.
H3 — chain editor UI:
* New _chainDraft state (parallel to _editingDraft for compact form)
with head + conditions[] + actions[] arrays. Mutation helpers
preserve immutability via array-copy-then-patch.
* "Edit" button on chain detail now opens the chain editor instead
of returning early (previous read-only behaviour).
* Three sub-renderers: trigger section dispatches on prog_type
(WHEN→event-id builder reusing the EVENT helpers, AT→time+days
reusing TIMED layout, EVERY→single seconds input that packs into
cond+cond2), conditions section with per-row add/remove (separate
+ AND IF and + OR IF buttons in the legend), actions section with
per-row add/remove (+ THEN button; at least one action enforced).
* Structured-OP AND records render with an explanatory read-only
banner and a × button to drop the row entirely — preserves the
data when the user doesn't touch it, lets them remove it cleanly
when they want to.
* Each row picks objects via _bucketWithPreserve so out-of-range
zone/unit/area indices stay safe.
5 new HA integration tests:
* get-chain returns chain_members with correct roles + raw fields
* chain/write in-place rewrite preserves footprint, updates bytes
* chain/write shrink clears the trailing old slots
* chain/write refuses to trample an adjacent program on expansion
* chain/write rejects zero-actions submission
Live screenshot 11-chain-editor.png: state injection into the side
panel (real panel has no chains) shows the editor rendering a sample
WHEN zone-state → AND IF unit ON → 2x THEN action chain with every
control populated and functional.
Full suite: 653 passed, 1 skipped (up from 648, 5 new chain tests).
Frontend bundle: 82 KB minified (up from 63 KB).
HAI / Leviton Omni Panel — Home Assistant Integration
Native HA integration that talks Omni-Link II directly to your Omni Pro II / Omni IIe / Omni LTe / Lumina controller over TCP. No middleware — HA opens an encrypted session straight to the panel and listens for unsolicited push messages.
This integration is the HA-facing wrapper around the
omni-pca Python library; the library
handles the wire protocol, this component surfaces it as HA entities.
Install
HACS
- HACS → Integrations → search HAI / Leviton Omni Panel.
- Install, then restart Home Assistant.
(If not yet in the HACS default catalog: HACS → Integrations → custom
repository → add https://github.com/rsp2k/omni-pca, category Integration.)
Manual
Copy the custom_components/omni_pca/ directory into your HA
config/custom_components/ directory and restart HA.
Configure
- Settings → Devices & Services → Add Integration → search for HAI/Leviton Omni Panel.
- Enter:
- Host — IP or hostname of the panel (e.g.
192.168.1.50) - Port — defaults to
4369(HAI's reserved port) - Controller Key — 32 hex characters, the panel's NVRAM key
- Host — IP or hostname of the panel (e.g.
- Save. The panel appears as a single device with entities per object.
Where do I get the Controller Key?
If you have a .pca configuration export from PC Access, the included CLI
extracts the key for you:
uvx omni-pca decode-pca '/path/to/My House.pca' --field controller_key
Otherwise, find it in PC Access under the panel's Setup → Misc → Network page (HAI labels it "Encryption Key 1").
Entities created
One device per panel, plus per-object entities below.
| Platform | Entity | Per |
|---|---|---|
alarm_control_panel |
Area arm/disarm with code | discovered area |
binary_sensor |
Zone open/tripped | binary zone |
binary_sensor |
Zone bypassed (diagnostic) | binary zone |
binary_sensor |
AC power, backup battery, system trouble | panel |
button |
Panel button macro | discovered button |
climate |
Thermostat (heat/cool/auto, fan, hold) | discovered thermostat |
event |
Typed push event relay | panel |
light |
Unit on/off + brightness | discovered unit |
sensor |
Analog zone (temp/humidity/power) | analog zone |
sensor |
Thermostat current temp / humidity / outdoor temp | thermostat |
sensor |
Panel model + firmware, last event class | panel |
switch |
Zone bypass toggle | binary zone |
State propagates via the panel's unsolicited push messages: zone changes, arming changes, AC/battery troubles, etc. all arrive within one TCP round- trip. A 30-second background poll backstops anything that didn't push.
Services
| Service | Purpose |
|---|---|
omni_pca.bypass_zone |
Bypass a zone by 1-based index |
omni_pca.restore_zone |
Restore a previously-bypassed zone |
omni_pca.execute_program |
Run a stored program by index |
omni_pca.show_message |
Display a stored message on consoles |
omni_pca.clear_message |
Clear a displayed message |
omni_pca.acknowledge_alerts |
Clear all outstanding troubles/alerts |
omni_pca.send_command |
Power-user escape hatch (raw Command opcode) |
Every service takes an entry_id so it picks the right panel when you have
multiple configured.
Automation example
React to any alarm activation in real time:
automation:
- alias: Notify on alarm
trigger:
- platform: event
event_type: state_changed
event_data:
entity_id: event.panel_events
condition: >
{{ trigger.event.data.new_state.attributes.event_type ==
"alarm_activated" }}
action:
- service: notify.mobile_app
data:
title: ALARM
message: >
Area {{ trigger.event.data.new_state.attributes.area_index }}
Diagnostics
Settings → Devices & Services → HAI/Leviton Omni Panel → ⋮ → Download diagnostics dumps a redacted snapshot (controller key removed, zone names hashed) — useful for bug reports.
Troubleshooting
- Won't connect: confirm port 4369 is open on the panel. The Omni Pro II's network module ships off by default; enable it under Setup → Misc → Network on a console.
- Authentication failed: re-check the Controller Key. The integration triggers HA's reauth flow when the panel rejects the key.
- No entities for X: only objects with a name configured on the panel are discovered. PC Access's "Names" page is where they live.
See the parent README for protocol /
library details. Detailed reverse-engineering notes are in
docs/JOURNEY.md.