RFC 0007: Selectors¶
2026-10-06 · Jey Burrows · Status: Ready for Review
Summary¶
Current design goals are to increase scope of UI, and give as much capability as possible to people who aren't technical, won't mess with YAML, and probably not with conditions.
Looking at my own use of scenarios, the biggest single thing that would cut down the number I have is filtering deliveries by priority and armed state. That covers being quiet at night, or doing something different when house is unoccupied.
Its also common for conditions in scenarios to be relatively complicated for common logic (occupied, time of day), be duplicated across several scenarios and many tests needing only simple priority/occupancy checks.
Selectors and their Variations¶
The conditions are generalized into selectors, with several ways of making a selection
- Empty
- Not applied unless explicitly selected in a notification
- Condition
- Standard Home Asssistant condition blocks, evaluated via HA core routines
- Streamlined
- Limited set of criteria fields available to construct simple AND/OR/NAND logic
- Pre-Defined
- Common conditions that are built into Supernotify
Selectors are not inherently Supernotify, the only linkage is the condition variables. They could be provided by a completely separate integration.
Potential Developments¶
- Delegated
- Selection delegated to a script or AI Task
- Possibility, however could be inefficient and expensive, so future possibility not in current scope
- Sharable Selectors
- Create them as Helpers, in a similar way that Times of the Day sensors are defined and used.
- For example, time/occupancy based ones like 'bedtime', 'getting ready for work', day of year based like 'Xmas' or anything else HA conditions can express.
- These could also be used anywhere else in Home Assistant.
- Built-in ones are presumed to be straight forward to be efficiently event driven (much as AutoArm does) and offered as a
binary_sensor. - Existing scenario logic available for making others available as sensors
- Restricted to conditions that refer to non notification state, e.g. not using
priority.
Where Used¶
While these would be back-ported to scenarios and YAML, the primary target is ConfigFlow UI, including proposed (RFC0013 rules.
Conditional Selectors¶
Reuses Home Assistant condition builder UI.
Streamlined Selectors¶
A UI offers a restricted set of fields:
- Multi-select priority
- Invert button considered, but not required, since very small set of priorities, so easy to define the inverse set
- Multi-select Alarm Control Panel Arm Stats
- Only the primary ones, leave out ephemeral
- Multi-select Occupancy
- Entities and value, with suggestion to use Time of Day, Calendar etc sensor
- A master button to choose "all of these","any of these","none of these"
- Suggestion to use regular conditions for anything more complex
Pre-defined Selectors¶
Lesser priority, if streamlined are quick to define, so reserve for later phase
A combination of priority and armed state, which makes a simple alternative both to AND/OR login in conditions, and to the need for scenarios.
They combine the priority - Minimal, Low, Medium, High, Critical and a special Any - with the main armed states - DISARMED, ARMED_AWAY, ARMED_HOME, ARMED_NIGHT and a special ARMED_ANY.
They are intentionally simplistic, no regular expressions, no conditional logic (although a list of them is effectively a set of ORed AND conditions ).
This also means the general integration settings needs a way of selecting which alarm control panel, though as most people have 0..1 panels, it can automatically choose the first and allow that to be overridden. Most to benefit are Auto Arm users, where the ARMED_HOME, ARMED_AWAY is automatically set based on occupancy.
Example Pre-Defined Selectors¶
Example below is in YAML, however the primary target would be the new Delivery Configflow UI, which then makes them more widely accessible.
Example Delivery YAML¶
yaml delivery: siren: select: - CRITICAL_PRIORITY_ARMED_ANY - CRITICAL_PRIORITY_DISARMED ... alexa_devices: deselect: - ANY_PRIORITY_ARMED_AWAY - MINIMAL_PRIORITY_ARMED_ANY - MINIMAL_PRIORITY_DISARMED
Questions and Issues¶
Why not occupancy? Its only simple if combinations limited, and occupancy is accounted for by alarm control panels (ARMED_HOME,DISARMED,ARMED_NIGHT) Why not time of day? ARMED_NIGHT covers some of that, although there are bigger gaps - 1) day/night during ARMED_AWAY or ARMED_VACATION and 2) night-time vs bed-time, such as switch on floodlights if its dark but only squelch announcements when its bedtime (it can be dark at 4pm in Scottish winter and bright daylight at 4am in summer) - Auto Arm now by default more closely follows HA alarm convention, so ARMED_NIGHT is bed time, and occupied darkness pre-bed time is ARMED_HOME
Why not existing selector? Intention to keep it simple, without 2nd level mapping and regexp. However that doesn't have to be exposed via UI
yaml title="Using selector class and alt naming scheme" delivery: siren: quick_select: include: - PRIORITY_CRITICAL_ARMED_ANY - PRIORITY_CRITICAL_DISARMED - PRIORITY_CRITICAL # implies ARMED_ANY - ARMED_VACATION # implies PRIORITY_ANY ... alexa_devices: quick_select: exclude: - PRIORITY_ANY_ARMED_AWAY - PRIORITY_MINIMAL_ARMED_ANY - PRIORITY_MINIMAL_DISARMED
Why a mix of notification state and property status? Priority from notification, armed status is of the house Armed status condenses several property status
This mode of separate selectors is ostensibly simpler, but makes it harder to do AND/OR conditions simply, e.g. "critical priority OR (high priority AND alarm armed)"
```yaml title="Using separate selectors - REJECT" delivery: siren: alarm_status: include: - ARMED_ANY - ARMED_VACATION ... priority: include: - PRIORITY_CRITICAL ... alexa_devices: alarm_status: exclude: - ARMED_HOME - DISARMED priority: exclude: - PRIORITY_MINIMAL
```