Q1) How can I find the latitude and longitude of my location?

A1) Open a Linux terminal and at the prompt type “python” and hit the <ENTER> key, then type in the following:

city = ephem.city('Vancouver')

print city.lat, city.lon


print city

Will print all information know about that location.

Choose a city that is close to you if yours doesn't exist and your sunrise and sunset variables will probably be close enough. You can get your exact Latitude and Longitude from Google maps by pinpointing your location.

Q2) How can I have a generic interface into the system.

A2) You can use a “NamedPipe” interface for example a piece of camera equipment that we don't have the code to echos a "motion" to a UNIX style pipe file. We can read this file and if we assign it as a “StateInterface” device and use a “NamedPipe” Interface the system will know if it is “motion” or “still”.

pipe_front_yard_motion = StateInterface(NamedPipe('/tmp/front_yard_motion'))