Skip to content

Latest commit

 

History

History
163 lines (127 loc) · 6.43 KB

File metadata and controls

163 lines (127 loc) · 6.43 KB

Fun App

Overview

Provides entertainment and special occasion automations including New Year celebrations, holiday effects, and parent visit notifications.

Purpose

The Fun App brings joy and entertainment to the home automation system by providing special occasion automations, celebratory effects, and personalized experiences for family events and holidays.

Key Features

New Year Automation

  • Music Playback: Automatic "Happy New Year" music at midnight
  • Light Show: Synchronized lighting effects for celebrations
  • Firework Simulation: LED light effects simulating fireworks
  • Timing Control: Precise timing for New Year's Eve celebrations

Parent Visit Detection

  • Arrival Detection: Detects when parents arrive at the house
  • Welcome Messages: Personalized greetings for family members
  • House Preparation: Adjusts house settings for guests
  • Special Ambiance: Creates welcoming atmosphere for visitors

Holiday Celebrations

  • Seasonal Effects: Automated effects for different holidays
  • Birthday Celebrations: Special effects for birthdays
  • Anniversary Reminders: Automated anniversary acknowledgments
  • Custom Events: User-defined special occasions

Technical Implementation

Christmas Firework Effect

private async Task ChristmasFirework()
{
    var colors = new[] { "RED", "GREEN", "BLUE", "WHITE" };
    var stopwatch = Stopwatch.StartNew();
    
    do
    {
        var randomColor = colors[Random.Next(colors.Length)];
        Entities.Light.Tv.TurnOn(colorName: randomColor);
        await Task.Delay(_config.Timing.ShortDelay);
    } 
    while (stopwatch.Elapsed < TimeSpan.FromMinutes(4));
}

Music Integration

  • Playlist Management: Automated playlist selection for events
  • Volume Control: Intelligent volume adjustment based on time
  • Speaker Coordination: Multi-room audio coordination
  • Timing Synchronization: Precise timing for musical effects

Special Effects

Lighting Effects

  • Color Cycling: Dynamic color changes for celebrations
  • Brightness Modulation: Pulsing and fading effects
  • Pattern Creation: Complex lighting patterns and sequences
  • Zone Coordination: Multi-room lighting coordination

Audio Effects

  • Sound Effects: Celebratory sounds and audio cues
  • Voice Announcements: Automated voice messages
  • Music Synchronization: Lighting synchronized to music
  • Ambient Sounds: Background audio for atmosphere

Event Detection

Arrival Detection

  • Presence Sensors: Motion and door sensors for arrival detection
  • Device Recognition: Phone/device-based arrival identification
  • Time-based Logic: Different behavior based on arrival time
  • Context Awareness: Adapts behavior based on current house state

Calendar Integration

  • Holiday Calendar: Automatic holiday detection and celebration
  • Personal Events: Birthday and anniversary tracking
  • Custom Events: User-defined special occasions
  • Reminder System: Advance notifications for upcoming events

Configuration

Timing Settings

public class TimingConfiguration
{
    public TimeSpan NewYearMusicDelay { get; set; } = TimeSpan.FromSeconds(49);
    public TimeSpan ShortDelay { get; set; } = TimeSpan.FromSeconds(0.5);
    public TimeSpan EffectDuration { get; set; } = TimeSpan.FromMinutes(4);
}

Effect Customization

  • Color Palettes: Customizable color schemes for different events
  • Effect Intensity: Adjustable intensity levels for effects
  • Duration Control: Configurable duration for all effects
  • Trigger Conditions: Customizable conditions for effect activation

Automation Scenarios

New Year's Eve

  1. Countdown Phase: Building excitement with increasing effects
  2. Midnight Moment: Spectacular synchronized celebration
  3. Celebration Period: Extended celebration effects
  4. Wind Down: Gradual return to normal lighting

Family Visits

  1. Arrival Detection: Automatic detection of family member arrival
  2. Welcome Sequence: Personalized welcome with appropriate lighting
  3. Comfort Settings: House adjustment for guest comfort
  4. Departure Handling: Return to normal settings after departure

Birthday Celebrations

  1. Morning Surprise: Special wake-up sequence on birthdays
  2. Day-long Effects: Subtle celebratory effects throughout the day
  3. Evening Celebration: Enhanced effects for birthday evening
  4. Cake Moment: Special effects for cake cutting/celebration

Integration Points

  • House State Manager: Coordinates with overall house states
  • Music System: Integration with audio systems and streaming services
  • Lighting Apps: Coordination with room-specific lighting apps
  • Calendar Services: Integration with calendar systems for event detection
  • Notification System: Announcements and notifications for effects

Safety Considerations

  • Intensity Limits: Maximum intensity limits to prevent overwhelming effects
  • Time Restrictions: Automatic effects limited to appropriate hours
  • Manual Override: Easy manual control to stop or modify effects
  • Guest Mode: Reduced effects when guests are present

Customization Options

Personal Preferences

  • Favorite Colors: Personal color preferences for effects
  • Music Preferences: Preferred music styles and genres
  • Effect Styles: Subtle vs dramatic effect preferences
  • Timing Preferences: Preferred timing for different effects

Family Settings

  • Multi-person Support: Different preferences for different family members
  • Guest Modes: Appropriate settings when guests are present
  • Child Safety: Safe and appropriate effects for children
  • Accessibility: Considerations for accessibility needs

Error Handling

  • Device Failures: Graceful handling of failed lighting or audio devices
  • Network Issues: Offline capabilities for basic effects
  • Resource Conflicts: Coordination with other automation apps
  • Recovery Modes: Automatic recovery from effect failures

Future Enhancements

  • Machine Learning: Learning user preferences over time
  • Advanced Synchronization: More complex audio-visual synchronization
  • External Integration: Integration with smart home ecosystems
  • Community Effects: Sharing and downloading community-created effects