@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!
@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.
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.
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.
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?
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 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.
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.