Home Automation with SMS and GPS

39
Location-Based Hacks How to Automate Your Life with SMS and GPS Aaron Parecki • @aaronpk Open Source Bridge • June 2011 Slides and code available at aaron.pk/osb11

description

Have you ever wanted to automatically turn on your lights when you get home, or turn them back off when you leave? What about controlling your lights by SMS or IRC? This presentation will teach you how to automate your life with location-based hacks and SMS.

Transcript of Home Automation with SMS and GPS

Page 1: Home Automation with SMS and GPS

Location-Based HacksHow to Automate Your Life with SMS and GPS

Aaron Parecki • @aaronpk

Open Source Bridge • June 2011

Slides and code available ataaron.pk/osb11

Page 2: Home Automation with SMS and GPS
Page 3: Home Automation with SMS and GPS

Sparkfun Hardware GPS

• As expensive as a phone

• Not real-time, download the data every night

• Another device to charge and carry

aaron.pk/osb11 @aaronpk

Page 4: Home Automation with SMS and GPS

Phones with GPS Hardware

• One of a small subset of smartphones with GPS capability in 2008.• Now, most smartphones have this capability.

aaron.pk/osb11 @aaronpk

Page 5: Home Automation with SMS and GPS

@aaronpk

Raw GPS Logs

aaron.pk/osb11

Page 6: Home Automation with SMS and GPS
Page 7: Home Automation with SMS and GPS

@aaronpk

Temporal Relationships

• Relationships for a limited time

• Meeting a client – 30 minutes before the meeting

• Carpooling to work – every day from 8-9am

• Even with friends, their location is not always relevant to me

aaron.pk/osb11

Page 8: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

Page 9: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

Personal LocationAnalytics

Page 10: Home Automation with SMS and GPS

Everyone has a unique footprint of their city

aaron.pk/osb11 @aaronpk

Page 11: Home Automation with SMS and GPS

LOCATION-BASED TRIGGERSSome fun uses for real-time location

aaron.pk/osb11 @aaronpk

Page 12: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

GeonotesLocation-Based Reminders

Try it! aaron.pk/geonote

Page 13: Home Automation with SMS and GPS

Proximal Address Notification

Send an address as a Geonote.

It will arrive where you need it.

aaron.pk/osb11 @aaronpk

Page 14: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

Page 15: Home Automation with SMS and GPS

@aaronpk

• Sends users notifications of restaurants nearby their location that are below a threshold of cleanliness.

• Made by Reid Beels at a Geoloqi Hackathon

aaron.pk/osb11

Page 16: Home Automation with SMS and GPS

@aaronpk

Trigger-Based Actions

Create triggers based on where users are.

aaron.pk/osb11

Page 17: Home Automation with SMS and GPS

@aaronpk

Turning On/Off Your Lightswith GPS and SPS

aaron.pk/osb11

Geoloqi APIYour Home

Server

X10

Tropo.com

Your Home Lights

Page 18: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

X10 Lamp Switch

Linux Command Line X10 Clientwww.heyu.org

$ heyu on A1

Page 19: Home Automation with SMS and GPS

@aaronpk

Geoloqi Layers

aaron.pk/osb11

Web Views

Page 20: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

Page 21: Home Automation with SMS and GPS

@aaronpk

Create a Layer in Geoloqi

aaron.pk/osb11

Docs: geoloqi.org/API/layer/create

Page 22: Home Automation with SMS and GPS

@aaronpk

Create a Trigger in Geoloqi

aaron.pk/osb11

Docs: geoloqi.org/API/trigger/create

Page 23: Home Automation with SMS and GPS

@aaronpk

Handling a Trigger from Geoloqi

aaron.pk/osb11

Docs: geoloqi.org/Trigger_Callback

Page 24: Home Automation with SMS and GPS

@aaronpk

Loqi – the Friendly IRC Bot• Core is MediaWiki RecentChanges perl bot

• Listens for incoming UDP packets and echos to a channel

• IRC messages are routed to a separate script on a new thread

• Loqi’s reactions to messages can take an indefinite amount of time without hanging the main IRC process

• Hangs out in #pdxwebdev on freenode

aaron.pk/osb11

Page 25: Home Automation with SMS and GPS

@aaronpk

Loqi – the Friendly IRC Bot

aaron.pk/osb11

Page 26: Home Automation with SMS and GPS

@aaronpk

Loqi – the Friendly IRC Bot• Easy to send messages from new sources because it’s

listening on UDP

• Security by obscurity! Yeah!

• Quick way to debug things on random web servers

• Send messages from any language

aaron.pk/osb11

Page 27: Home Automation with SMS and GPS

@aaronpk

Loqi – the Friendly IRC Bot

aaron.pk/osb11

Page 28: Home Automation with SMS and GPS

@aaronpk

Create an SMS Number

aaron.pk/osb11

tropo.com

Page 29: Home Automation with SMS and GPS

@aaronpk

SMS to IRC Gateway

aaron.pk/osb11

https://gist.github.com/1043323

Page 30: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

Page 31: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

Page 32: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

Page 33: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

Page 34: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

Page 35: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

Page 36: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

Page 37: Home Automation with SMS and GPS

@aaronpkaaron.pk/osb11

Page 38: Home Automation with SMS and GPS

@aaronpk

Indoor Location! (sort of)• Watch your DHCP server logs for mac addresses

• Your phone makes a DHCP request almost immediately when you get in range of your home Wifi

• Quick and cheap way to know if you’re home!

aaron.pk/osb11

Page 39: Home Automation with SMS and GPS

Thank you.

Geoloqi.com

Slides & Code: aaron.pk/osb11

Aaron Parecki @aaronpk