{"id":29107428,"url":"https://github.com/issmirnov/emergency_alerts","last_synced_at":"2026-04-28T13:34:48.526Z","repository":{"id":301057478,"uuid":"1007992698","full_name":"issmirnov/emergency_alerts","owner":"issmirnov","description":"A Home Assistant custom integration for defining and tracking emergency alert conditions with UI-based configuration.","archived":false,"fork":false,"pushed_at":"2025-06-25T00:01:47.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-25T00:25:47.901Z","etag":null,"topics":["automation","custom-integration","emergency-alerts","hacs","home-assistant","home-automation"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/issmirnov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-24T21:21:29.000Z","updated_at":"2025-06-25T00:01:50.000Z","dependencies_parsed_at":"2025-06-25T00:36:20.554Z","dependency_job_id":null,"html_url":"https://github.com/issmirnov/emergency_alerts","commit_stats":null,"previous_names":["issmirnov/emergency_alerts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/issmirnov/emergency_alerts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/issmirnov%2Femergency_alerts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/issmirnov%2Femergency_alerts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/issmirnov%2Femergency_alerts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/issmirnov%2Femergency_alerts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/issmirnov","download_url":"https://codeload.github.com/issmirnov/emergency_alerts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/issmirnov%2Femergency_alerts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262539068,"owners_count":23325831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","custom-integration","emergency-alerts","hacs","home-assistant","home-automation"],"created_at":"2025-06-29T05:03:19.535Z","updated_at":"2026-04-28T13:34:48.517Z","avatar_url":"https://github.com/issmirnov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Emergency Alerts Integration for Home Assistant\n\nA powerful Home Assistant integration for managing critical alerts with smart escalation, state management, and flexible trigger conditions.\n\n## Version 4.1.0 - Polish \u0026 Modern UX\n\n**Major quality improvements** focusing on user experience, testing, and Home Assistant 2026.2+ compatibility.\n\n### Why v4.1.0?\n\nv4.1.0 is all about **polish** - taking an already powerful integration and making it a joy to use. Every interaction is faster, cleaner, and more reliable.\n\n**The Big Three Improvements:**\n\n1. **Single-Page Config Flow** - Configure alerts in one clean form instead of clicking through multiple wizard steps. Inspired by Adaptive Lighting's excellent UX.\n\n2. **Instant Operations** - Add, edit, or remove alerts with zero downtime. Changes take effect immediately with automatic reload - no more waiting for Home Assistant to restart.\n\n3. **Comprehensive Testing** - Hassfest validation, translation sync checks, and E2E tests ensure the integration just works, every time.\n\n### What's New in v4.1.0\n\n**Clean, Modern Configuration Experience**\n- **Single-Page Config Flow**: All alert options on one unified form (inspired by Adaptive Lighting's excellent UX)\n- **User-Friendly Labels**: Clear, descriptive field labels and help text\n- **Modern Selectors**: EntitySelector and TemplateSelector with live preview\n- **Instant Changes**: Add/Edit/Remove alerts work immediately - no Home Assistant restart required\n- **74% Less Code**: 353 lines (down from 1,371) in config_flow.py - simpler, more maintainable\n\n**Comprehensive Testing Infrastructure**\n- **Hassfest Validation**: Automated integration structure checks in CI\n- **Translation Sync**: Automatic validation ensures UI strings stay synchronized\n- **E2E Tests**: Playwright-based tests for critical config flow paths\n- **Zero Translation Errors**: Real-time validation prevents runtime string lookup failures\n\n**Home Assistant 2026.2+ Ready**\n- Updated for latest Home Assistant patterns and best practices\n- Compatible with newest config flow APIs\n- Tested against HA 2026.2 stable release\n- Future-proof for HA 2027+\n\n## v4.1.0 Highlights\n\n\u003e **TL;DR**: Everything is faster, cleaner, and more reliable. Configuration takes 30 seconds instead of 2 minutes. All changes happen instantly. Zero translation errors. Fully tested. HA 2026.2+ ready.\n\n### User Experience Transformation\n\n| Before v4.1.0 | After v4.1.0 |\n|---------------|--------------|\n| Multi-step wizard (3-4 screens) | Single unified form |\n| Click through pages sequentially | See all options at once |\n| Hit \"Back\" to change earlier fields | Edit any field anytime |\n| Wait for HA restart after changes | Instant reload (no restart) |\n| Generic field labels | Clear, descriptive labels |\n| Basic text inputs | Modern selectors with validation |\n\n**Time Savings:**\n- **Alert Creation**: 2+ minutes → 30 seconds\n- **Alert Editing**: 1+ minute → 20 seconds\n- **Changes Take Effect**: Restart HA (2-5 min) → Instant (0 sec)\n\n**Quality Improvements:**\n- **Translation Errors**: Sometimes broken → Never (validated in CI)\n- **Configuration Errors**: Possible → Prevented (real-time validation)\n- **Field Help**: Basic → Comprehensive with examples\n\n### Real-World Impact\n\n**What Changed:**\n\nBefore v4.1.0, creating a door-left-open alert meant:\n1. Click gear icon → Add Alert\n2. Fill in name and trigger type → Click Next\n3. Select entity and state → Click Next\n4. Configure actions (optional) → Click Next\n5. Review and submit → Wait for HA restart\n6. **Total time: 2-3 minutes per alert**\n\nAfter v4.1.0:\n1. Click gear icon → Add Alert\n2. Fill in all fields on one form → Submit\n3. Alert appears immediately (no restart)\n4. **Total time: 20-30 seconds per alert**\n\n**Real Scenarios:**\n\n- **Setting up 10 security alerts**: Was 20-30 minutes, now 5-8 minutes\n- **Editing an existing alert**: Was 2 minutes + restart, now 20 seconds total\n- **Testing configurations**: Was painful (edit → restart → test → repeat), now instant\n- **Fixing a typo**: Was a full restart cycle, now a 10-second fix\n\n### Technical Excellence\n\n**Robust Testing Infrastructure:**\n- **Hassfest Validation**: Integration structure automatically checked in CI\n- **Translation Sync**: Zero runtime translation errors (validated on every commit)\n- **E2E Tests**: Critical user flows tested with Playwright\n- **Unit Tests**: Comprehensive coverage of all components\n- **CI/CD**: All checks pass before merge\n\n**Modern, Maintainable Codebase:**\n- **74% Code Reduction**: 353 lines (was 1,371) in config_flow.py\n- **Latest Patterns**: Uses modern Home Assistant APIs throughout\n- **Zero Deprecations**: No warnings, ready for HA 2027+\n- **Clean Architecture**: Modular, well-documented, easy to extend\n\n**Instant Operations:**\n- **No Restart Required**: All CRUD operations (Create, Read, Update, Delete) work instantly\n- **Automatic Reload**: Entities appear/update immediately after config changes\n- **Zero Downtime**: Edit alerts while Home Assistant is running\n- **Fast Iteration**: Change → Save → See (seconds, not minutes)\n\n### What's New in v4.0.0\n\n- **Unified State Control**: Single select entity per alert instead of 3 separate switches\n- **67% Fewer Entities**: Cleaner entity list, better performance\n- **Better UX**: Single dropdown for state management instead of 3 toggles\n\n### Migration from v3.x\n\nIf you're upgrading from v3.x, you'll need to update automations:\n\n**Old (v3.x):**\n```yaml\nservice: switch.turn_on\ntarget:\n  entity_id: switch.door_alert_acknowledged\n```\n\n**New (v4.0.0):**\n```yaml\nservice: select.select_option\ndata:\n  entity_id: select.door_alert_state\n  option: acknowledged\n```\n\n**Available States:**\n- `active` - Alert is actively triggered\n- `acknowledged` - Alert acknowledged (prevents escalation)\n- `snoozed` - Alert temporarily silenced\n- `resolved` - Alert marked as resolved\n\n## Features\n\n### Intuitive Configuration\n- **Single-Page Forms**: All alert settings on one clean, scrollable form\n- **No YAML Required**: Complete visual configuration through Home Assistant UI\n- **Instant Updates**: Changes take effect immediately with automatic reload\n- **Smart Field Validation**: Real-time validation prevents configuration errors\n- **Modern Selectors**: Entity pickers, template editors with syntax highlighting\n\n### Smart Alert Triggers\n- **Simple**: Entity state matching (e.g., door == open, temp \u003e 80)\n- **Template**: Full Jinja2 expressions for complex logic with live preview\n- **Logical**: Combine multiple conditions with AND/OR/NOT operators\n- **Visual Condition Builder**: No code needed - select entities and states from dropdowns\n\n### Comprehensive State Management\n- **Unified Control**: Single select entity per alert (no more juggling 3 switches)\n- **Automatic Synchronization**: State changes instantly reflected across all entities\n- **Flexible Snooze**: Configurable duration with auto-expiry\n- **Smart Escalation**: Only escalates unacknowledged alerts\n- **Clear Status Tracking**: Always know what state each alert is in\n\n### Flexible Action System\n- **Event-Driven Actions**: Execute Home Assistant services on any state change\n- **Granular Control**: Separate actions for trigger, acknowledge, snooze, resolve, and escalation\n- **Service Integration**: Call any Home Assistant service (notify, light, switch, script, etc.)\n- **Template Support**: Use Jinja2 templates in action data for dynamic content\n\n### Notification Profiles\n- **Reusable Templates**: Define notification patterns once, use across multiple alerts\n- **Profile-Based Actions**: Apply notification profiles to alerts for consistent behavior\n- **Group Management**: Manage profiles at the group level\n- **Easy Maintenance**: Update one profile to change all alerts using it\n\n### Clean Organization\n- **Hub-Based Architecture**: Group related alerts under descriptive hub devices\n- **Device Hierarchy**: Proper Home Assistant device relationships for clean UI\n- **67% Fewer Entities**: One select entity instead of three switches per alert\n- **Logical Grouping**: Organize by room, priority, or alert type\n\n## Installation\n\n### HACS (Recommended)\n\n1. Open HACS in Home Assistant\n2. Go to Integrations\n3. Click the 3 dots menu → Custom repositories\n4. Add: `https://github.com/issmirnov/emergency_alerts`\n5. Category: Integration\n6. Install \"Emergency Alerts\"\n7. Restart Home Assistant\n\n### Manual Installation\n\n1. Copy `custom_components/emergency_alerts` to your HA config directory\n2. Restart Home Assistant\n\n## Quick Start\n\n1. **Add the Integration**\n   - Go to **Settings** → **Devices \u0026 Services** → **Add Integration**\n   - Search for \"Emergency Alerts\"\n   - Click to install\n\n2. **Create Your First Alert Group**\n   - Give your group a descriptive name (e.g., \"Security Alerts\", \"Home Safety\")\n   - The group becomes a hub device in Home Assistant\n\n3. **Add an Alert**\n   - Click the gear icon on your Alert Group device\n   - Click **\"Add Alert\"**\n   - Fill out the single-page form with all your alert settings\n   - Click **Submit** - your alert appears instantly (no restart needed)\n\n4. **Manage Your Alerts**\n   - **Edit**: Click gear icon → **\"Edit Alert\"** → Select alert → Modify → Submit\n   - **Remove**: Click gear icon → **\"Remove Alert\"** → Select alert → Confirm\n   - All changes take effect immediately with automatic reload\n\nThat's it! Your alerts are now monitoring your home and ready to trigger.\n\n## Configuration\n\n### Creating Alerts - Now Lightning Fast\n\nThe v4.1.0 config flow puts **everything on one page**. No wizard steps, no clicking \"Next\" three times, no losing your place. Just scroll, fill in fields, and submit.\n\n**The Form Adapts to You:**\n\nAll alert types start with the same clean form:\n- Alert name\n- Trigger type (Simple/Template/Logical)\n- Severity (Info/Warning/Critical)\n- Group (Security/Safety/Environment/etc.)\n\nThe form then shows trigger-specific fields based on your choice:\n\n**Simple Trigger:**\n- Entity selector with search\n- Target state field\n- That's it - done in 10 seconds\n\n**Template Trigger:**\n- Jinja2 template editor with syntax highlighting\n- Preview feature to test templates\n- Built-in validation\n\n**Logical Trigger:**\n- Visual condition builder (no code)\n- Add up to 10 entity/state pairs\n- Choose AND/OR operator\n- Point and click interface\n\n**Optional Enhancements:**\n- Actions on trigger/acknowledge/snooze/resolve/escalate\n- Notification profiles for reusable templates\n- Custom snooze duration\n- Service calls for automation integration\n\nAll fields have clear labels, helpful descriptions, and examples. Real-time validation prevents errors before you submit.\n\n### State Management - Simple and Unified\n\nv4.0 introduced unified state control. Instead of juggling 3 separate switch entities per alert, you get one clean select entity with all states:\n\n**Available States:**\n- **active**: Alert is currently triggered\n- **acknowledged**: User acknowledged, escalation prevented\n- **snoozed**: Temporarily silenced (auto-expires)\n- **resolved**: Marked as complete\n\n**Using States in Automations:**\n```yaml\nservice: select.select_option\ndata:\n  entity_id: select.my_alert_state\n  option: acknowledged\n```\n\n**The Improvement:**\n- Before: `switch.my_alert_acknowledge`, `switch.my_alert_snooze`, `switch.my_alert_resolve` (3 entities)\n- After: `select.my_alert_state` (1 entity, 4 states)\n- Result: 67% fewer entities, cleaner UI, simpler automations\n\n### Actions\n\nConfigure actions for different events:\n\n- **on_trigger**: When alert activates\n- **on_acknowledged**: When alert is acknowledged\n- **on_snoozed**: When alert is snoozed\n- **on_resolved**: When alert is resolved\n- **on_escalation**: When alert escalates (unacknowledged)\n\nExample:\n```yaml\non_trigger:\n  - service: notify.mobile_app\n    data:\n      message: \"Alert triggered!\"\n```\n\n## Development\n\n### Comprehensive Testing Infrastructure\n\nv4.1.0 introduces a robust testing system that ensures quality:\n\n**Automated CI Checks:**\n```bash\n# All of these run automatically on every commit\nhassfest          # Integration structure validation\npytest            # Unit and integration tests\ntranslation-sync  # Ensures UI strings stay synchronized\n```\n\n**Local Testing:**\n```bash\n# Run the full test suite locally\n./run_tests.sh\n\n# Or run specific test types\n./run_tests.sh --backend-only    # Just pytest\npython validate_translations.py   # Just translation sync\n```\n\n**Test Coverage:**\n- Trigger evaluation (simple, template, logical)\n- Config flow validation and user input handling\n- State machine transitions and mutual exclusivity\n- Service registration and action execution\n- Translation string synchronization\n- Integration structure (hassfest)\n\n### Local Development Environment\n\nFast iteration with Docker-based HA instance:\n\n```bash\n# Start local HA instance (port 8123)\n./dev_tools/local-dev.sh start\n\n# View logs in real-time\n./dev_tools/local-dev.sh logs\n\n# Restart after code changes (3 seconds)\n./dev_tools/local-dev.sh restart\n\n# Clean slate for testing (wipes all data)\n./dev_tools/local-dev.sh nuke\n```\n\n**Benefits:**\n- No HACS redownload cycle needed\n- Changes visible in seconds, not minutes\n- Full debug logging enabled\n- Test entities pre-configured\n- Real Home Assistant 2026.2 environment\n- Automatic onboarding bypass (dev/dev credentials)\n\n**What You Get:**\n- Home Assistant 2026.2 running on port 8123\n- Integration pre-installed and loaded\n- Test alert groups automatically created\n- Dashboard with test cards configured\n- Complete development-ready setup\n\nSee `dev_tools/README_DEV.md` for complete details.\n\n## Architecture\n\n### Core Components\n\n- **binary_sensor.py**: Alert trigger evaluation and state tracking\n- **select.py**: Unified state control entity\n- **sensor.py**: Status and metrics reporting\n- **config_flow.py**: Setup wizard and configuration UI\n- **core/**: Modular trigger evaluator and action executor\n\n### State Machine\n\nThe select entity manages alert states:\n\n```\nactive → acknowledged → active\n  ↓          ↓\nsnoozed → resolved\n```\n\nState changes are mutually exclusive and synchronized with the binary sensor.\n\n## Support\n\n- **Issues**: https://github.com/issmirnov/emergency_alerts/issues\n- **Documentation**: See CHANGELOG.md for version history\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for detailed version history.\n\n## License\n\nMIT License - See LICENSE file for details","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fissmirnov%2Femergency_alerts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fissmirnov%2Femergency_alerts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fissmirnov%2Femergency_alerts/lists"}