Close
0%
0%

Home Automation Console.

Over the last 10 years or so my personal home automation controller has grown and grown.

Similar projects worth following
The system i have created (and continue to work on daily) brings together all the different automation technologies that i have built and purchased over the years. Think of it as a Manager of Managers.

Currently integrated:
Anything the Vera supports via the Vera API (zwave, insteon, ip, x10, etc)
Any IP controllable device (http or tcp-ip)
Any IR devices (curently using a Slink-E device)

The system leans on several outside systems for added functionality
Vera Home Automation Controller http://getvera.com/
SickBeard TV Downloader http://sickbeard.com/
Couch Potato Movie Downloader https://couchpota.to/
ZoneMinder camera server https://zoneminder.com/
Open Energy Monitor

So this project needs some new short term goals.

Over the coming months I would like to aim more toward making this a very flexible, easy to install, user friendly system.

Here are the goals that will make this a reality.

  1. Create an installer that takes the DBServer name, username, password, etc and creates the database. It will then walk though some basic questions about which modules need to be initialized. I think from there each module should be able to have its own setup wizard that will prompt for its own configuration.
  2. improved automation logic gui. I was thinking of using http://flows.nodered.org/ to create triggers and output events that can be easily linked together graphically. These configurations would have to be saved back to the database. I would then need to adapt the back end service to use the new logic database.
  3. improved scripting gui for advanced logic. I plan on using http://codemirror.net/
  4. I have "borrowed" some open source CSS and JavaScript examples. I need to start tracking those down again and make sure I give them credit somehow in the interface.
  5. Change the sub routines that load settings from the PHP configuration file to load settings from a database table. Create an interface that allows all of these settings to be modified while preventing bad configurations. (IE if a path string is required offer a browse box, if a slash is required at the end programmatically make sure its there.)
  6. The system needs an interface for adding and removing widgets, currently they can be added from the database and then moved around from the gui.
  7. There are a couple of bugs that i manually work around by editing the database from time to time. These bugs will need to be fixed.

