/synthia

Synthia - The Synthetic Intelligent Assistant for your home

Primary LanguagePythonApache License 2.0Apache-2.0

Welcome Home with Synthia

Authors: Geoff Khorn, Sarah Carroll, and Tom Carroll

Synthia is a Synthetic Intelligent Assistant for your home.

We love to give our homes unique personality with furniture, decor and lighting. But what if we could take that personalization futher and interact with our homes?

Synthia is an intelligent assistant that sends you off in the morning with helpful reminders, then welcomes you home at the end of each day. This is done using motion detection triggered by a camera built into a Raspberry Pi. If motion is detected within a certain time range in the morning or evening, it will trigger functions to play a customized message.

Synthia is written in Python 2.7.

Prerequisites

  1. Raspberry Pi 3 Model B with Raspbian Jessie
  2. Pi NoIR camera
  3. Bluetooth speaker (or 3.5mm powered speaker)
![Raspberry Pi and Speaker](synthia.jpg)

Setup

  1. Install Python 2.7 on Raspberry Pi
  2. Install OpenCV on the Raspberry Pi with OpenCV-for-Pi (or if you want to compile OpenCV on the Pi: http://www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3)
  3. Install virtualenv for Python if you have not already done so.
  4. Run the following commands to setup virtualenv within this repository folder on the Raspberry Pi:
    # Setup virtualenv and install pip modules:
    virtualenv --no-site-packages synthia-virtualenv
    source synthia-virtualenv/bin/activate
    pip install -r requirements.txt
    
    # A symlink is needed to use cv2 in Python:
    # NOTE: The directory of cv2.so may be different depending on how you installed OpenCV
    ln -s ~/.virtualenvs/cv/lib/python2.7/site-packages/cv2.so synthia-virtualenv/local/lib/python2.7/site-packages/cv2.so
  5. Install mpg321 on the Rasperry Pi
    sudo apt-get install mpg321
  6. Configure the desired audio output device as the system's default on the Raspberry Pi

How to Run

Execute the following line on the Raspberry Pi:

python synthia.py --conf conf.json

The default configuration is to each day execute exactly one morning event between 6:00 and 10:00 and exactly one welcome home event between 18:00 and 23:00. These times are relative to the current time on the Raspberry Pi.