Google Nest Hub Sleep Detection Variables?

Has anyone figured out how to pull Google Nest Hub (2nd gen) 's sleep detection variables into Home Assistant for automation of their sleep input boolean? Also the temperature of the room?

“Sleep Sensing uses Motion Sense to track the sleep of the person closest to the display. With a low-energy radar, Motion Sense detects movement and breathing. Other sensors in Nest Hub detect sounds like snoring and coughing, and environmental factors like light and temperature in the room. That’s how Sleep Sensing determines not just when you went to bed and how long you slept, but also the quality of your sleep.”

1 Like

@User87 Me, too. I have the Withings sleep pad and would like to compare the two. Only had the Google one up for a day, but it’s fairly close.

Unsure of how I will exploit it yet, but I have realized that you can ‘play relaxing sounds’ with a sleep timer whose ‘auto-off’ response can detect when the user falls asleep. This ‘relaxing sound’ track can be seen by the media player in HA.

In theory, you could create a Google routine to start the track at bedtime, use a HA automation to silence the track, and another automation to trigger when the track was stopped, signifying the user’s sleep onset event.

1 Like

@User87 how do you do that? I was trying to search for this feature to stop music on Nest Hub when I fall asleep, but I failed to find anything :frowning:

I would like to ask if you have successfully implemented it?

I did not. It was a little too complex and detailed to work predictably for me. I think it could still be done though.

I presently have satiated my general needs with several automations to turn on sleep mode (only when sleep mode is off) and turn off sleep mode (only when sleep mode is on) triggered by a number of conditional events. These can be used to target specific individuals’ sleep routines/patterns, then set a group ‘anyone sleeping’ boolean.

Sleep mode is activated when:

  • Bedroom lamp changes on to off for seven minutes near bedtime
  • Bedroom motion sensor is activated near bedtime
  • Phone is connected to charger near bedtime
  • The time is 11:30 PM (or the latest estimated bedtime)
  • Google Home ‘Goodnight’ routine is activated by voice command
  • Google Home sleep sounds are playing
  • The time is 08:30 AM when working night-shift

Sleep mode is deactivated when:

  • The time is 7:30 AM (or the latest estimated awake time)
  • The time is 16:30 PM when working night-shift
  • Google Home ‘Good morning’ routine is activated by the voice command
  • Side door opens in the morning (to let the dog out)
  • Bedroom lamp turns on for five minutes in the morning
  • Phone is disconnected from charging
  • Google Home alarm clock alarm set time is reached (template)
  • Google Home sensor.bedroom_display_alarms state changes to unavailable (HACS Google Home integration)

Thus sleep mode is toggled by the first action from these lists.

How have you accomplished sleep tracking?

1 Like