OSAM - Open Sensor Alert Manager - Advanced Contact Sensor Monitoring

OSAM - Open Sensor Alert Manager - Advanced Contact Sensor Monitoring

OSAM transforms your basic contact sensors into intelligent monitoring systems with powerful notification features. It handles everything from simple window-open reminders to complex security monitoring with escalations, temperature checks, and multi-language support. Whether you need energy-saving alerts or critical security warnings that override quiet hours, OSAM adapts to your needs without requiring any coding skills.

:pushpin: TL;DR - Quick Overview

OSAM is a powerful blueprint for monitoring doors and windows with smart notifications, escalation warnings, and extensive customization.

Key Features:

  • :bell: Smart repeat notifications with customizable intervals
  • :rotating_light: Escalation system for critical alerts (after X notifications)
  • :crescent_moon: Quiet time with separate workday/weekend schedules (optional)
  • :pause_button: Counter-based snooze function
  • :thermometer: Temperature-based alerts (only notify when cold)
  • :earth_africa: Multi-language support (DE/EN/FR/IT) - use <opened_duration_en> in templates
  • :bar_chart: Daily notification limits
  • :dart: Custom actions on first/repeat/escalation/resolved
  • :floppy_disk: JSON storage for unlimited sensors

Perfect for: Energy saving alerts, security monitoring, door left open reminders, freezer door warnings.

Setup time: 5-10 minutes (create 2 helper entities, import blueprint, configure automation)


:star2: Introduction

OSAM (Open Sensor Alert Manager) is a comprehensive blueprint for monitoring contact sensors (doors/windows) with advanced features like escalation management, quiet time, temperature checks, and much more.

I created this blueprint because I was tired of getting spammed by door/window notifications or missing critical alerts. OSAM gives you complete control over when, how, and how often you get notified.

:package: Installation

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Or manually:

https://github.com/thezeus123/OSAM/

:sparkles: Key Features

:bell: Smart Notification System

  • Flexible repeat intervals - Set how often to remind you
  • Multi-language support - Duration in German, English, French, Italian
  • Custom notification scripts - Use your own notification system
  • Message templates - Fully customizable with variables

:rotating_light: Escalation Management

  • Critical warnings after X notifications
  • Separate devices for escalations (e.g., SMS for critical alerts)
  • Override quiet time for emergencies
  • Higher volume for Alexa escalations
  • Ignores daily limits but still tracks count

:crescent_moon: Quiet Time (Optional)

  • Separate schedules for workdays and weekends
  • Workday sensor integration for automatic detection
  • Completely optional - Disable for 24/7 monitoring
  • Reminder notification when quiet time ends

:pause_button: Snooze Function

  • Counter-based - Suppress X notifications instead of time-based
  • Automatic disable when counter reaches zero
  • Per-automation control with helper boolean

:thermometer: Temperature Integration

  • Conditional notifications - Only notify when cold outside
  • Configurable threshold - Set your own temperature limit
  • Perfect for “window open when it’s freezing” alerts

:bar_chart: Daily Limits

  • Cap notifications to prevent spam
  • Automatic reset at midnight
  • Escalations ignore limits (but count towards total)

:dart: Custom Actions

Execute automations at key points:

  • First notification sent
  • Repeat notification sent
  • Escalation triggered
  • Issue resolved

:floppy_disk: JSON Storage

  • Unlimited sensors with single input_text entity
  • Persistent data across restarts
  • Tracks: counter, first_opened, escalation_sent, snooze status

:dart: Real-World Examples

Example 1: Front Door Security

Detection Grace Period: 2 minutes
Repeat Interval: 10 minutes
Escalation: After 6 notifications
Escalation Override Quiet Time: Yes

Why: Critical security, escalate if ignored, alert even at night

Example 2: Bedroom Window (Energy Saving)

Detection Grace Period: 10 minutes
Enable Temperature Check: Yes
Temperature Threshold: 10°C
Quiet Time: 22:00 - 07:00

Why: Only care when it’s cold, don’t bug me at night

Example 3: Garage Door

Detection Grace Period: 30 minutes
Daily Limit: 5 notifications
Repeat Interval: 60 minutes

Why: Sometimes intentionally left open, don’t spam

Example 4: Freezer Door

Detection Grace Period: 1 minute
Escalation: After 3 notifications
Escalation Volume: 100%
Custom Action (Escalation): Flash kitchen lights

Why: Critical! Food spoiling risk, immediate action needed

:wrench: Setup Requirements

Required Helpers (per automation)

1. Input Boolean (for repeat logic)

Settings → Devices & Services → Helpers → Create Helper → Toggle
Name: osam_front_door_helper

2. Input Text (for JSON storage)

Settings → Devices & Services → Helpers → Create Helper → Text
Name: osam_front_door_json
Maximum length: 255 (default is fine!)

