Stop automations when baby sleeps

Nothing is worse than putting the baby to sleep, just for the automated lights to come on and wake her up. There are ways we can detect if the baby is asleep and then disable any automation from disturbing her.

Use cases

Baby & Nursery

  • Nap Time - Disable nursery automations during sleep
  • Nighttime Sleep - Keep room dark and quiet all night
  • Smart Quiet Mode - House knows baby is sleeping

Adults & Others

  • Afternoon Nap - Disable bedroom automations during rest
  • Work From Home - Quiet mode for important calls
  • Guest Sleeping - Respect guest room quiet time

Products needed

Essential Equipment

White Noise Machine or Baby Monitor
Any device that runs while baby sleeps
The device acts as the "sleep indicator"
Power Metering Smart Plug
TP-Link Kasa, Shelly, or any plug with power monitoring
Detects when sleep device is running
💡 How It Works

Plug the white noise machine or baby monitor into the smart plug. When the baby goes down for sleep, turn on the white noise or monitor. This will draw power, which you monitor using the smart plug. When power consumption rises, you know baby is sleeping.

Basic automation setup

IF plug power rises above 5 watts THEN set "baby sleeping" to true AND disable nursery automations

Step 1: Detect Sleep Start

Triggers

  • Plug's power consumption rises above 5 watts

Conditions

  • None

Actions

  • Flip virtual switch "Baby Sleeping" to on
  • OR Set variable "baby_sleeping" to true

Step 2: Detect Sleep End

Triggers

  • Plug's power consumption drops below 2 watts for 2 minutes

Conditions

  • "Baby Sleeping" is currently on

Actions

  • Turn off "Baby Sleeping" virtual switch
  • OR Set variable "baby_sleeping" to false

Step 3: Use in Other Automations

Add a condition to your nursery automations:

  • Condition: "Baby Sleeping" is OFF
  • This prevents the automation from running when baby is asleep

Platform-specific examples

Home Assistant logo

Home Assistant

Setup Create input_boolean helper: "baby_sleeping"
Start Power > 5W → Turn on helper
End Power < 2W for 2 min → Turn off helper
Usage: Add condition "baby_sleeping is off" to nursery automations
SmartThings logo

SmartThings

Setup Create virtual switch "Baby Sleeping"
Start Power > 5W → Switch on
End Power < 2W → Switch off
Usage: Add "Baby Sleeping is off" to nursery routines
Hubitat logo

Hubitat

Setup Create virtual switch "Baby Sleeping"
Trigger Power monitoring triggers switch
Setup: Use Rule Machine, add condition to nursery rules
Apple HomeKit logo

Apple HomeKit

Setup Create dummy switch or HomeKit-compatible virtual switch
Automation Power rises → Switch on
Usage: Add switch state as condition to nursery automations
Alexa logo

Alexa

Setup Create virtual switch via SmartThings or similar
Routine Power rises → Switch on
Usage: Use switch state in routine conditions
Google Home logo

Google Home

Limitation Limited power monitoring support natively
Workaround Use Home Assistant or Hubitat for logic

Advanced features

Room-specific quiet mode

Expand beyond just the nursery:

Affected Automations:

Logic: When “Baby Sleeping” is on:

Time-based expectations

Combine with time for smarter behavior:

Nighttime Sleep (7 PM - 7 AM):

Naptime (10 AM - 5 PM):

Wake detection

Detect when baby wakes up before you turn off the monitor:

Sound Detection:

Motion Detection:

Dashboard integration

Visual status for caregivers:

Dashboard Tile:

Multi-child support

Track multiple children:

Setup:

Logic:

Troubleshooting

Issue: False “sleeping” detection

Causes:

Solutions: ✅ Measure actual power consumption of device ✅ Increase power threshold slightly ✅ Add time requirement (power > 5W for 1 minute) ✅ Verify only sleep device is on plug

Issue: Automations still trigger during sleep

Causes:

Solutions: ✅ Verify condition is added to each affected automation ✅ Check condition logic (should be “Baby Sleeping is OFF”) ✅ Test virtual switch manually ✅ Review automation logs

Issue: Sleep mode doesn’t end when monitor turned off

Causes:

Solutions: ✅ Lower the “off” power threshold (try 1W) ✅ Increase delay before declaring sleep over ✅ Check if monitor has true standby power draw ✅ Add manual override option

Issue: Variable/switch state gets stuck

Causes:

Solutions: ✅ Add auto-reset after max time (8 hours for night, 3 hours for nap) ✅ Create manual reset button on dashboard ✅ Check plug connectivity ✅ Add backup time-based reset

Best practices

Choose the right indicator device

Good Choices: ✅ White noise machine (clear on/off power difference) ✅ Baby video monitor (consistent power draw when on) ✅ Dedicated nursery lamp (turn on for sleep time)

Avoid: ❌ Devices with variable power (brightness dimming) ❌ Devices with high standby power ❌ Devices that cycle on/off during use

Calibrate power thresholds

Process:

  1. Plug device into power monitoring plug
  2. Record power when device is OFF (standby)
  3. Record power when device is ON (running)
  4. Set “on” threshold above standby but below running
  5. Set “off” threshold below “on” threshold

Example:

Gradual quiet mode

Smooth Transitions:

Priority Levels:

  1. Nursery: Complete quiet mode
  2. Adjacent rooms: Reduced volume/brightness
  3. Rest of house: Normal with volume limits

Related automations: