Thursday, 23 February 2017

Home Automation On A Budget

I've been on a multi-year journey to get the best bang for my buck and build a home automation, security and entertainment system.

Each piece of hardware has a specific Python module that takes care of it, and there is a large main web module that allows user interaction with the system as a whole.

The idea was to spend as little as possible on each item so there will be ups and downs to each item and you will either needs to build your own controller software or have a very flexible HA controller that allows custom modules to use all this stuff within your own system.

I will start by writing up a list and a review of each piece of hardware I use in my system.

Filtrite 3M-50:
This is a rebadged RadioThermostat  CT50 and often sold for much less.
This was the first thing I got and probably one of the most useful.

Pros:
- Low cost  $80-100 USD
- Large backlit touch screen (black and white)
- Supports multi stage systems
- Connects directly to 2.4 GHZ WiFi networks via included U-Plug module
- Easy to use free app that gives detailed stats and talks directly with thermostat
- Works like a normal thermostat locally
- Well documented local API

Cons:
- No local web interface (just a page to change the wifi settings)
- Can be a little slow to respond
- Uses Ad-Hoc network for initial setup
- Requires a "C" wire to work at all
- Asks for battereis yearly but you don't need them
- No local security

The 3M-50 is a pretty nice thermostat.   Most functions can be controlled via the touch screen, the worst part is the mode and fan physical buttons on the side look and feel the same so you need to remember which is which.  Other than that the interface is very straight forward and feature rich... It supports most heating and cooling systems* including multi-stage systems and heat pumps.  It also has settings for swing and other things most people don't need.   It also has 2 stages of local locking where you can lock out advanced and setup modes but allow local adjusting of temperature or you can lock all the controls on the thermostat and manage it only via WiFi.
Schedule programming locally is a little non-intuitive as it is with most thermostats with a fixed display, however I have never had to use it since they provide such a nice user interface via the app or website.

* Many systems don't have a "C" or common wire which is needed to power up the U-Plug module.   The thermostat part will work on batteries, but the WiFi will not.  Make sure you have or can run a common wire before buying this unit!  Also since this unit is generally "wall powered" via your furnace, it will run fine even without batteries.

The U-Plug module is a little cartridge that plugs into the side of the thermostat.  This is basically a WiFi radio and a microcontroller that can talk to the thermostat over some kind of serial interface.  (They also make ZWave U-Plug modules).   Without the U-Plug module the thermostat is just a standard touch screen thermostat with an extra connector.

Initial setup of the U-Plug module can be tricky as it requires a device that can connect to an Ad-Hoc WiFi network.   My Windows 10 laptop nor my smartphone would do this, I use an old Windows XP laptop to set it up, however once it's setup you can access it's web interface to change any WiFi and LAN settings.   Beyond that there is no other controls in the web interface and it's pretty slow to respond.

The API is JSON based via it's web server but it's API only so don't expect to go to it's IP to do anything. That being said the iPhone and Android app is very nice and they even have a web based interface on the radiothermostat website.  You can change modes, settings, temperatures, build your 7 day, 4 period schedules (one for heat one for cool), view current temperature and status, view hourly and daily graphs of runtime, and set low and high temp alerts though these two options.   The app when connected to the same network as the thermostat will communicate with it directly via API calls and when you are away from it, it will communicate via the cloud albeit with a 5 minute delay between check-ins.

The API is very easy to find online and pretty easy to implement if you need to write your own code.

AlarmDecoder (Formerly known as AD2USB):
This unit was the only one of it's kind when I got it, it allowed users to integrate their home security system with their automation system generate alerts and remotely control it.  This is now avail as a service through your monitoring provider if you want to pay a monthly fee but that will not integrate with your automation system.

This will work with a Honeywell Vista or DSC Power series panel, however I think the Eyezon Envisalink-4 which is only about $20 more is a better option as it is self contained and does not require a PC.

Pros:
- Small and easy to wire (as simple as adding a keypad)
- Well documented by manufacturer (this is a developers product)
- Acts as a USB serial port and starts giving data as soon as you connect it
- Can act as virtual zones and trigger events on your physical system
- Will show all RF events if you have a receiver even if they aren't programmed in your panel (sniffer mode)
- No monthly fees

