Telling Google Home good night should start sleep tracking

@jiri-urbandroid Hi, I’m really looking forward to this feature, and I can’t wait to see it. Something I would suggest is to make a Sleep As Android skill for the Google Assistant in general, which could allow anyone with the Google Assistant to initiate sleep tracking and/or set an alarm inside of Sleep As Android.

I’m not entirely sure what Google Assistant skills have access to (in terms of sensors, radios, etc) but it would be really cool if you ask a Google Assistant smart display “Wake me up around 7:30 tomorrow morning” and it would set a smart alarm using Sleep As Android. Or maybe you could say to it “Hey Google, start sleep tracking.” And it would say “Okay, which alarm do you want me to wake you up with?” And you could either set an alarm through it or you could use a preset, and then after selecting one it would say “Okay, I’ve started your sleep tracking. Good night!”.

Then maybe once you wake up, it will do the alarm just like it would on the app, using the sounds and settings you selected. It would also be really cool if it would support the captcha features, and you could do the captchas right from the smart display, but it would detect you getting out of bed and wouldn’t turn off the alarm or let you do the captchas until you’re out of bed.

This would be perfect for the newly announced Lenovo Smart Clock, because it’s made to sit right beside your bed while still being capable of a lot of the stuff every other Google smart display can do.

Thanks for all your hard work! Your app is probably my favorite app ever!

2 Likes

I have this set up using ifttt to send me a text message which triggers this Automate flow (free, unlike Tasker) : http://llamalab.com/automate/community/flows/27657

Only requires the phone screen to be unlocked.

1 Like

@jiri-urbandroid Any updates on this feature? It’s been a few months since anyone has talked about it; figured I’d check in.

I’m especially looking forward to Google Home integration; being able to set smart alarms as part of the “Good Night” routine, have them trigger sleep tracking on my phone and watch, and turning them off like a standard Assistant alarm would be killer.

2 Likes

I guess it would be really really cool and usefull to get G-Home integration.
Cause most smarthome products ( lamps, wall plugs e.g. ) have G-Home support also.

So in my idea, a simple “good night” to G-Home should turn off the lights and other defined devices, and also should start sleeptracking.

Really looking forward to something like this.

2 Likes

Hi, guys.
You can do it via app called Tasker.

So I’m currently programming a bot for Google assistant, and while this defiantly would be possible to add in and potential isn’t actually that hard, it has some drawbacks.

Google Assistant only really allows integration through external bots, and apps cannot be linked into default commands. Therefore, commands like “set an alarm for X” or “good night” or even “start sleep tracking” wouldn’t be possible, as far as I can tell. The best alternative could still be “tell sleep as android to start tracking” which isn’t too bad. Maybe a better name than sleep as android for the Assistant module may be needed because I’m not sure if you can have the word “Android” in a bots calling command, however this wouldn’t be too hard to implement.

1 Like

Hello Daniel, may I use your expertise here. The issue I see is how to tell the SaA app on your phone that the users did issue the command. The app is designed as offline and there is no authentication. So we would need to have some could service which is called though the assistant and than somehow direct a cloud messaging message to all devices of the users and see if on one of them SaA is listening. But I’m not sure if we can even somehow pair the users? Do you have any idea how this could be done?

1 Like

I think what you are looking for is the “app actions” integration, however I’m not entirely sure if that is suitable.

Hypothetically, it should just be an extension of the app, and from what I can tell (I haven’t used this specific Assistant tool before), it should do what you intend. You can definitely set it up so a user can use Google Assistant to start sleep tracking. The only thing I can’t figure out is if this works across devices, so that a Google Home could be used instead of a phone itself. If this isn’t something you’d want, then this is probably what you need from what I can tell.

My knowledge is mainly in the conversational aspect of Google Assistant, being able to communicate with a backend webhook server. You could quite cheaply and easily setup a webhook server that could handle what you need to do and more. Google have a free service a a part of Firebase which allows for almost instant communication between a server and devices. It’s preauthenticated through Google, and is trivial to implement into the webhook server.

If you want to discuss this in more depth, a better way to contact me would probably be Discord, due to substantialky quicker responses, but I am always available here. Discord: @DanPerks#6755

Actually my “home” works pretty good. I am using TP-Link lamps and wallplugs, wich i can controll with “ok Google” … blablabla …

So actually I use "ok google, turn off the light ( or turn off everything ) and start sleep "
Then I only have to tap the “start sleep tracking” button.

I dont know if there allready is a option to start sleep tracking automaticly when the app starts, but if there is not, then it would be a nice option to have, cause this would solve most problems i guess.

I guess you got it wrong. We are looking for a solution, and not for a workaround. But thx for the idea.

I am sorry to resurrect an old thread, but wanted to comment. I’m actually trying to figure out how to do this again on my new phone, the old one just bricked and I had it all set up there. I should have copied over the steps or written a guide. But here’s the elements of what I was doing to get it to work. Perhaps someone can comment with more details.

Was using a combination of IFTTT Webhooks+Google Assistant, to send and Autoremote message that triggered Tasker and started sleep tracking.

I would say “hey Google” “it’s time to crash” and that would trigger IFTTT with Google Assistant+Webhooks, to trigger my Autoremote URL message, which Tasker was set up to see and trigger the start sleep tracking plugin.

Hopefully that helps. I’m trying to remember how I did it, and where I found the steps to get it done and can’t anymore. It was Reddit somewhere I believe. I’m most of the way there but can’t get the Tasker profile set up properly… Anyways, if anyone can use that data and then fill in my memory it would be appreciated, I’m sure, by the whole community.

And when I say Google Assistant, I mean Google home as well, since you talk to the Assistant through GH.

cheers

Oh yeah, once you set up your Webhooks+GA trigger phrase in IFTTT you can add that phrase to any routine in Google Home, and it subsequently triggered sleep tracking through the method I just described. :+1:

Google Assistant now offers native Shortcuts to perform app actions on devices. If Sleep as Android exposed its Start Sleep Tracking (and any other) actions as Shortcuts, this would be easily possible to add to a Google Assistant routine without having to go through Tasker or Automate.

2 Likes

@jiri-urbandroid Should we wait for this integration anywhere soon?

I’m waiting for this feature too.

Maybe Sleep as Android app could have setting?

Where you could choose if sleep tracking starts automatically or not when app is opened…

That would make it pretty easy to use assistant for sleep tracking…

App should have setting if tracking starts automatically or not when app is opened…

Pretty simple solution?

Edit: didn’t think that all the way through, what comes to those who uses smart speakers etc…

But would be useful option for those who uses assistant on phone to start tracking automatically when app is opened…

Looks like there’s Assistant integration now based on the March 10 release notes, not sure how to get it working though.

Looking at the release notes, I can’t understand how to use it. Documentation doesn’t have anything as well.
Was anybody able to get this working?

1 Like

Nothing unfortunately. Any feedback would be appreciated.

It’s possible to set it up. Just it is quite difficult. I talked about how to do it here.

1 Like