Initial Commit

This commit is contained in:
2026-06-20 18:49:03 +02:00
parent 8c14309eba
commit 5b558c1478
13 changed files with 1405 additions and 3 deletions
@@ -0,0 +1,56 @@
blueprint:
name: Motion-activated Light
description: Turn on a light when motion is detected.
domain: automation
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
author: Home Assistant
input:
motion_entity:
name: Motion Sensor
selector:
entity:
filter:
device_class: motion
domain: binary_sensor
light_target:
name: Light
selector:
target:
entity:
domain: light
no_motion_wait:
name: Wait time
description: Time to leave the light on after last motion is detected.
default: 120
selector:
number:
min: 0
max: 3600
unit_of_measurement: seconds
# If motion is detected within the delay,
# we restart the script.
mode: restart
max_exceeded: silent
trigger:
platform: state
entity_id: !input motion_entity
from: "off"
to: "on"
action:
- alias: "Turn on the light"
service: light.turn_on
target: !input light_target
- alias: "Wait until there is no motion from device"
wait_for_trigger:
platform: state
entity_id: !input motion_entity
from: "on"
to: "off"
- alias: "Wait the number of seconds that has been set"
delay: !input no_motion_wait
- alias: "Turn off the light"
service: light.turn_off
target: !input light_target
@@ -0,0 +1,50 @@
blueprint:
name: Zone Notification
description: Send a notification to a device when a person leaves a specific zone.
domain: automation
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/notify_leaving_zone.yaml
author: Home Assistant
input:
person_entity:
name: Person
selector:
entity:
filter:
domain: person
zone_entity:
name: Zone
selector:
entity:
filter:
domain: zone
notify_device:
name: Device to notify
description: Device needs to run the official Home Assistant app to receive notifications.
selector:
device:
filter:
integration: mobile_app
trigger:
platform: state
entity_id: !input person_entity
variables:
zone_entity: !input zone_entity
# This is the state of the person when it's in this zone.
zone_state: "{{ states[zone_entity].name }}"
person_entity: !input person_entity
person_name: "{{ states[person_entity].name }}"
condition:
condition: template
# The first case handles leaving the Home zone which has a special state when zoning called 'home'.
# The second case handles leaving all other zones.
value_template: "{{ zone_entity == 'zone.home' and trigger.from_state.state == 'home' and trigger.to_state.state != 'home' or trigger.from_state.state == zone_state and trigger.to_state.state != zone_state }}"
action:
- alias: "Notify that a person has left the zone"
domain: mobile_app
type: notify
device_id: !input notify_device
message: "{{ person_name }} has left {{ zone_state }}"
@@ -0,0 +1,200 @@
blueprint:
name: Automatic Backups
description: 'Create backups each day and keep them for a configurable amount of
time, backups are stored less frequently the older they are.
By default all backups are full backups, besides the 3-hourly backups which only
include the configuration.
**Template Variables:**
- `name` — backup name configured below
- `password` — backup password configured below
- `keep_days` — days the backup is kept for based on the current backup type
- `backup_type` — current schedule being created, e.g., `daily`, `weekly`, `monthly`
**Note: requires the [Auto Backup](https://jcwillox.github.io/hass-auto-backup)
custom integration.**
'
domain: automation
input:
backup_name:
name: Name template used for backups
default: "{{ backup_type | title }}Backup: {{\n now().strftime(\n \"%A,
\"\n ~ iif(backup_type == \"hourly\", \"%-I:%M %p, \", \"\")\n ~ \"%B
%-d, %Y\"\n )\n}}\n{# HourlyBackup: Monday, 3:04 PM, January 2, 2006 #}\n{#
DailyBackup: Monday, January 2, 2006 #}\n"
selector:
template: {}
backup_time:
name: Time of day to create backups
default: 02:30:00
selector:
time: {}
backup_password:
name: Backup Password (Optional)
default: ''
selector:
text:
type: password
multiple: false
multiline: false
enable_hourly:
name: 'Enable: Hourly Backups'
description: Create a backup every 3 hours and store for 2 days
default: false
selector:
boolean: {}
enable_daily:
name: 'Enable: Daily Backups'
description: Create a backup each day and store for a week
default: true
selector:
boolean: {}
enable_weekly:
name: 'Enable: Weekly Backups'
description: Create a backup each week and store for a month
default: true
selector:
boolean: {}
enable_monthly:
name: 'Enable: Monthly Backups'
description: Create a backup each month and store for a year
default: true
selector:
boolean: {}
enable_yearly:
name: 'Enable: Yearly Backups'
description: Create a backup each year and store forever
default: true
selector:
boolean: {}
use_action_hourly:
name: Use Backup Action for Hourly Backups Only
description: Otherwise, it will be used for all backup types
default: true
selector:
boolean: {}
backup_action:
name: Backup Action (Optional)
description: 'Optionally override the built-in backup action with a custom action,
designed to allow greater control over what is included in each backup.
By default this only overrides the 3-hourly backups, so that they only include
the configuration.
'
default:
- service: auto_backup.backup
data:
name: '{{ name }}'
password: '{{ password }}'
keep_days: '{{ keep_days }}'
include_folders:
- config
selector:
action: {}
condition:
name: Condition (Optional)
description: Condition to test before any action
default: []
selector:
action: {}
source_url: https://raw.githubusercontent.com/jcwillox/home-assistant-blueprints/main/automation/automatic_backups.yaml
mode: single
variables:
password: !input backup_password
enable_hourly: !input enable_hourly
enable_daily: !input enable_daily
enable_weekly: !input enable_weekly
enable_monthly: !input enable_monthly
enable_yearly: !input enable_yearly
use_action_hourly: !input use_action_hourly
trigger:
- id: daily
platform: time
at: !input backup_time
- id: hourly
enabled: !input enable_hourly
platform: time_pattern
hours: /3
condition: !input condition
action:
- if:
condition: trigger
id: daily
then:
- choose:
- conditions:
- '{{ enable_yearly }}'
- '{{ now().day == 1 and now().month == 1 }}'
sequence:
- variables:
backup_type: yearly
keep_days:
- &id001
variables:
name: !input backup_name
backup_action: !input backup_action
- &id002
if:
- '{{ not use_action_hourly }}'
- '{{ backup_action | length > 0 }}'
then: !input backup_action
else:
- alias: Creating a full backup (default action)
service: auto_backup.backup
data:
name: '{{ name }}'
password: '{{ password }}'
keep_days: '{{ keep_days }}'
- conditions:
- '{{ enable_monthly }}'
- '{{ now().day == 1 }}'
sequence:
- variables:
backup_type: monthly
keep_days: 365
- *id001
- *id002
- conditions:
- '{{ enable_weekly }}'
- '{{ now().weekday() == 0 }}'
sequence:
- variables:
backup_type: weekly
keep_days: 30.4167
- *id001
- *id002
- conditions:
- '{{ enable_daily }}'
sequence:
- variables:
backup_type: daily
keep_days: 7
- *id001
- *id002
else:
- variables:
backup_type: hourly
keep_days: 2
- *id001
- if: '{{ backup_action | length > 0 }}'
then: !input backup_action
else:
- alias: Creating a partial backup (default action)
service: auto_backup.backup
data:
name: '{{ name }}'
password: '{{ password }}'
keep_days: '{{ keep_days }}'
include_folders:
- config
@@ -0,0 +1,143 @@
blueprint:
name: Notify - Auto Backup
description: 'Send notifications based on events created by the [Auto Backup](https://jcwillox.github.io/hass-auto-backup)
integration, such as when a backup fails.
**Note: requires the [Auto Backup](https://jcwillox.github.io/hass-auto-backup)
custom integration.**
'
domain: automation
input:
events:
name: Events
description: Which events to send notifications
default:
- auto_backup.backup_failed
selector:
select:
multiple: true
mode: dropdown
options:
- label: Backup Start
value: auto_backup.backup_start
- label: Backup Successful
value: auto_backup.backup_successful
- label: Backup Failed
value: auto_backup.backup_failed
- label: Backup Purged
value: auto_backup.purged_backups
custom_value: false
sort: false
notify_hass:
name: Send to Home Assistant
description: Send to Home Assistant as a persistent notification
default: false
selector:
boolean: {}
devices:
name: Mobile Devices
description: Send notifications to mobile devices
default: []
selector:
device:
integration: mobile_app
multiple: true
only_after:
name: Only after
description: Only send notifications to mobile devices after this time
default: 00:00:00
selector:
time: {}
only_before:
name: Only before
description: Only send notifications to mobile devices before this time
default: 00:00:00
selector:
time: {}
source_url: https://raw.githubusercontent.com/jcwillox/home-assistant-blueprints/main/automation/notify_auto_backup.yaml
mode: parallel
variables:
notify_hass: !input notify_hass
trigger:
platform: event
event_type: !input events
action:
- choose:
- conditions: '{{ trigger.event.event_type == "auto_backup.backup_start" }}'
sequence:
- variables:
notify_title: Backup Started
notify_message: '{{ trigger.event.data.name }}'
notify_data:
group: Auto Backup
url: /hassio/backups
clickAction: /hassio/backups
tag: auto-backup-{{ trigger.event.data.name }}
notification_icon: mdi:package-variant
- &id001
if: '{{ True }}'
then:
- if:
condition: time
after: !input only_after
before: !input only_before
then:
- alias: Send notifications to mobile devices
repeat:
for_each: !input devices
sequence:
- alias: Notify mobile device
service: notify.mobile_app_{{ device_attr(repeat.item, "name") | slugify
}}
data:
title: '{{ notify_title }}'
message: '{{ notify_message }}'
data: '{{ notify_data }}'
- if: '{{ notify_hass }}'
then:
- alias: Send a notification to HA
service: persistent_notification.create
data:
title: '{{ notify_title }}'
message: '{{ notify_message }}'
- conditions: '{{ trigger.event.event_type == "auto_backup.backup_successful" }}'
sequence:
- variables:
notify_title: Backup Successful
notify_message: '{{ trigger.event.data.name }}'
notify_data:
group: Auto Backup
url: /hassio/backups
clickAction: /hassio/backups
tag: auto-backup-{{ trigger.event.data.name }}
notification_icon: mdi:package-variant-closed
- *id001
- conditions: '{{ trigger.event.event_type == "auto_backup.backup_failed" }}'
sequence:
- variables:
notify_title: Backup Failed
notify_message: '{{ trigger.event.data.name }}
{{ trigger.event.data.error }}
'
notify_data:
group: Auto Backup
url: /hassio/backups
clickAction: /hassio/backups
tag: auto-backup-{{ trigger.event.data.name }}
notification_icon: mdi:package-variant-closed-remove
- *id001
- conditions: '{{ trigger.event.event_type == "auto_backup.purged_backups" }}'
sequence:
- variables:
notify_title: Backup(s) Purged
notify_message: '{{ trigger.event.data.backups | join('', '') }}'
notify_data:
group: Auto Backup
url: /hassio/backups
clickAction: /hassio/backups
notification_icon: mdi:package-variant-closed-minus
- *id001