This is the new web interface for my home automation interface.
The Hidden Features
There are a few background features that have been implemented that are quite powerful.
- 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 :
It downloads and stores the daily comics in a database and allows me to click though them. Every morning it automatically goes out and downloads the updated comics.
Family Finder Module
My wife and i have 3 children, its hard enough to keep track of one kid let alone the 3 kids at all times. This module shows all family members over-top of google maps. it updates in real time on a 5 minute delay as we move around.
It has geofencing capabilities. Currently I use the following rules:
- Turns on the outside house lights when a family member drives or walks toward the house. But only if its dark out.
- Alerts my wife when i am driving home from work so she knows she can start making dinner.
- Alerts me if my kids leave the school yard during school hours.
Traffic Camera Module
This module displays life feeds of every traffic camera in the city i live in. In the morning when i get up to go to work the wall touch screen by the front door turns on and displays the cameras that i will pass on my way to work. I can quickly use these cameras to figure out which roads i should take. The cameras are all live feeds and update with a new image every 2-3 seconds.
Pong Clock Module
I have written this app 3 times over the last 5 years or so, it gets a little better every time. This version uses some code i found on the internet which allows it to run in the browser very smooth. My previous version had better more realistic paddle movement where the left hand player was obviously a worse player. I plan on combining the logic code from my previous version with the new version to create a better clock interface.
Yellow Pages Module
Site Links Module
Site links are configurable and provide a nice jumping point to the different servers and services that are needed to bring this site together.
Sites can be added or removed and proxy can be enabled for these interfaces so they can be accessible from outside the home. Please note that the proxy is hosted on an SSL driven website that uses authentication.
Subnet Scan Module
08/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.
Scheduling and Scripting
08/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
- Turn the outside lights on when my IPhone GPS shows I am within 2 blocks of my house.
- Turn of my wall screen with the traffic cam page when I walk down the stairs in the morning.
- Lock the front door every 30 seconds. (If its unlocked)
- Turn off any TV when XBMC is not playing as long as the TV is on the XBMC input
- Turn off bedroom lights if there is no motion for 10 minutes
- 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.
- 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.
- Announce across the house (speakers)
- Laundry Status
- Parking (Snow day means I cannot park on the street by law)
- When Todd's Iphone leaves the work zone around 5PM
- Battery low on any of the sensors
- Pings, if any cannot be completed ("Internet Down", "Phone Server Down", etc)
- Take a picture of people at the front door when they ring the doorbell. This is done with the front door PTZ camera.
- 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.
- 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
- ARM/Disarm the alarm depending on upstairs/downstairs motion (night mode)
- Open the garage door when the right HID card is read at the outside SMART Card reader.
- Have one time user cards
- Have timeframe cards (Drywall guy will be here from 12-2PM)
- Have permanent use cards.
- Pantry light, automate based on door open/closed.
- Alert if my ATV leaves the radius of the house.
- Send Alerts to XBMC (Display on TV)
- Outside Door Open
- Backyard Motion (Night Time)
- Caller ID
- 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)
- 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
- Voice control for Door Locks, Lights, Alarm arm, list events, etc.
- At night send the off commands to lights/stereo/TV's if no motion in anything other than bedrooms
- When humidity gets to high in the bathrooms the fan will automatically turn on until the humidity matches the surrounding rooms.
- Enable whole house fan when temp outside is closer to the target temp then inside.
- 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)
- 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.
- Transcoding all unwatched video to smaller file sizes that can be streamed to my iphones via a podcast.
Module: Plugin module
These plugins have already been created
- Daily Comics
- Webpage widgit (load any webpage in an iframe)
- Energy Usage 24 hour (Any one of the sensors can be selected)
- Energy Usage 30 days (Any one of the sensors can be selected)
- Energy Usage Year (Any one of the sensors can be selected)
- My Location (on google map)
- Traffic cams
- Garage Door Status
- stereo volume (airplay)
- Temp (current, target, mode)
- Snow route (can i park my car on the road today)
These Plugins have yet to be written
- Small Weather (easier to place version)
- Today (# of downloaded TV Episodes, # of added movies, # of movies played, # of TV Shows Watched.
- podcasts encoded, power used today, cost of power 24 hours,
- Yesterday (Same as above.
- status (# of movies, # of TVShows, # of recepies, # of contacts)
- Hours of TV watched, Hours of movies watched. (by week month and year)
- Door Locks (unlock the front door, garage door etc)
- Error log (last 25 events)
- Notifications (last 25 events)
- Lights that are on
- Devices that are on
- Doors/windows that are open
- Water usage
- IR Events
- Doorbell log
- Front door image list (camera images taken when doorbell or lock triggered)
- Furnace Runtime Day/week/month/year
- Kids PC usage day/week/month/year by child
- Server disk space (Donut Chart http://codepen.io/githiro/pen/ICfFE)
- Or this cool looking chart http://codepen.io/miyavibest/pen/kuyKJ
- Gas usage
- Solar charge
- Body weight (using my Withings Scale)
- Download GB (by PC... Donut Chart)
- Internet traffic in and out of the house
- Video game Timer, keeps track of how long the XBOX, etc have been on
This module controls the 6 TV's throughout my home, the system supports XBMC or VLC control.
Each TV is setup with XBMC running on a raspberry PI. Each PI has a USB to serial adapter that connects to the TV control. There is a small script that shares the serial port via TCP-IP to allow TCP control of the TV even though they only have Serial control.
The interface for media allows access to TV, Movies and hard drive folders containing my familys home movies. Movies and TV can be sorted by category or name or searched. There is also a "Query" option that allows for customized lists of TV or Movies. Currently I have customized queries by:
- Unwatched by TVDB or MovieDB rating
- Ended TV Shows
- Kids Shows
- Kids Movies
- Random TV Show
- Random Movie
- Random Top Gear Episode.
Currently there is one view for TV and another for Movies however the code is written that multiple views like cover view could be added in the future.
Selecting the TV or Movie that you would like to play and selecting the room to play it in will cause the TV to turn on, TV input to change, Volume to reset, AMP to turn on, Its input to change, etc.
- Movies and TV are automatically added and indexed from CouchPotato or SickBeard.
- Watched VS unwatched is tracked and logged by date/user for reporting
- Customized podcasts are created and video is transcoded to allow my IPAD to stream all my shows while i work.
- Any video playing in any room can be transfered or mirrored in any other room
- Playlist support for creating TV/Movie playlists.
- Bookmarks can be created and restored at any time on any TV.
- Supports XBMC and VLC as output devices
- Many nightly maintenance tasks that download new reviews, update movie relationships, set movies to download based on criteria, download image artwork, etc.
- Hard drive folders can be added and indexed.
- TV and AMP control using configuration files for each make and model. I have generated config files for all of my home equipment (very scale-able)
- RV Sync. When my RV is parked in front of my house it syncs all unwatched TV to the NAS onboard and deletes any previously synced content that has already been watched. When we vacation all of our TV and Movies are ready to be watched on the go.
I plan to create a youtube video for this section to walk though the various media features.
- Audio support for MP3/ogg/etc using XBMC/VLC
- Support for MythTV (I had this completed at one point but have rewritten all code since then)
- Better Podcast support to allow custom podcasts and custom encoding settings for each podcast
Scratch Pad Module
I have always liked to take notes when an idea comes to me. This simple editor lets me create new notes and store them on the web server. The HTML 5 editor functionality comes from a great online project called CKEditor (http://ckeditor.com/). All saves are version controlled and stored on the web server. Any revision, save or edit can be undone even years later.
Another fairly simple module, this module allows control of any ZWave thermostat via the Vera controller. I have stolen the images from an android app made by Honeywell. If and when i release the code i will have to remove those image and come up with my own interface. I just really liked the Honeywell interface.
I have also added the ability to add additional Zwave switches to the interface, for now this allows my "summer Fan" that feeds the whole house to be controlled.
This module will get some more love in the near future. Currently it displays a fairly simple list of all the lights, outlets and other zwave output devices in the home. All of these devices are currently hooked up to a Vera home controller. This page interfaces with the Vera API's to constantly pole the current status as well as allow the status to be changed.
I would like to have a configurable background image and an interface to place switches or outlets onto the image, this could be used to create a 3D view of a home with an easy touch interface.
Live Camera Widgit
Another small plugin that allows viewing of my outdoor and indoor webcams (one turned off for this screenshot). The images stream MJPEG and the PHP script acts as a proxy server to stream to the outside world. Its capable of using password protected cameras. The page is then feed out the the internet using my authentication and HTTPS protocols even if the cameras did not support SSL or authentication.
This plugin can also be attached to any camera monitoring or recording service that supports MJPEG.
TV Remote Module
This module is used by the media module to control TV's and various equipment around my home. It can also be used manually to control the different devices in my home. Each device has a configuration file that specifies if the device is IR/RF/Serial/TCPIP and the hex or ascii commands that are used for each trigger. The configuration file also contains several macro options like "TV on" that contain the list of commands that must be sent when the attached TV is powered on.
The last item in the configuration file is a list of image files and coordinates that can be used to draw a functional picture of the remote. This would allow for buttons to have hover, click, etc images. Eventually i will take the time to take photos of the remotes and make these pages pretty. For now its functional.
I currently have about 15 devices working in this list, most of which use Hex commands sent via TCP-IP.
City Bus Module
My wife doesn't have a drivers license and takes the bus everywhere, and so the bus module was born. Specify a time and bus stop number and it will display the current bus location on the map and let you know how long it will take the bus to get to your stop.
The City i live in published great API's that can be used to query every bus location
I plan to add basic conversions to the calculator to make it more handy on the kitchen touch screens. milliliters to liters, pounds to kiligrams, etc.