Skip to main content

Alexa, is anybody home?

· 3 min read
This post was originally published by me here

It would be awesome if I could ask Alexa if someone was at home, in the office or even in an individual room. It would be very simple to retrofit an IP camera with FTP upload capabilities to the Alexa service since it’s just a web application at the end of any Alexa skill. I’ve not had a chance to do this yet so here’s a public note. Take particular phrases:

"Alexa, is anybody at home?"

"Alexa, was anybody at home today?"

"Alexa, was anybody at the office this morning?"

"Alexa, was anybody at home 1 hour ago?"

The Skill Invocation Name You’ve probably guessed, the phrase to enable the Skill is [is/was anybody at], short and easy to remember. Once the invocation name is recognised, the web service just needs to identify intents - the place and the time.

"Alexa, [skill wake phrase] {place} {time}"

"Alexa, [is anybody at] {home}"

"Alexa, [was anybody at] {home} {today}"

"Alexa, [was anybody at] {the office} {this morning}"

"Alexa, [was anybody at] {home} {1 hour ago}"

Identifying the place

The web service would have a database of known locations, and a configuration for accessing information. For instance, we could associate a location to an IP camera that uploads files to a server whenever activity is detected. If we store details to access those files, we can quickly determine information on activity within the building by reading the uploaded files.

Query the time.

The time as mentioned earlier can very quickly be transformed into a timestamp using something as simple as a few switch statements and PHP’s strtotime function. For example:

"this morning" - between 8am and 12pm

"today" - between 0:00 and 23:00

"1 hour ago" - strtotime(“-1 hour”)

At the very basic level, all we would need to do is look at the timestamp for files that were created/modified between those times, and return an outputSpeech back to the Alexa service with text confirming a file presence.

"Yes, there was someone in the office this morning between 8am and 12pm."

Taking it a step further

Since we already have the files, we can easily hook this service up to use facial recognition and identify who was around.

"Yes, Paul was in the office this morning from 8am to 10am."

Please Amazon, enable push notifications on skills!

It would be very useful if Alexa could tell me this information without having to ask — not that I’m nosey or anything...