Hey everyone,
I've been working on a comprehensive Good Night controller for my smart home and wanted to share it with the community. If you are looking for a single application to handle everything from climate control to audio, lighting, and global home state synchronization, this might be exactly what you need.
It handles up to 4 separate rooms and intelligently syncs them to dictate your global House Modes.
Key Features:
- Live Sleep Dashboard: Each room features a built-in HTML dashboard displaying the live environment (temperature and humidity). It also calculates a sleep suitability rating and maintains a 7-day sleep history log.
- Dynamic Ceiling Fan Control: No more waking up hot or freezing. The app allows you to set a base temperature and will automatically scale your ceiling fan speeds as the room heats up. It officially supports Simple On/Off, 3-Speed, and 5/6-Speed ceiling fans.
- Global Mode Synchronization: You can require specific rooms to be asleep and ensure there is no active motion before the house enters Night Mode.
- Blocking Devices: Prevent the house from shutting down if someone is still awake by setting "Blocking Devices" (e.g., if the Living Room TV or Pinball machine is ON, Night Mode is paused).
- Lead Room Override: Have a master bedroom? You can designate a "Lead Room." Once that room goes to sleep, the app will start a countdown timer to force the rest of the house into Good Night mode, provided there is no active motion.
- Self-Healing "Fan Wiggle": For those of us with finicky RF fan controllers, there is an optional hourly routine that drops active fan speeds by one tier and bumps them back up to ensure the physical hardware is perfectly synced with Hubitat.
- Periodic State Enforcement: A routine wakes up every 10 minutes to verify the system state—forcing lights back off or closing shades if they were manually overridden while the room is asleep.
- System Boot Recovery: If your hub reboots or you experience a power failure during the night, the app will automatically run a recovery scan and re-apply the correct Good Night environment to any room that is still asleep.
- Sonos Audio Polish: Built-in sleep audio management. Set a fixed nighttime volume, configure a sleep timer to stop playback automatically, and provide up to 5 Audio URIs that the app will randomize each night.
Open Source Disclaimer: This application is completely open-source and free to use. You are welcome to install it, edit it to fit your specific needs, or strip out any snippets of code to use in your own projects. Enjoy!