New to home automation and need some advice

Hi,

I am new to the wonderful world of home automation.

I got started with it when I bought a simple z-wave device to turn outside Christmas lights on and off and be came addicted.

I then started installing z-wave controlled wall outlets and have been slowly adding light switches etc and use z-wave controlled devices to control the lighting in my indoor garden.

I have a z-wave usb stick that I have plugged into my desktop and run incontrol home automation app to manage the environment, trouble is my desktop is not on 24/7 so automation not always available.

I am considering moving my automation control to something like a raspberry pi 2.

Does anyone have any thoughts on the raspberry pi platform or have recommendations on some other automation platform.

The only real criteria are:

low cost to implement and maintain
available to sustain 24x7 operation
plug and play automation software, i.e. I don’t want to do a lot of programming.

Look forward to hearing from those who have been down this path.

Thanks,

JD

I run my whole house (30+ zwave devices) on a R Pi 2. Pi 2 has plenty of juice for Openhab.

I run the Pi 2 headless and either ssh or vnc to it when I need to see logs or make some change.

Bob,

I will be the first to admit that I am no pc literate could you point me someplace where I can read up on ssh and vnc ?

Thanks

JD

Sure. Let’s start with some intro remarks-just for orientation.

ssh stands for secure shell. So when I, for example ssh to one of my Pi 2 machines from my Macbook Pro, I open a terminal window on the Macbook and type:

ssh pi@192.168.11.86

(using default user on the pi here)…point is to ssh username@ipaddress – there are alternatives but this is simplest course

The terminal will challenge you for user “pi”'s password. (default being “raspberry”).
So you enter the password.

At that point you will be entering commands into the terminal window on your machine (my Macbook in this case) which are actually being executed on the remote (the Pi 2 in this case).
So you can change to the directory where you have installed Openhab on the Pi 2, execute the ./start.sh and watch the console window unwind in front of your eyes on your remote (ie MacBook for me) machine.

VNC ( virtual network console) allows you to have a remote graphical window where you can open editors, multiple terminal windows etc all in the context of working from your remote (ie my MacBook) but executing on the Pi 2 targetted.

Let’s assume the Pi 2 is freshly booted. If I am not physically at that machine, I do the following:

(you could script most of this but digging in here a bit)

  1. from my MacBook, ssh to the Pi 2 and login.
  2. in the ssh session run the script to start the VNC server on the Pi 2
  3. from the Macbook run the vnc app which can connect to the VNC server on the Pi 2 (you have to repeat the logon stuff…VNC uses ssh but is unaware of the login in step 1)

Now you have a full graphical desktop of the Pi 2 on the (MacBook). I usually open a few terminal windows from the toolbar. One in which I will start Openhab and others to follow various logs using a command like

tail -f -n50 zwave.log

which will continually show the last 50 lines in my zwave.log file. (configured in logback.xml in the configurations subdirectory).

ssh is baked into most unix-y os and can be had in Windows via installing cygwin or another unix-y shell.

For vnc, I use TightVNC. Follow directions in this link to install it and create the vnc.sh file.

From my Macbook, I use the tightvnc-jviewer.jar which you can download from TightVNC. Invoking/double-clicking this link (or app in Applications folder) opens dialog for me to connect to the IP address I want and provide appropriate credentials.

Does this help ?

1 Like

Bob,

Thanks that’s great!

I really appreciate your help and patience

JD

No problem.

Hi Bob,

With your RPi, are you doing anything special with the filesystems on the SD card? I had an RPi running for ~12 months as an Asterisk server, but I went to upgrade it to a newer version and it ended up completely broken. The SD card was bad, presumably because of constantly writing log files etc.

I didn’t have a backup of the config (stupid) and I never did get round to recreating it from scratch. I just couldn’t face the hassle as it took so long to get it configured properly the first time!

I have considered setting it up again but I’d do some research next time into things like noatime mounts, log files in a ram disk, root mounted read only etc.

Cheers

Jon

I moved all the post-boot info to a USB device. My Pi 2 only does initial boot from the SD card, all the writes and userspace stuff is on the USB device.

You could use either a USB stick or a USB hard drive (need a powered USB hub for this). I have done both stick and drive.

Currently I have 4 Pi 2’s in a dogbone case. One of these is my master system, the others experimental/or have non-automation tasks.
The master system has a USB hard drive attached through a powered hub. The master system boots from the HDD and Samba shares out the drive to the experimental Pi 2’s.

Here’s some links:

For USB stick:
https://samhobbs.co.uk/2013/10/speed-up-your-pi-by-booting-to-a-usb-flash-drive

For USB drive:
http://www.bloubloublog.com/raspberry-pi-install-via-hard-drive/




http://www.circuidipity.com/run-a-raspberry-pi-2-from-external-usb-storage.html
http://www.modmypi.com/blog/how-to-mount-an-external-hard-drive-on-the-raspberry-pi-raspian

For USB drive, I strongly suggest you read all the links before embarking. Each link has some tidbit or another that was left out of others.

Bob

2 Likes

Very useful info Bob, thanks very much.

Cheers,

Jon

You are welcome. We’re all in the same boat here.

B.

I followed this link for booting to an external USB drive and it was fairly straightforward: