# Advanced Configuration

Source: https://autoarm.rhizomatics.org.uk/configuration/advanced/advanced_config/

Note

Some advanced options remain YAML only, either because they are infrequently needed, or difficult to fit into a standard Home Assistant configuration screen.

### Throttling

To guard against loops, or other reasons why arming might be triggered too often, rate limiting is applied around the arm call, limited to a set number of calls within the past so many seconds. Set with the **Rate limit** fields in the **Advanced - Other** section of the options, and is 5 changes in 60 seconds unless changed.

### When an Event Ends

The **Advanced - Calendar** section of the options has separate settings for an **armed** event ending (`armed_home`, `armed_away`, `armed_night`, `armed_vacation` or `armed_custom_bypass`) and a **disarmed** event ending, unless another event is still live. Each can be:

| Setting                           | Armed event ends                                                                                                                                                            | Disarmed event ends                   |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| **Auto**, the default             | **By occupancy and sun** if the sunrise or sunset [trigger](https://autoarm.rhizomatics.org.uk/usage/how_it_works/#triggers) is active that day, otherwise **By occupancy** | The same                              |
| **By occupancy and sun**          | Worked out from who's home and whether it's day or night, the same as any other reset                                                                                       | The same                              |
| **By occupancy**                  | Disarms, or arms away if everyone is out                                                                                                                                    | Arms home, or away if everyone is out |
| **Manual**                        | Goes back to the state before the event                                                                                                                                     | The same                              |
| A fixed state, such as `disarmed` | Goes to that state                                                                                                                                                          | The same                              |

**By occupancy** ignores day and night. That matters when an event ends close to sunrise or sunset:

An `armed_night` event ending at 06:45, before the sun is up, would be worked out as still night by **By occupancy and sun** and stay armed for the night, until sunrise disarms it a few minutes later. With **By occupancy** it disarms as the event ends.

**Auto** only takes day and night into account when sunrise or sunset will re-evaluate the state that day. With the sunrise and sunset triggers left at their default of **Auto**, they're off on any day with a `disarmed`, `armed_home` or `armed_night` calendar event, so an event ending that day goes by occupancy alone. On a day with only `armed_away`, `armed_vacation` or `armed_custom_bypass` events, they stay on, so an event ending after dark arms for the night if someone is home.

In YAML, these are `auto`, `auto_sun` and `auto_occupancy` for `no_event_mode`, `armed_end_mode` and `disarmed_end_mode`.

### Other Resets When Using Calendars

Resets that don't come from an event starting or ending, such as sunrise, someone arriving or leaving, or the reset button, work out the state like this:

1. While an event is live, a reset button or the `autoarm.reset_state` action returns to the event's state. Automatic resets, such as sunrise, leave it alone, along with any manual change made during the event.
1. Otherwise, if an event ended earlier today, the setting for that kind of event ending applies: **Manual** leaves the state alone, **Auto (occupancy)** and fixed states reset as they would at the end of the event, and **Auto (occupancy and diurnal)** works the state out as usual.
1. With no calendar activity today, the state is worked out as if there were no calendars.

### Notification Coalescing

Calendar changes often arrive in pairs - one event ending right as another begins, or a burst of changes from re-matching after a calendar update. To avoid a flurry of notifications for what is really one change, calendar-sourced notifications wait for a grace period (**Notification grace period** in the **Advanced - Calendar** section of the options, default one minute) before sending. If another calendar-sourced change lands within that window, the wait restarts and only the net change - from the state before the first change to the state after the last - is notified. If that nets out to no change at all, nothing is sent.

This only debounces the *notification*; the alarm panel's actual state still updates immediately as each calendar-driven change happens.

### Call Action When Alarm State Changes

Call any Home Assistant action when the state changes, for example to display current alarm state on a screen, with optional Auto Arm template variables.

**Action to Call When Alarm State Changes**, in the **Advanced - Other** section of the options, runs any Home Assistant actions whenever the alarm panel changes state, whatever changed it. It uses the same action editor as automations, so each action's fields are there to fill in. Use it to show the alarm state somewhere, such as an e-ink shelf label or a smart display.

These variables can be used in templates:

| Variable         | Example                          |
| ---------------- | -------------------------------- |
| `to_state`       | `armed_vacation`                 |
| `from_state`     | `disarmed`                       |
| `friendly_state` | `Armed Vacation`                 |
| `alarm_panel`    | `alarm_control_panel.home_alarm` |

For example, to show the state on a [Gicisky](https://github.com/eigger/hass-gicisky) e-ink shelf label by the front door, choose **Gicisky: Write** in the action editor, or switch it to YAML and paste:

```yaml
- action: gicisky.write
  target:
    device_id: <your device>
  data:
    payload:
      - type: text
        value: Alarm
        x: 10
        y: 10
        size: 24
      - type: text
        value: "{{ friendly_state }}"
        x: 10
        y: 44
        size: 40
```

E-ink labels are slow to refresh, so to skip the transitional states, put a condition before it:

```yaml
- condition: template
  value_template: "{{ to_state not in ['arming', 'pending'] }}"
```

It runs on every change, including transitional states like `arming`, `pending` and `triggered`, so add a condition if only some states should be shown. It doesn't run when the panel goes unavailable, or only an attribute changes. Changes are handled one at a time, in order, so a slow display can't show them out of turn.

### YAML Notifications

Deprecated

The YAML `notify` section is deprecated, replaced by deeper Supernotify integration in the options, and will be removed when Home Assistant 2027.4 is released. Use the priorities in the options, and Supernotify scenarios for the `autoarm-` scenario names, in its place. A repair is raised while it is still in the YAML configuration.

More control over notifications is available using YAML configuration,

The alarm status message by default uses a `quiet` profile, and another one called `normal`, which can be overridden with as many profiles named as you like. Each profile is defined by the source of alarm change, optionally restricted by which alarm states are involved, and lets you change the priority, or any of the other message content (the ubiquitous Home Assistant `data` section).

```yaml
notify:
    quiet:
      scenario: nerdy
      data:
        priority: low
    normal:
      source:
        - calendar
      state:
        - armed_vacation
        - armed_away
      data:
        priority: medium
```

If you want to send to e-mail and mobile then this will fail with a notify group unless you use very basic messages, since additional fields, like the `actions` in the `data` field for Actionable Notifications aren't supported by other notification platforms. The best way to resolve that is with [Supernotify](https://supernotify.rhizomatics.org.uk) which will tune each message for the underlying transport ( mobile apps, and also e-mail, text, chime etc.) along with lots of other tuning options and automatic discovery.
