Real-world programs reference object indexes well past the coordinator's discovery range — typical example from a live OmniPro II: a program that's "Turn ON Unit 33025" where the unit number is a raw byte value from undecoded extended-output addressing. The discovered units bucket only covers slots up to ~511, so 33025 doesn't match any entry. Before this commit the dropdown silently fell through to the first known unit (e.g. ROOM ONE), making it look like the user had selected that unit. The underlying draft.pr2 stayed at 33025, but a user who glanced at the form and clicked Save would either preserve the original (if they didn't touch the select) or accidentally clobber it with the first list item (if they did). Fix: _bucketWithPreserve prepends a synthesized option "(undiscovered <kind> <idx> — preserve original)" when the current value isn't represented. Applies in all four picker sites: * Action object picker (Unit / Zone / Area / Button for action commands) * EVENT trigger Button picker * EVENT trigger Zone picker * EVENT trigger Unit picker The synthesized entry sits at the top of the list (visually distinct) and is the selected default. Picking any other entry from the dropdown then becomes an explicit choice — no more silent coercion. Smoke-tested against the real panel: slot #1 (WHEN OPEN BIG GAR → Turn ON Unit 33025) now shows "#33025 (undiscovered unit 33025 — preserve original)" as the selected Unit option. Screenshots updated.
Dev stack
Local Home Assistant + MockPanel for clicking around the integration without a real Omni controller. Useful for screenshots, manual smoke tests, and seeing what the entity layout looks like.
Quick start
cd dev/
make dev-up # docker compose up -d
# wait ~30s for HA to boot
open http://localhost:8123
First time: HA onboarding wizard (any name / location works). Then:
- Settings → Devices & Services → Add Integration
- Search for HAI/Leviton Omni Panel
- Fill in:
- host:
host.docker.internal - port:
14369 - controller key:
000102030405060708090a0b0c0d0e0f
- host:
- Submit. Within a few seconds you should see the Omni Pro II device with ~25 entities (binary sensors, lights, alarm panel, climate, sensors, buttons, switches, the events entity).
What the mock simulates
Five named zones, four units, two areas, two thermostats, three button
macros. User codes 1234 (master, code index 1) and 5678 (code index 2).
Arming the alarm with code 1234 will succeed and the
alarm_control_panel entity transitions through ARMING → ARMED_AWAY in
real time via the panel's push-event simulation. Wrong code → HA error
toast, panel stays disarmed.
Other targets
make dev-logs # tail HA + mock logs
make dev-mock # run only the mock on the host (no docker)
make dev-down # stop the stack
make dev-reset # wipe HA config and start fresh
Notes
- The HA container mounts
../custom_components/omni_pca/read-only, so edits to the integration need a restart (docker compose restart homeassistant) to take effect. - The mock panel binds
0.0.0.0:14369inside the container. If you prefer to talk to it from the host directly (e.g. withomni-pcaCLI), usemake dev-mockto run it natively.