Template Sensor for Alarm System Activity with filters

Greetings,

I’m trying to make a card that shows the arm/disarm activity by PIN for our alarm (Simplisafe). Here’s what I have figured out so far:

I started with the state of the alarm system and figured out how to select an attribute from that state.

Alarm Control Panel Entity Attributes
code_format: number
changed_by: null
code_arm_required: true
last_event_info: System Disarmed by Master PIN
last_event_sensor_name: Office
last_event_sensor_type: keypad
last_event_timestamp: 1713104017
system_id: 1250416
alarm_duration: 480
battery_backup_power_level: 5567
entry_delay_away: 40
entry_delay_home: 60
exit_delay_away: 45
exit_delay_home: 40
gsm_strength: -71
light: false
rf_jamming: false
wall_power_level: 6363
wifi_strength: -58
alarm_volume: high
chime_volume: high
voice_prompt_volume: high
friendly_name: Alarm control panel
supported_features: 3

Using a template sensor helper I started to record those changes to the last_event_info attribute.

‘sensor.alarm_history’

{{ state_attr('alarm_control_panel.alarm_control_panel', 'last_event_info') }}

Then I made a card using the custom logbook card that shows my new sensor’s history.

my card yaml
type: custom:logbook-card
entity: sensor.alarm_history
show:
  state: true
  duration: false
  start_date: true
  end_date: false
  icon: false
  separator: false
  entity_name: true
title: Alarm History
max_items: 10
collapse: 5
custom_logs: false

What I’d like to do is filter out the Exit Delay Countdown Triggered for Home Mode by Keypad records from the sensor.

In my head something like system disarmed * and system armed * could be added to the template sensor configuration somewhere so that only attributes starting with those templates get recorded. Is that possible?

In fact, it was more simple than messing with the template. The custom:logbook-card has ample options for filtering including with wildcards. In my case the following addition to my card yaml did exactly what I needed:

hidden_state:
  - Exit*
full revised card yaml
type: custom:logbook-card
entity: sensor.alarm_history
hidden_state:
  - Exit*
show:
  state: true
  duration: false
  start_date: true
  end_date: false
  icon: false
  separator: true
  entity_name: true
title: Alarm History
max_items: 10
collapse: 5
custom_logs: false
view_layout:
  position: main