Skip to content

Trigger an HA automation on alarm activation

The integration’s event entity (one per panel) emits HA event-bus events for every typed SystemEvent the panel pushes. Filter on the event type to react to alarms specifically.

configuration.yaml or as an automation
automation:
- alias: "Notify on Omni alarm"
trigger:
- platform: state
entity_id: event.omni_pro_ii_panel_events
attributes:
event_type: alarm_activated
action:
- service: notify.mobile_app_my_phone
data:
title: "ALARM"
message: >
Area {{ trigger.to_state.attributes.event_data.area_index }}
type {{ trigger.to_state.attributes.event_data.alarm_type }}

The event entity’s state is the timestamp of the most recent event; its event_type and event_data attributes carry the typed payload. Trigger on a state change with attributes.event_type == alarm_activated.

alarm_type is an integer matching omni_pca.events.AlarmKind:

alarm_typeMeaning
1Burglary
2Fire
3Auxiliary / Police
4Duress
5Tamper
6Trouble
7Freeze
8Water

Add a condition to filter:

automation:
- alias: "Smoke alarm only"
trigger:
- platform: state
entity_id: event.omni_pro_ii_panel_events
attributes:
event_type: alarm_activated
condition:
- condition: template
value_template: "{{ trigger.to_state.attributes.event_data.alarm_type == 2 }}"
action:
- service: light.turn_on
target:
entity_id: light.all_house_lights
data:
brightness: 255
- service: notify.mobile_app_my_phone
data:
title: "FIRE ALARM"
message: "Smoke detector tripped — area {{ trigger.to_state.attributes.event_data.area_index }}"

Subset most automations want:

event_typeFired when
alarm_activatedAny alarm starts
alarm_clearedAlarm acknowledged / system disarmed
arming_changedArea arm state changes (event_data.new_mode is the new SecurityMode)
zone_state_changedZone opens / closes / is bypassed
unit_state_changedLight or output toggles
ac_lost / ac_restoredMains power loss / restore
battery_low / battery_restoredBackup battery thresholds
phone_line_dead / phone_line_restoredDSL/POTS supervision

The full list (26 typed subclasses + unknown catch-all) is in the library API reference.

Use the dev stack — the mock panel will let you push synthetic events through the same machinery:

# in a Python script against the mock
await panel.execute_security_command(area=1, mode=SecurityMode.AWAY, code=1234)

That triggers arming_changed. For real alarm activation against the mock, you’d need to extend MockPanel to push an AlarmActivated event on a synthesized zone trip — left as an exercise, but the pattern is identical to how ArmingChanged is pushed in _handle_execute_security_command.

  • The event entity is a single entity per panel, not one per alarm. You filter inside automations, not via separate entities.
  • alarm_cleared doesn’t always fire — older firmware (pre-3.0) only emits the activation; you’ll need to listen for arming_changed → disarmed instead.
  • The event_data dict is JSON-serialised, which means enum values appear as their integer values, not names. The AlarmKind table above maps them.