🎬 Scripts Documentation
June 30, 2025 · View on GitHub
This document provides comprehensive documentation for all scripts in the Home Assistant configuration, organized by functionality and use case.
📋 Table of Contents
🛏️ Bedtime & Sleep
3 Minuten Bettzeit
Script ID: 3_minuten_bettzeit
Purpose: Comprehensive bedtime routine with intelligent timing and error handling
Sequence:
-
Parallel Shutdown Phase:
- Close bedroom blinds (if open)
- Turn off dashboard screens (with error handling)
- Lock front door (if unlocked)
- Turn off all lights with 3-second transition
- Turn off all outlets (with error handling)
-
Preparation Phase:
- 3-second delay for system stabilization
- Activate air purifier in low mode
- Turn on bed light at 30% with warm color (2700K)
- Start white noise via media player
- Start 3-minute timer
-
Completion Phase:
- Wait for timer completion (4-minute timeout)
- Gradually turn off bed light (10-second transition)
Features:
- Error handling with
continue_on_error - State validation before actions
- Smooth transitions for comfort
- Timeout protection against hanging
Enhancements:
- Uses actual climate entities for air purifier
- Media player integration for white noise
- Intelligent conditional logic
Schlafenszeit
Script ID: schlafenszeit
Purpose: Extended bedtime routine with bathroom preparation
Sequence:
- Voice Announcement: Random personalized message
- Lighting Preparation:
- Flash and dim all 2nd floor lights
- Turn on bathroom lights at 30%
- Security: Lock front door after 5 minutes
- Final Shutdown:
- Turn off bathroom lights
- Close bedroom blinds
- Optimize bedroom environment
- Start white noise
Features:
- Randomized voice messages for variety
- Staged lighting transitions
- Security integration
- Environmental optimization
🧼 Personal Care
Zähneputzen
Script ID: zahneputzen
Purpose: Enhanced teeth brushing routine with audio feedback and lighting
Sequence:
- Start Timer: Activate 2-minute teeth brushing timer
- Voice Feedback: Announce start via bathroom Alexa
- Lighting: Optimize bathroom lighting (100%, 4000K)
- Completion:
- Wait for timer completion (3-minute timeout)
- Congratulatory voice message
- Automatic light adjustment
Features:
- Audio guidance and encouragement
- Optimal lighting for oral care
- Timeout protection
- Positive reinforcement
Enhancements:
- Real-time progress announcements
- Automatic lighting optimization
- Multi-language support ready
Duschen Vorbereiten
Script ID: duschen_vorbereiten
Purpose: Intelligent shower preparation with climate and lighting optimization
Sequence:
- Announcement: Multi-room voice notification of preparation
- Parallel Optimization:
- Set heating to 24°C
- Optimize bathroom lighting (80%, 3500K)
- Activate ventilation system
- Status Tracking: Set preparation and occupancy flags
- Completion:
- 8-minute preparation time
- Temperature validation
- Ready notification with actual temperature
Features:
- Multi-room announcements
- Parallel task execution for speed
- Temperature monitoring and feedback
- Environmental optimization
Enhancements:
- Real climate entity integration
- Actual temperature feedback
- Improved ventilation management
📰 Information & Briefing
Briefing
Script ID: briefing
Purpose: Comprehensive morning briefing with weather, news, calendar, and home status
Data Sources:
- Weather: Indoor/outdoor temperatures, conditions, forecast
- Home Status: Door lock, presence, power consumption
- Calendar: Today's appointments and events
- News: Current headlines from reliable sources
AI Processing:
- Uses ChatGPT conversation agent
- German language processing
- Personalized summary format
- 15-sentence limit for conciseness
Output:
- Voice delivery via Alexa Show
- MQTT storage for history tracking
- Structured data for analysis
Features:
- Real-time data integration
- Intelligent summarization
- Multi-source information
- Historical tracking
Enhancements:
- Expanded home automation status
- Better weather integration
- Calendar event filtering
- News source diversification
🎛️ Device Control
AWTRIX Control Scripts
Purpose: Manage AWTRIX LED matrix displays
Scripts:
awtrix_speedtest: Display internet speed test resultsawtrix_doorbell: Show doorbell notificationsawtrix_restart: Reboot all AWTRIX devicesawtrix_dismiss_notification: Clear all notificationsawtrix_placeholder: Show ambient effects
Features:
- Dual-display support (Wohnzimmer + Büro)
- Parallel execution for sync
- Rich notification content
- Visual feedback integration
Deckenventilator Control
Purpose: Comprehensive ceiling fan control
Scripts Available:
deckenventilator_power: Toggle fan powerdeckenventilator_level_1throughdeckenventilator_level_6: Speed controldeckenventilator_breeze: Natural breeze modedeckenventilator_timer_1hthroughdeckenventilator_timer_8h: Auto-off timers
Features:
- IR remote control integration
- Multiple speed settings
- Timer functionality
- Natural breeze simulation
ESPHome Management
Script ID: esphome_update_all_devices
Purpose: Automated ESPHome device updates
Sequence:
- Discovery: Find all ESPHome devices with pending updates
- Sequential Updates: Update each device individually
- Verification: Wait for update completion
- Delay: 3-minute intervals between updates
Features:
- Automatic device discovery
- Safe sequential updating
- Update verification
- System stability protection
🎵 Entertainment
Apple TV Scripts
Purpose: Quick access to favorite shows
Scripts:
appletv_family_guy: Launch Family Guy on Disney+appletv_american_dad: Launch American Dad on Disney+appletv_simpsons: Launch Simpsons on Disney+
Features:
- Direct URL launching
- Platform integration
- Quick access automation
Power Management
Script ID: power_wohnzimmer
Purpose: Apple TV power control with Sonos integration
Features:
- Remote command sequences
- Media player coordination
- State synchronization
🔧 Utility Scripts
Store MQTT Sensor
Script ID: store_mqtt_sensor
Purpose: Dynamic MQTT sensor creation for data storage
Parameters:
name: Sensor identifierstate: Current valueattributes: Additional metadata
Features:
- Dynamic sensor creation
- MQTT persistence
- Attribute support
- Data retention
Use Cases:
- Historical data tracking
- Custom sensor creation
- Integration bridging
- Analytics support
Run Chores
Script ID: run_chores
Purpose: Execute maintenance shell commands
Features:
- System maintenance automation
- Shell command integration
- Scheduled execution support
Alexa Integration Scripts
Alexa Room-Aware Temperature
Script ID: alexa_room_aware_temperature_2
Purpose: Context-aware temperature reporting
Features:
- Room-specific temperature sensors
- Multi-room mapping
- Intelligent fallback to average
- Natural language responses
Room Mapping:
- Büro:
sensor.aqara_thermo_kinderzimmer_temperature - Flur:
sensor.aqara_thermo_flur_temperature - Badezimmer:
sensor.aqara_thermo_badezimmer_temperature - Schlafzimmer:
sensor.aqara_thermo_schlafzimmer_temperature - Wohnzimmer:
sensor.aqara_thermo_wohnzimmer_temperature
Activate Alexa Actionable Notification
Script ID: activate_alexa_actionable_notification
Purpose: Create interactive Alexa notifications
Parameters:
text: Notification messageevent_id: Response correlation IDalexa_device: Target devicesuppress_confirmation: Optional confirmation suppression
Features:
- Interactive notifications
- Event correlation
- Device targeting
- Response handling
🏠 Water Management
Log Water
Script ID: log_water
Purpose: Track daily water intake
Features:
- Cumulative tracking
- Daily reset capability
- Health monitoring integration
- Simple parameter input
Wassertank Aufgefüllt
Script ID: wassertank_aufgefullt_2
Purpose: Track water tank refill dates
Features:
- Date stamp recording
- Maintenance tracking
- Schedule optimization
⚙️ Script Best Practices
Design Principles:
- Error Resilience: Use
continue_on_errorfor non-critical steps - State Validation: Check entity states before actions
- Timeout Protection: Prevent infinite waiting
- User Feedback: Provide voice/visual confirmation
- Resource Efficiency: Parallel execution where appropriate
Performance Optimization:
- Parallel Tasks: Execute independent actions simultaneously
- Conditional Logic: Skip unnecessary steps
- Timeout Management: Prevent hanging scripts
- State Caching: Minimize entity state queries
Debugging Features:
- Detailed Logging: Comprehensive execution traces
- Mode Checking: Respect maintenance and testing modes
- Error Handling: Graceful failure management
- Status Reporting: Progress and completion feedback
🔧 Maintenance & Updates
Regular Maintenance:
- Review Timeouts: Ensure appropriate timeout values
- Update Entity References: Verify entity availability
- Test Error Paths: Validate error handling
- Performance Monitoring: Check execution times
Update Procedures:
- Backup Scripts: Before major changes
- Test in Staging: Validate functionality
- Gradual Rollout: Deploy incrementally
- Monitor Performance: Watch for regressions
Note: All scripts are designed for reliability and user experience. They include comprehensive error handling, appropriate timeouts, and user feedback mechanisms. Regular testing and maintenance ensure optimal performance and reliability.