Skip to content

Instantly share code, notes, and snippets.

@aserper
aserper / smart-mailbox.yaml
Last active February 8, 2025 05:54 — forked from eroak/smart-mailbox.yaml
HomeAssistant blueprint - Smart mailbox
blueprint:
name: 📬 Smart mailbox (Contact Sensor)
description: >
# 📬 Smart mailbox using a contact (opening) sensor
This Blueprint detects mail deposits and collections in your mailbox using a **contact sensor**,
confirmation entities, and optional counters or datetime entities.
## ✨ Key features
- Use a **mail counter** ([Create a counter](https://my.home-assistant.io/redirect/config_flow_start?domain=counter)) to track the number of mails in the mailbox.
blueprint:
name: 📬 Smart mailbox (Contact Sensor)
description: >
# 📬 Smart mailbox using a contact (opening) sensor by @0xAmit
This Blueprint detects mail deposits and collections in your mailbox using a **contact sensor**,
confirmation entities, and optional counters or datetime entities.
## ✨ Key features
- Use a **mail counter** ([Create a counter](https://my.home-assistant.io/redirect/config_flow_start?domain=counter)) to track the number of mails in the mailbox.
blueprint:
name: AI Event Summary (Beta)
author: valentinfrlch
description: >
AI-powered summaries for Frigate events or camera entities.
Sends a notification with a preview to your phone that is updated dynamically when the AI summary is available.
domain: automation
source_url: https://github.com/valentinfrlch/ha-llmvision/blob/main/blueprints/event_summary_beta.yaml
input:
input_mode:
blueprint:
name: AI Event Summary (Beta)
author: valentinfrlch
description: >
AI-powered security event summaries for Frigate events or camera entities.
Sends a notification with a preview to your phone that is updated dynamically when the AI summary is available.
domain: automation
source_url: https://github.com/valentinfrlch/ha-llmvision/blob/main/blueprints/event_summary_beta.yaml
input:
from bcc import BPF
# BPF program that instruments setenv function
prog = """
#include <uapi/linux/ptrace.h>
int trace_setenv(struct pt_regs *ctx) {
// Assuming the first argument to setenv is a pointer to the environment variable name
char env_var_name[256];
bpf_probe_read_user(&env_var_name, sizeof(env_var_name), (void *)PT_REGS_PARM1(ctx));
from bcc import BPF
# eBPF program
prog = """
#include <uapi/linux/ptrace.h>
// Instrument the fchdir syscall entry
TRACEPOINT_PROBE(syscalls, sys_enter_fchdir) {
// args is a built-in structure provided by the tracepoint
// It contains all the arguments of the syscall being traced
from bcc import BPF
# eBPF program
prog = """
#include <uapi/linux/ptrace.h>
// Instrument the chdir syscall entry
TRACEPOINT_PROBE(syscalls, sys_enter_chdir) {
// args is a built-in structure provided by the tracepoint
// It contains all the arguments of the syscall being traced
from bcc import BPF
# Define the eBPF program
prog = """
#include <uapi/linux/ptrace.h>
// Instrument the chmod syscall entry
TRACEPOINT_PROBE(syscalls, sys_enter_chmod) {
// args is a built-in structure provided by the tracepoint
// It contains all the arguments of the syscall being traced
AAAAB3NzaC1yc2EAAAADAQABAAABAQC1Sdr0tIIL8yPhKTLzVMnRKj1zzGqtR4tKpM2bfBEx+AHyvBL8jDZDJ6fuVwEB+aZ8bl/pA5qhFWRRWhONLnLN9RWFx/880msXITwOXjCT3Qa6VpAFPPMazJpbppIg+LTkbOEjdDHvdZ8RhEt7tTXc2DoTDcs73EeepZbJmDFP8TCY7hwgLi0XcG8YHkDFoKFUhvSHPkzAsQd9hyOWaI1taLX2VZHAk8rOaYqaRG3URWH3hZvk8Hcgggm2q/IQQa9VLlX4cSM4SifM/ZNbLYAJhH1x3ZgscliZVmjB55wZWRL5oOZztOKJT2oczUuhDHM1qoUJjnxopqtZ5DrA76WH user@localhost"