Auto Off turns off selected entities after a configurable inactivity delay when a group of activity sensors goes off. See custom_components/auto_off/README.md for details.
Occupancy sensors used to live in this repository as door_occupancy.
Because HACS cannot install two integrations from a single repository, it
now has its own repo:
- Door Occupancy — auto-discovers doors, locks, and covers and creates
binary_sensor.*_occupancyentities. Repo: AlexMKX/ha_door_occupancy.
The two integrations are fully independent (separate domains, config flows, services, and config entries). Install whichever ones you need.
- Add this repo (
https://github.com/AlexMKX/ha_auto_off) to HACS as a Custom Repository (category: Integration). - (Optional, for occupancy sensors) Add
https://github.com/AlexMKX/ha_door_occupancyas a second Custom Repository (category: Integration). - Install Auto Off (and Door Occupancy if added).
- Restart Home Assistant.
- Settings → Devices & services → Add integration → Auto Off (and/or Door Occupancy).
Copy custom_components/auto_off/ into <config>/custom_components/ and
restart Home Assistant. For Door Occupancy, clone the companion repo and
copy custom_components/door_occupancy/ similarly.
Each auto_off group creates a Home Assistant device Auto Off: <group_name> with the following entities:
sensor.auto_off_<group>_deadline— current deadline (human-readable) with adeadline_isoattribute.text.auto_off_<group>_delay_minutes— editable delay (supports templates).binary_sensor.auto_off_<group>_sensors— OR-group over the configuredsensors. Itsentity_idattribute lists the member binary_sensors;sensor_templatesattribute lists any configured Jinja templates.<domain>.auto_off_<group>_targets_<domain>— one group entity per target domain (e.g.light,switch,fan,cover,media_player,lock,valve). Each aggregates the targets in that domain and turns them all off at deadline expiry.
Targets in domains without a HA group platform (e.g. scene) do not get
a group entity; they are turned off individually at deadline expiry.
Breaking change (since group entities): The
extra_state_attributesof the deadline sensor no longer includestargets,sensors, orsensor_templates. If you have automations reading those attributes, switch to the new group entities listed above.
Starting with release 2604231655, the integration is split. This is a
breaking change for users of the old unified auto_off.
-
Update HACS to the latest Auto Off release. v2 config entries are migrated to v3 automatically on restart. Any legacy
*_occupancyentities that used to be owned by auto_off will remain as orphaned entries in the entity registry — remove them manually via Settings → Devices & services → Entities, or install Door Occupancy which will recreate them with the same unique_ids and take ownership. -
(Optional) Install Door Occupancy from the companion repo if you want auto-discovered occupancy sensors.
-
If you recreated groups from scratch, use the new
auto_off.set_grouppayload shape:# before (unified 2512.x) action: auto_off.set_group data: group_name: kitchen config: | sensors: - binary_sensor.motion_kitchen targets: - light.kitchen delay: 5 # after action: auto_off.set_group data: group_name: kitchen targets: - light.kitchen sensors: - binary_sensor.motion_kitchen delay: 5
If you previously embedded Jinja templates in the sensor list (detected by the presence of
{{), move those into the newsensor_templatesfield.Note: the
targetsfield accepts only concrete entity ids (domain.object_id). Jinja templates intargetsare no longer supported. If you previously used template targets, replace them with the resolved entity ids and callauto_off.set_groupwith the updated payload.
Every operation on auto_off is exposed as an action with a stable YAML
payload (auto_off.set_group, auto_off.delete_group,
auto_off.dump_group). There is no required UI clicking — groups can
be created, edited, dumped, backed up, migrated, or driven by LLM
agents and CI pipelines.
See custom_components/auto_off/README.md for the full action reference and the dump → edit → set workflow.