Important: Create one JSON storage per sensor (recommended). The default 255 character limit via GUI is sufficient. Only use shared storage (10000+ chars) if you have many sensors and want to manage them in one entity.

Optional Helpers

3. Input Boolean (for snooze)

Name: osam_front_door_snooze

:open_book: Configuration Guide

Available Variables in Templates

Use these variables in your notification titles and messages:

Variable Description Example Output
<friendly_name> Sensor display name “Front Door”
<opened_duration> Time open (German) “2 Stunden und 15 Minuten”
<counter> Notification count “8”
<counter_ordinal> Ordinal (German) “achte”

:earth_africa: Multi-Language: Use Language-Specific Variables!

Want English notifications? Just use <opened_duration_en> instead of <opened_duration>!

Duration Variable Language Example
<opened_duration_de> German “2 Stunden und 15 Minuten”
<opened_duration_en> English “2 hours and 15 minutes”
<opened_duration_fr> French “2 heures et 15 minutes”
<opened_duration_it> Italian “2 ore e 15 minuti”
Ordinal Variable Language Example (8th)
<counter_ordinal_de> German “achte”
<counter_ordinal_en> English “eighth”
<counter_ordinal_fr> French “huitième”
<counter_ordinal_it> Italian “ottava”

Example - English notifications:

notification_title: "WARNING: <friendly_name> is open!"

notification_msg_first: |
  <friendly_name> has been open for <opened_duration_en>!
  Please check if this is intentional.

notification_msg_repeat: |
  REMINDER: <friendly_name> is still open!
  Duration: <opened_duration_en>
  This is the <counter_ordinal_en> reminder.

What you’ll see:

WARNING: Front Door is open!
Front Door has been open for 2 hours and 15 minutes!
Please check if this is intentional.

REMINDER: Front Door is still open!
Duration: 2 hours and 15 minutes
This is the eighth reminder.

No blueprint editing needed! Just use the language variable you want in your templates.

:open_book: Full guide: LOCALIZATION.md

Example message template:

WARNING: <friendly_name> has been open!

Duration: <opened_duration>
This is notification #<counter> (the <counter_ordinal>)

Output:

WARNING: Front Door has been open!

Duration: 2 hours and 15 minutes
This is notification #8 (the eighth)

:bug: Troubleshooting

No notifications received?

  1. Enable Debug Mode in blueprint
  2. Check Settings → System → Logs
  3. Filter by osam.your_sensor_name
  4. Look for: quiet time status, temperature check, daily limit

JSON Storage errors?

  • Using one storage per sensor? Default 255 chars is enough!
  • Using shared storage? Increase to 10000+ in configuration.yaml
  • Check entity exists: input_text.osam_[sensor]_json
  • View state to see stored JSON data
  • Best practice: One storage per sensor (simpler!)

Escalations not working?

  • Check Escalation After Count is reached
  • Verify Enable Escalation is checked
  • If using Override Quiet Time, check it’s enabled
  • Look for ESCALATION triggered in logs (Debug Mode)

:memo: Version History

v3.12.1 (Current) - 2025-10-24

  • :bug: Fixed double notifications (escalation + regular)
  • :bug: Fixed YAML parsing errors from emoji characters
  • :sparkles: Escalations now ignore daily limits properly

v3.12.0 - 2025-10-24

  • :sparkles: Optional escalation repeat

v3.11.0 - 2025-10-20

  • :sparkles: Optional quiet time (24/7 mode)
  • :sparkles: Count-based escalation
  • :sparkles: Escalation override quiet time
  • :sparkles: Separate escalation volume

Full Changelog

:handshake: Contributing

Found a bug? Have an idea?

:electric_plug: Notification System

OSAM supports flexible notification delivery:

Built-in (Default)

Uses Home Assistant’s persistent_notification - no setup needed!

Custom Scripts (Optional)

Create your own notification script to:

  • :white_check_mark: Route to multiple devices (mobile, Alexa, Telegram)
  • :white_check_mark: Add rich notifications with action buttons
  • :white_check_mark: Customize based on time/priority
  • :white_check_mark: Integrate with third-party services

Example:

notification_script: "script.zentrale_benachrichtigung"
notification_delete_script: "script.benachrichtigung_loschen"

Your script receives: title, message, devices, priority, volume, tag

:open_book: Full guide: NOTIFICATION_SCRIPTS.md


:star: Show Your Support

If you find OSAM useful:

  • Give it a :star: on GitHub
  • Share with the community
  • Submit feature requests

:link: Links


OSAM = Open Sensor Alert Manager

Questions? Ask away! :point_down:

Your AI didn’t get the link right… Please double check EVERYTHING before re-pasting this stuff in here so us users are not affected…