m1tchem
Posts: 4
Joined: Tue Jun 12, 2018 7:55 am

Beginner - Home Automation Advice

Tue Jun 12, 2018 8:26 am

Hi Guys,

I am new to Raspberry Pi and have recently acquired a Rpi 3 Model B in the hope of being able to set up a home automation system that is controlled via an app or similar. I am looking at using a system that incorporates control of my lights and power sockets with feedback letting me know if they are on or off and also possibly notifications from my alarm PIR's/reed switches. If the app had an ability to create scenes where as soon as I arrived home multiple items would be triggered, that would be ideal but not necessary at this point.

With this aim in mind, what path would be ideal for me to start researching and implementing?

Thanks in advance,

Mitch.

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Beginner - Home Automation Advice

Tue Jun 12, 2018 9:03 am

The "feedback" is an issue for radio and mains-borne home automation systems such as X10. You need to be looking at IP remote controlled sockets and the like (probably WiFi), or a full bespoke setup with RPis communicating to other RPis.

Bear in mind that there are already commercial offerings such as Hive and Nest, with RC sockets and lighting etc that can be controlled through Alexa or Google, and although expensive may get you where you want a lot quicker than rolling your own.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

m1tchem
Posts: 4
Joined: Tue Jun 12, 2018 7:55 am

Re: Beginner - Home Automation Advice

Tue Jun 12, 2018 9:56 am

Firstly, thanks for your reply. As of the feedback issue, would there be some sort of device that could be connected to the load side of the lighting cable in order to send back a signal that could provide that feedback for the app to interpret?

Other than that issue, X10 seems to be a bit more commercial than I was hoping. I guess I should have specified that I would rather be sending a signal to a relay that would control whichever light/socket at the time a button is pressed

JJL1
Posts: 15
Joined: Mon Jun 11, 2018 2:17 pm

Re: Beginner - Home Automation Advice

Tue Jun 12, 2018 7:52 pm

Have you tried adafruit.com? That is a PI project store and school. They may have lessons for you

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Beginner - Home Automation Advice

Tue Jun 12, 2018 10:35 pm

I've used radios to control Maplin remote sockets (max 16 unique devices). There is no direct feedback from the socket, but you could monitor the effectiveness of the device you switched on/off. A couple of the devices I controlled in this way were a fan heater and dehumidifier, I used a dht11 to measure the ambient temperature and humidity. Once the desired levels were reached, I switched the devices off.

I used Node-Red to build the control flows, and Arduinos to do the radio and dht11. The Pi and the Arduino were linked by a different radio. The flow was quite simple; once a minute the Pi would send a command to read the dht11, the Arduino would send the results back, and the Pi would act on the them.

I had this working well for a few years with no problems (initially I had a Pi in the greenouse doing the lot, but the environment proved problematic (temperature, humidity, power cuts and spiders) so I switched to a remote Arduino (it has better timing for some things and more tolerant of unexpected power outages).

The sketch running on the Arduino was an LLAP implementation which is similar to firmata where the sketch receives 'commands' to do things.

I've since moved house, and no longer have a greenhouse to control (yet).

User avatar
The Traveler
Posts: 363
Joined: Sat Oct 21, 2017 3:48 pm

Re: Beginner - Home Automation Advice

Tue Jun 12, 2018 11:09 pm

With this aim in mind, what path would be ideal for me to start researching and implementing?
Ideal for me wouldn't necessarily be ideal for you. Start with learning basic Raspberry Pi and go from there. Think big, start small.

Sounds like generic advice, and it is. It's hard to grasp advanced concepts, like creating home automation, without understanding the basics first. It's counterproductive to point you at a particular method or paradigm for advanced study without laying the groundwork.

You will need to decide for instance what programming language you want to use. Python? C? Java? Or ... Then moving on to hardware specifics on the RPi. You want to use serial communications, wireless, bluetooth, etc. These are only a couple of areas you'll need to consider.

My suggestion is to spend some time just learning and having fun. Do simple projects and build your knowledge up. Then work on fleshing out your project later when you can make more educated choices yourself.

As Adafruit has already been suggested, the MagPi magazine is an excellent source of information, tutorials, software and hardware articles, projects and I suggest it to anyone just getting started. You can download back issues and find lot of useful information: https://www.raspberrypi.org/magpi/

Cheers and good luck.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

m1tchem
Posts: 4
Joined: Tue Jun 12, 2018 7:55 am

Re: Beginner - Home Automation Advice

Wed Jun 13, 2018 3:41 am

Wow, I'm very appreciative of your responses. I realise that there is a lot of basics that I need to learn before I can truly decide the best avenue. I was just hoping that could learn on the run while making the home automation project and didn't want to use something that would not achieve the desired outcome. I am an Electrician and have used a little bit of Clipsal C-bus and contactors etc. so I have a small understanding of the basics although even what asandford has explained seems beyond my comprehension at this point. Based off the advice given, it seems no matter what coding path I go down, I could still get to where I want to be in home automation. Will definitely check out Adafruit and MagPi.

Thanks again,

Mitch.

User avatar
bensimmo
Posts: 4838
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Beginner - Home Automation Advice

Wed Jun 13, 2018 6:34 am

I think there a lot of methods around now.
Lear information them and finding which does what is hard.

The recent MagPi and HackSpace magazines have covered some of these, well worth a browse through. (Free to read in odd form)
In fact the current one is a home automation one
https://www.raspberrypi.org/magpi/


I have use Cayenne on a RaspberryPi and Webpage/Android App, it now uses a MQTT protocol.
I have not done a lot with it yet, but it's been around for a while and the developers are still always responding to community questions over there.
I don't think it is as advanced as the more involved setups... Yet.

Sonoff WiFi switches (and can fit other sensors) may get you the remote control and monitoring you want. It may need custom firmware and some good old hacking https://github.com/arendst/Sonoff-Tasmota/wiki might give you an idea.

But look around, see which seems to do what you want easiest.


But do have a simple play following the basics first, it'll give you a feel for the Pi.

m1tchem
Posts: 4
Joined: Tue Jun 12, 2018 7:55 am

Re: Beginner - Home Automation Advice

Wed Jun 13, 2018 8:27 am

I've just had a read through the MagPi issue 70 which is rather interesting! Will definitely be looking into learning python.

The Sonoff system actually looks really easy to set-up and almost had me buying a large number of switches; until I started reading some of the reviews for the app on the Android Play store. It seems as though a large number of people are having major issues/bugs with the app. Quite disappointing as it seems like a great set-up otherwise. Would it be hard to get their switches working with another method? Would Cayenne accept any switches?

Going to start with Adafruit and try to build something small as you have all suggested.

Thanks heaps guys.

User avatar
bensimmo
Posts: 4838
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Beginner - Home Automation Advice

Wed Jun 13, 2018 8:44 am

The link I gave is for puting on a different firmware/software called Tasmota (there are others as well) onto the sonoff devices, it then opens it up to do what you want.

The App from Sonoff itself and like anything going via the internet, relies on it and remote servers.


Technically it should work with Cayenne or anything that uses MQTT as that protocol is in that firmware.
There is a good amount of soldering and learning to do.
Read around before buying, play with getting an LED and a switch working first, you can buy them from anywhere (which country are you based)


Youtube may give some good ideas too.
https://www.youtube.com/watch?v=_389pQPLyr8 might be a good start for ideas.
or this
https://www.youtube.com/watch?v=vL54JfldB4Y
and go from there. You'll see OpenHAB mentioned. Not used it, but it has been mentioned on the forum quite a few times.

I'm no expert, just giving pointers, I don't have a particularly smart house yet.

Return to “Beginners”