Cons:
- You need something that can talk USB to use it
- User interface software provided is sketchy at best
- Third party product not supported by manufacturer of panel
- You will need your installer code and the know-how to program your system somewhat

I've found this unit to be a very useful and reliable addition to my system.   It allows me to get notices when sensors are triggered, send commands to my system when I am away from home and even have automation events triggered via my key fobs.

This unit was built for developers so there is a forum to ask questions and a full API on their website.

It hooks up with 4 wires from your panel and is configured the same way a keypad is configured. If you have a GSM or network communicator already it can sniff communications with your central station and if you don't it will emulate one so it can get detailed event messages.

It starts dumping raw data to the COM port (every few seconds a specific status string is dumped) and events such as relays, RF and communicator events are sent with a special prefix as they happen.  Numbers typed are sent as keypresses and there are special characters you can use to send messages for virtual zones.

The developer offers a local keypad emulator program that you can download that will show your alarm events and allow you to press keys but it's fairly simplistic and I have never used it.

The Envisalink-4 (about $120 USD) is a better option however as it can go inside your panel, connect directly to your LAN and has a built in web server.. They also have a user friendly, free portal interface at eyezon.com that allows you to get alerts and control your system remotely and they even have an option to pay a few bucks a month to have your system professionally monitored.  It also has a local API built in so you can write your own code.

X10:
I have been slowly phasing this stuff out as it's not reliable across phases (I don't have a coupler) it's one way, sometimes randomly turns on or off and there are way better things out there.

At the moment I only have a single X10 wall switch left and a CM-11a serial and a USB RF interface as well as a few RF transceivers around the house.

Pros:
- Can be bought wholesale super cheaply ($3 - $8 USD per device)
- May be the cheapest option for "lick and stick" switches and motion detectors
- Decently documented API online for PC interfaces

Cons:
- Does not pass phases very well (some plugs will not work)
- 99% of devices are one way so you can't confirm if they turned on/off
- Can be unreliable and can switch from noise on the line
- Software is abysmal
- Slowwwwww
- No security

The only hardwired device I still have is a bathroom wall switch which allows me to use a stick a switch inside the bathroom to control the lights as well as an X10 motion detector to turn the lights on/off during the evening.  I also have a few RF transceivers around the house since the RF range isn't that great.

I have many stick a switch units and palm pad controllers around my house to remote control my automation system, I also have several eagle eye motion sensors to tell where people are and where they are going in combination with my home alarm systems motion and door sensors.

Most similar solutions are way too expensive so I will probably be using the RF part for many years to come.

I don't recommend X10 modules or switches for most applications unless you need to control a ton of things and have a very tight budget.  If you are looking to control just 1 or 2 plugs and a bunch of lights there are better options for a little more money.

The serial PC interface can take up for 5 seonds to process and respond to a command so if you are looking for instant response this may not be a good option for you. (The newer USB interface is much faster at around 1 second but it's an RF device so it has to be within RF range of your RF devices)

Wemo:
These devices made by Belkin are pretty handy and can be extremely reliable.  There are a ton of these type devices on the market but I only own the Wemos.

They cost about $35 USD and come in many different types.  You can even find some appliances with built in Wemo controllers.

Pros:
- Fast response
- Full load supported (120v @ 15a)
- Local interface (button and light)
- Free app with remote access (if you want it)
- Two way so you can poll device state
- Expandable: power monitors, motion detectors, etc.
- Built in schedule system
- ITTT support

Cons:
- Relatively expensive
- You need a smartphone to use it (app)
- API is not well documented
- Range isn't great
- 2.4 Ghz only, no Ethernet jack
- No local security

I currently own a Wemo Switch, two Insight Switches and a Wemo Light Switch.  The switch plugs into a socket and you can plug a device into it, the light switch is hard wired and replaces an existing switch to make it into a smart switch. The insight switches work just like the Switch but have power monitoring, more on this later.

You can long press the light switch to trigger another Wemo device if you so choose in the latest firmware.

The app is OK, it can be a little slow and clunky but it does what it says on the tin.    The devices switch almost instantly when a command is sent, and when you turn the device on locally the app will almost instantly show that it's been powered on or off.

New devices broadcast an open SSID which you connect to and then open the app which walks you through naming and giving your network settings after which the device will connect and show up in your app.   You can choose to enable remote control which sets up a connection to Belkin's cloud so you can control it away from home.  The devices DO broadcast an open hidden network but Belkin support says you cannot connect to this network while it's associated with your network.. My testing has shown this to be true.

I believe the API is SOAP based, I have a python module calle Ouimeaux that allows me to control it via software but I have had issues with modules disappearing or being not reachable, though I think I have fixed that (see my Wemo offline post).

I can't seem to find any documented API for setting up a new device without the app and the few details for switching and reading status out there are out there are pretty sketchy, inside code and scattered around at best.

I may eventually document the whole API but it's pretty low on my priority list.

Update: The Insight switches are pretty neat.  They are about half the size of the standard Wemo Switch, and the whole top of the device is touch sensitive (there is no physical button).   The app adds a new pull down for the device and new options.  The pulldown will show the current power usage in Watt Minutes, as well as average usage, it also shows the run time for the day (reset at midnight), and and approximate daily and monthly cost.  It will also show if the device is ON, in Standby.

You program the minimum current for ON so you can tell if your TV for example is switched off but in standby or actually powered on.  The default is a few watts.  You can also program your current electric rate and it will give you more accurate cost calculations.

The Ouemeaux module supports polling all this data directly from the switch so you can find out exactly how much power something is drawing in milliwatt minutes. Current run/standby time, last run/standby time, etc.

Connected by TCP:
This is a connected lighting system that USED to be made by a relatively large Technical Consumer Products bulb producer.
They decided to completely scrap the Connected line after some internal changes.
This means if you can find the bulbs in store they are likely being sold off for a few dollars and you can still buy whole kits online for less than the cost of a single Hue bulb.

Make sure you have spare bulbs because they could become hard to find in a few years.

Pros:
- One of the cheapest connected bulb systems just got cheaper
- Two way, control dimming and power states
- Different form factor of bulbs including CFL and LED in different shape and socket types
- 800 lumen (60w equiv) are the most common bulb
- Supports use of internet gateway or RF remote control or both
- Fully documented API by me
- Mfgr and 3rd party apps work with system
- Had a nice web interface ***
- High local security on newest firmware
- Bulbs form mesh network for extended range
- Can act like a normal light bulb
- Other companies are selling gateways that will support these bulbs
- Timers and scenes
- Many bulb support 200+

Cons:
- Not made anymore could be hard to find
- Nice local interface has been removed in latest firmware
- Range can suck depending on layout and number of bulbs
- No WiFi on the gateway, it has to plug into your router or switch (or get a WiFi bridge)
- Jennet-IP isn't a popular protocol (so it won't work with a z-wave controller or anything)
- Cloud service discontinued, but other companies are picking up the slack


This system is pretty nice for the money.  If you read the Pros and Cons you'll notice a lot of contraditions, let me cover those first.

The oldest firmware had a very nice insecure http interface with pretty pictures and Javascript and animations and all by browsing to the devices IP... It also had an SSH server with a root password of thinkgreen.   The API did not check tokens and everyone was happy.

Then they decided they wanted to be super secure so they shut down the SSH server, killed off the HTTP server, switched to HTTPs, started checking tokens and required that you press the button on the device to actually get a token.  In my case this update completely broke their app and I have had to work around it.   That left me with few options for controlling it, so I just fixed my code to use the new token system and have since made their app work again.

The other thing is range... I have found the gateway needs to be pretty close to the bulbs you are using... They will form a mesh network so if you have a bunch of bulbs they will pass messages to each other but they have to all be powered on (not lit up though).   This means you can technically have unlimited range but you need a bunch of relay stations between the gateway and the final bulb.

You can poll in real-time the state of each bulb and what brightness level it's at, if it's powered on and reachable by the gateway and a whole pile of other useful data.  You can also setup groups of bulbs into a virtual fixture and put different bulbs and fixtures into up to 10 different "rooms"

You can also build timers and scenes which can be accessed with the push of a button.

There are other manufacturers which are picking up the slack in the software department left when TCPi decided to leave the connected market so you aren't SOL if you buy this system or already own it and still want cloud and product support and these devices are multi protocol hubs so you can add other smart bulbs and devices by adding them.

If you can find old stock at Home Depot you can get 70-90% off the original prices!

These devices also will come on at full brightness after a power off (min 1.5 seconds) so you can use them as a regular light bulb too if you don't always want to use the app.  Just keep in mind if you switch the power off you can't control them anymore.

I have documented the full API of the TCP gateway in another post here for anyone looking to develop software of an interface for these devices.

MiLight:
This is another connected bulb system but it's a cheap Chinese system.  The main advantage is they have mutli-color bulbs similar to the Hue system but a whole kit costing much less than a Hue bulb.

Pros:
- Very cheap
- WiFi only gateway (2.4ghz)
- No web interface except for setup
- Many 3rd party apps are better than OEM
- Decent range
- Has local security on the configuration interface
- Supports stand alone remote
- Works as a normal light bulb
- Virtually limitless sized bulb groups

Cons:
- RGB bulbs are only at full brightness in "white" mode
- RGB is stepped, can't produce any color
- No local security for controlling the bulbs
- Limited number of separate bulbs (4 groups of 1 or more bulb [x2 - One RGB, One White] Max 8 groups per gateway)
- One way communication
- No cloud service
- API isn't well documented but there are python modules out there that work
- WiFi Only (2.4 Ghz).

This system is great if you want to feel like you have a Hue system but also want to feel like your wallet isn't empty.  I paid around $40 USD for a WiFi gateway and an RGB bulb.  I also got a Warm White/Daylight bulb for another $8.

All the bulbs are dimable via the software and they all do at least 2 colors.  The WW/D does a yelowish warm white at full brightness and a blueish daylight color at full brightness and can be switched, dimmed and turned on and off via the app.

The RGB can be set to a soft white or any of 16 or so colors, it also has many "effect" modes such as disco where it flashes on and off in different colors and rainbow where it slowly fades between colors.  There is a slider within the app that you can move along a color gradient but it's much more stepped as opposed to fluidly switching between the colors... There is one color of red and one color of orange, etc.

Soft white will be at the full brightness you purchased, however when you switch to a color mode you loose about 1/3 of the brightness... I'd say the 65w equiv bulb is about 40w equiv in RGB mode but don't quote me on this I haven't measured.

You can dim from anywhere to 100% to 0% as well as turn the bulb on or off.  They also have a super low brightness mode called night light.

The app allows you to select your gateway (if you have more than one) and then it gives you a choce of about 6 different remote control styles.  These aren't labeled and are a little hard to understand.  You also will note the color the non color remotes will only work with color and non color bulbs.. ie you can't use a color remote with a white bulb.

Each remote has 4 buttons to select the group of bulbs you want to control... When you add a bulb the gateway programs the bulb with it's group number and the gateway's ID. This means you can have an unlimited number of bulbs per group since the bulbs aren't aware of each other, nor is the gateway aware of each individual bulb.

You are however limited to a max of 4 single RGB bulbs and 4 single white bulbs per controller.

Since these are one way you can't confirm they switched on or off or accepted the color change command so if that's important to you avoid these.   For the most part I have never had a problem with these doing as they were told since the devices are never switched off and are within range of the gateway.

I don't have the API for this but I found a python module that lets me do all the functions the app can.  I did not look into it further.

Generic USB Relay Board:
I have a ceiling fan with a factory remote that controls the fan speed and light... I got a 8 port USB relay board and wired the remote into it so I could control my fan and lights... This is more of a project than a off the shelf product however.


That's it for now... I'll add more another time.

No comments:

Post a Comment