Its not a small undertaking but its work that needs to be done because anyone else without intimate knowledge of the code would never be able to get though the installation let alone its configutation.

  • I was a little distracted, good things came.

    Todd Anderson09/15/2016 at 14:38 0 comments

    So someone gave me an Amazon Echo the other day to play with. i played around with Ifttt.com and setup an integration with this project using Ifttt.com. The resulting plugin allows any event in Ifttt.com to be brought into the HomeAutomation controller and any HomeAutomation controller output to trigger events in the Ifttt.com engine. This worked great but forced the echo commands to look like

    "alexa trigger living room tv on"

    "alexa trigger kitchen lights on"

    That word trigger rubbed me the wrong way and it turns out that ifttt.com requires that word. So i set out to find a new solution to the problem. Turns out you can create your own Echo apps so i did just that.

    Using AWS Lambda i created the required OAuth connections and python code to register all of the devices on my home automation system with the Echo. It then uses HTTP get requests to send that information back to the home automation controller. End result is natural phrases like

    "Alexa turn on the living room TV"

    "Alexa turn the living room TV on"

    etc.

    Now i am working on voice response code that can be configured from the scripting engine.

    So......

    "Alexa is the living room TV on" would result in "Yes, the living room TV is on"

    or

    "Alexa is my front door locked" could result in "no, would you like me to lock the door?"

    Cool stuff. Amazon now sells the Dot for $49, if you buy 10 you get 2 free.... think i might do just that and put them all over the house.

    If you read this far and your interested in this project throw in a comment below and let me know what your looking for, or maybe what you would like to see the project do before you would consider installing it in your own home.

  • More interface fun

    Todd Anderson09/01/2016 at 16:19 0 comments

    A quick test today using CodeMirror. The editor supports F11 fullscreen, tag highlighting, full search, code coloring, line numbering, visible tabs, highlights extra space, etc.

    I currently only plan to have scripts written in PHP although the CodeMirror platform works for all kinds of languages if i want to expand in the future.

    when editing scripts they will automatically save to the server as they are being edited (real time). the server will store the last 200 edits in a server side undo history and pass those back to Code Mirror if the local browser undo history hits 0 records. This will allow anyone to undo changes that were made some time ago using a different browser session.

  • Working out the automation interface.

    Todd Anderson08/31/2016 at 13:19 0 comments

    So over the last few days i have been playing with HTML5 and CSS to work out the best interface options for how automation could function.

    So far I am leaning toward a node style interface. Elements could be added with a right click menu that provides inputs, outputs and decision conditions.

    I still have a lot of interface work before turning my attention to the back end.

    i need to:

    • Add a way to remove items. (right now you can only add them.
    • I have text boxes but i think it would be good to have drop downs, maybe check boxes or radio buttons but i am not sure about that one.
    • Create some Javascript that exports to JSON and sends back to the server on every edit. Should save the last 100 or so edits in a queue so i can add an undo button that works even weeks, months or years after the edit.
    • Create a JSON standard for how elements are added, put this in the database so adding new plugins can add new inputs/outputs/conditions.
    • The menu lists will be dynamic so i need to have an option for menu items to wrap around if they are more then 15 or so items.

    Thoughts?

  • My Old Wall Screen.

    Todd Anderson08/19/2016 at 21:03 1 comment

    This was my first version of the wall screen which was removed from service about 6 months ago. This wall screen was created using an old ELO touch screen that i found at auction for under $100. it was mounted in the wall and a 50' VGA and serial cable were run down to the basement and into an old desktop PC. I then covered the hole in the drywall with a picture frame from Walmart with a custom cut mat that matched the inner dimension of the image. That picture frame was attached to the wall with velcro. Worked great for many years but used to much electricity.

    The new wall screens are Ipads mounted in the wall using IPort ipad holders like this one. They use a low voltage power supply that feeds off two conductor wire down the the basement where they wire into a small power brick. While more expensive these units will cost me less in the long run.

  • The Hidden Features

    Todd Anderson08/19/2016 at 20:44 0 comments

    There are a few background features that have been implemented that are quite powerful.

    • The system has an Javascript messaging bus that talks constantly to all connected clients and can relay status messages and events to the clients. This is used to display notifications like "The newest episode of ____ has just downloaded" or send status messages like if XBMC is playing and what file its playing.
    • Each connected client's device registers with the backend and receives a cookie. That identification number can be used to send specific commands back to the client. I use this to control various wall screens around the house that run on wall mounted IPAD's. This allows me to load the traffic cameras on the front door panel as i leave for work in the morning.
    • There is a scheduled task engine where services can register for events to be run at specific times or at set events like "sunrise" or "sunset". These events are stored in the database and survive server reboots.
    • Intelligent downloading rules that run nightly allow all movies or TV shows with specific actors, dates, or other criteria to be automatically added to the download queue. So any 1950's movie that gets more then 4 stars that has a specific actor will be downloaded.
    • The system can work with Asterisk to automatically ring all phones in the house when phone numbers are clicked on (yellow pages app). Once the home phone is picked up it makes the outbound call to the number that was clicked on.
    • some elements of the system can be controlled from asterisk by calling into your home number and entering the passcode.
    • any page layout based on plugins can be edited by adding the "?movable" tag to the url. Drag the elements to where you would like them and resize any that need to be resized and remove the flag from the url. Changes are saved in the database.
    • The main plugin page is configured for each user account. One user can have a completely different layout from the next user.
    • NIghtly the system will analyse the movies you have downloaded and compare that to an online database of recommended movies. Each movie is assigned a score which is incremented with each match. Once completed it will return the top 100 movies that you would like to download. Clicking on any of those entries will automatically add it to couch potato for download. Once a movie has completed downloading it is removed from the wanted list and added to the local movie database.
    • I'm sure there are more, i will document them here as i go :

  • Reporting Module

    Todd Anderson08/19/2016 at 20:06 0 comments

    The reporting module has a series of graph plugins that can display any data logged to the database. Currently the reports cover

    • Electricity usage
    • Furnace Usage (how long it has run, daily, weekly, monthly, etc)
    • Temperature graphs (inside vs outside)
    • Water Usage (hot vs cold by time)

  • Scheduling and Scripting

    Todd Anderson08/19/2016 at 18:56 0 comments

    The engine has the ability to add PHP scripts that can be scheduled or triggered on events

    Here is what i have in place so far

    1. Turn the outside lights on when my IPhone GPS shows I am within 2 blocks of my house.
    2. Turn of my wall screen with the traffic cam page when I walk down the stairs in the morning.
    3. Lock the front door every 30 seconds. (If its unlocked)
    4. Turn off any TV when XBMC is not playing as long as the TV is on the XBMC input
    5. Turn off bedroom lights if there is no motion for 10 minutes
    6. Turn the hallway light on at night when a kid walks to the bathroom then turn off the bathroom light when there is motion back in their bedroom again.
    7. Turn on the TV and select the proper input, then send the proper JSON statement to XBMC to play a movie after the movie is selected on the wall screen.
    8. Announce across the house (speakers)
      1. Laundry Status
      2. Parking (Snow day means I cannot park on the street by law)
      3. When Todd's Iphone leaves the work zone around 5PM
      4. Battery low on any of the sensors
      5. Pings, if any cannot be completed ("Internet Down", "Phone Server Down", etc)
    9. Take a picture of people at the front door when they ring the doorbell. This is done with the front door PTZ camera.
    10. Take a picture of whoever is at the front door if the door access code is entered wrong, take this picture and txt message it to my cell phone.
    11. Control the blinds in the house depending on outside weather and light. IE, if it's windy and the window is open then raise the blinds so they don't get wrecked
    12. ARM/Disarm the alarm depending on upstairs/downstairs motion (night mode)
    13. Open the garage door when the right HID card is read at the outside SMART Card reader.
      1. Have one time user cards
      2. Have timeframe cards (Drywall guy will be here from 12-2PM)
      3. Have permanent use cards.
    14. Pantry light, automate based on door open/closed.
    15. Alert if my ATV leaves the radius of the house.
    16. Send Alerts to XBMC (Display on TV)
      1. Outside Door Open
      2. Backyard Motion (Night Time)
      3. Doorbell
      4. Caller ID
      5. Voicemail
    17. If lights in the living room are off and the living room XBMC is paused, slowly bring the lights up 60%. (also for Bedroom and Basement)
    18. When the sliding door is opened and it's dark outside turn on the outside light. Then turn the light off if no outside motion for 5 minutes
    19. Voice control for Door Locks, Lights, Alarm arm, list events, etc.
    20. At night send the off commands to lights/stereo/TV's if no motion in anything other than bedrooms
    21. When humidity gets to high in the bathrooms the fan will automatically turn on until the humidity matches the surrounding rooms.
    22. Enable whole house fan when temp outside is closer to the target temp then inside.
    23. on Saturday morning, if movement in the kids rooms is followed by movement in the living room it puts on the most watched kids movie from the last 1.5 weeks. (keeps them from waking me up)
    24. I have added a large arcade style button below each TV, pushing the button plays a random Kids TV show. This keeps me from having to pay for cable TV.
    25. Transcoding all unwatched video to smaller file sizes that can be streamed to my iphones via a podcast.

  • Unfinished Modules.

    Todd Anderson08/19/2016 at 18:49 0 comments

    I originally wrote this system about 14 years ago while working for the cable company. I had a software development position at the time and wrote the system completely in VB6 and ASP. Since that time i have rewritten the entire system in PHP using HTML 5 and CSS.

    The old system had a few great features that i have not yet ported over to PHP

    • Music Index (indexes all music files and finds duplicates. Allows music to be played thoughout the house.
    • Picture viewer (screensaver and picture index that allows family photos to be cataloged, tagged and indexed
    • Recipe index (search by ingredients, etc)
    • Shopping list creator (works with kitchen mounted bar-code scanner). Allows you to select a store which causes the list to reorder as per the aisle in the stores. it does this using an online bar-code database that has product categories. I then created a database of the nearby stores and mapped each product category to an aisle in the store.
    • Security system arm/disarm. I bought a TCP-IP bridge for my DSC alarm system, have to reimplement.
    • Contacts listing. Lists off all friends and family with pictures/address/phone number etc. Clicking on the number caused all phones in the house to ring. (this was possible using an Asterix server that i built.

  • Subnet Scan Module

    Todd Anderson08/19/2016 at 18:22 0 comments

    The subnet scan module is alot like the ping module exept it scans though all known and unknown IP addresses in the subnet. I use this to identify what IP addresses i can assign to various pieces of equipment around the home.

  • Ping Module

    Todd Anderson08/19/2016 at 18:20 0 comments

    The ping module pings home devices from the server and alerts if the server or service is down. This works in real time refreshing though the items on the list every few seconds.

View all 26 project logs

  • 1
    Step 1

    I chose to implement the system on IIS installed on server 2012. Please note that is the system that has gone though testing. The code could be quite easily adapted to run on linux on something as small as a raspberry pi depending on the size of the data base.

    The PC you select for the install should be fairly high end if you plan to use the video transcoding features.

    Please note at this point that the product requires a little bit of SQL knowledge to get it setup. In future releasese i plan on putting together a setup wizard however at this point many settings need to be set in the database.

    Prerequisites

    • Server with:
      • IIS Installed
      • MYSQL V5 or late
    • Couch potato installed and working
    • SickBeard innstalled and working
    • SABNZB installed and working with Couch Potato and SickBeard.
    • Some features require a Vera controller.

    Items (I will add more detail here as i get closer to release)

    • Copy the downloaded code to c:\inetpub\wwwroot\*
    • Import the starter DB to MYSQL
    • Create a MYSQL account that has access to the DB
    • Configure the MYSQL details in the settings.php file.
    • Configure each required setting in the settings.php file.

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates