PI_Rocks
Posts: 8
Joined: Tue Jan 07, 2014 12:53 pm

Setting Up home automation.

Mon Sep 22, 2014 11:15 am

I have 3 spare Pi devices that I want to setup with some home automation.

I have ordered some 8 channel relays and waiting for them to be delivered so Im in the planning phase.

I will have these requirements.

1 - Lights (timed, sensor and manual control)
2 - Equipment (timed, sensor and manual control)
3 - Web interface that can manage all relays (on different Pi) at one page.
4 - Android app that can control all relays (on different Pi) at one page. So if lights in house is on relay connected to PI No 1 and garage lights connected to PI No 2 that Buttons for both can be same screen on app.
5 - Easy to set conditions for relay channels (schedule or condition) without any coding if possible.

Whats recommended OS, Software and APP to best meet my requirements.

Im more used to Pi being used for XBMC but want to get more out of it...

scotty101
Posts: 3869
Joined: Fri Jun 08, 2012 6:03 pm

Re: Setting Up home automation.

Mon Sep 22, 2014 12:19 pm

I'd suggest having a look at Domoticz. It covers many of your requirements and is easily extendable

http://www.domoticz.com/

You can configure raspberry pi GPIO pins as devices and i belive it supports some GPIO extenders too. There are android apps for it and it also has a very capable mobile web interface.

What i haven't played with before is spreading functionality over multiple pi's. Have a look at the wikipage http://www.domoticz.com/wiki/Setting_up_Device_sharing to see if it'll work.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

Pi_Fanatic
Posts: 43
Joined: Thu Sep 06, 2012 1:01 pm

Re: Setting Up home automation.

Mon Sep 22, 2014 1:02 pm

Not sure where you are located but the Enocean Pi would fit the bill for Home Automation as well.

Pi_Fanatic

PI_Rocks
Posts: 8
Joined: Tue Jan 07, 2014 12:53 pm

Re: Setting Up home automation.

Mon Sep 22, 2014 1:54 pm

Thanks for that.

Not sure if its what I need though.

I want to stick to relays with 2 or 3 PIs around the house.

Ideally Id like to manage or control them in one place though rather than going to 3 web pages to manage.

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Setting Up home automation.

Mon Sep 22, 2014 2:00 pm

I've done something similar, but with more sensors and fewer relays. I wrote most of my own code, which it doesn't sound like you're looking to do, but I have some suggestions for your setup...
Take a look at webiopi. It might not be quite what you're looking for, but it should give you some ideas.
Since you want everything controllable from one web page, I would organize this as one master with multiple "slaves" that that single master controls. The master will run the web server, store any state that's needed, and so on. To make a change on a device that's connected to a slave, or to read a sensor connected to a slave, it will SSH into that slave and run the gpio command to read or write the GPIO pin, or execute a script there. SSH is great for remotely controlling other devices, since you can run a command on a remote system from your own command line (or from within a shell script.)

As far as your question about OS, it really doesn't make much difference. I picked Raspbian for two major reasons: 1) I am familiar with Debian, and Raspbian is just like that so I can work with it easily and 2) it is the recommended OS on the Pi, and therefore has great support. While #2 is a good reason, if you have a different Linux distro that you are familiar with (Fedora, for example) then you should probably pick whatever is closest to that. If not, Raspbian is a great choice.

Regarding software, that very much depends. As I said, I wrote a lot of my own. My use is fairly simple, mostly reading sensors and taking actions based on state changes for now. You can always do that too, or you can find pre-written software and customize it. Take a look at what's out there and see what you like and don't like.

PI_Rocks
Posts: 8
Joined: Tue Jan 07, 2014 12:53 pm

Re: Setting Up home automation.

Mon Sep 22, 2014 2:46 pm

Tarcas, thanks for the reply.

You have lots there for me to get on with.
I have dabbled with Linux on PC/Laptop before and found it OK to work with.
I also have a linux Satellite box that I have worked with so I could do some programming if needed.

I like the master slave idea but if the master is down does the slave do nothing ?
Is scheduling possible with "webiopi" too or do I just write scripts to do what I need to achieve.

Would the master / slave option also mean that I can control things from one screen on a phone app ?

scotty101
Posts: 3869
Joined: Fri Jun 08, 2012 6:03 pm

Re: Setting Up home automation.

Mon Sep 22, 2014 2:48 pm

PI_Rocks wrote: Is scheduling possible with "webiopi" too or do I just write scripts to do what I need to achieve.
Scheduling, complex timers, logic and many other things are possible in Domoticz.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

PI_Rocks
Posts: 8
Joined: Tue Jan 07, 2014 12:53 pm

Re: Setting Up home automation.

Sun Sep 28, 2014 7:58 am

One other question.

I have the house cabled with cat5 and have loads of spare connections.

Could I either run the GPIO over distance to relays around the house or could I take connection off a relay and feed it to another relay at the end of cat5 cable or is there a better option.

Would mean that I only need one pi to control several things.

What distance would control signals travel in cat5 and would I need to supplement the 5v.

User avatar
DougieLawson
Posts: 37794
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Setting Up home automation.

Sun Sep 28, 2014 8:02 am

PI_Rocks wrote: Could I either run the GPIO over distance to relays around the house or could I take connection off a relay and feed it to another relay at the end of cat5 cable or is there a better option.
The GPIOs can only give you 16mA, so you're going to need some form of repeater/relay/transistor if the distance gets above a few metres.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Setting Up home automation.

Sun Sep 28, 2014 2:54 pm

DougieLawson wrote:
PI_Rocks wrote: Could I either run the GPIO over distance to relays around the house or could I take connection off a relay and feed it to another relay at the end of cat5 cable or is there a better option.
The GPIOs can only give you 16mA, so you're going to need some form of repeater/relay/transistor if the distance gets above a few metres.
I'm not sure if you can drive a relay over much distance directly from the 3.3v GPIO, but you could certainly use a transistor to amplify it to 5v supplied at the other end, which is probably wise anyway, as relay boards are 5v (or 12v). I do drive my sensors and a couple of LEDs through Cat5e over a distance. I estimate my longest runs at 12-15 meters. I haven't tried much further but I haven't found any distance that I have tried to fail because of added resistance. In fact, I add resistance to any 3.3v or 5v rail that I apply to my cables. By doing this, an accidental short at the far end of the cable isn't truly a short and (hopefully) won't reboot the Pi.

Return to “Automation, sensing and robotics”