Samstag, 13. Juni 2015

Howto home automation Raspberry Pi yet another way (The Pi)

We have our home automation set up our way. Here is how. In this post the configuration on the server side (rasperrypi) is described.

(This Howto only works at the moment with elro switches. The codes used for the switches can be changed in the switch command you find in home/piphie/switch (see *).

We are at our home able to switch on a video screen, Google Chromecast, and our HiFi stereo by the  App FunkySwitch. Then we start the Netflix App on a Phone, connect it with Chromecast and watch whatever we find on Netflix. If we'd like to switch off some light in the room, we turn its current off by using FunkySwitch. To accomplish that one can follow the following howto. We do this on Ubuntu 14.04 LTS. However, the steps can be found for Windows and Mac, too.

First hardware needs:


The software we used are
After downloading Raspbian we follow the official documented steps to install the image on the SD-Card. We did this by using (sdb is the sd-card in my case. If unsure, look here for explanations):
unzip 2015-05-05-raspbian-wheezy.zip
unmount /dev/sdb1 # this was only in our case. Use the sd* that fits your SD-card. 
sudo dd bs=4M if=2015-05-05-raspbian-wheezy.img of=/dev/sdb 
sync
If the card was remounted, unmount it again. Put it now into the Raspberry Pi, plug in Hub, keyboard, and network. We here use the wireless adapter. Therefore this has to be configured in /etc/network/interfaces. After changing the file, the service is restarted.
sudo nano /etc/network/interfaces
 Change this file to
auto lo
iface lo inet loopback
iface eth0 inet dhcp

auto wlan0 
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ap-scan 1
wpa-scan-ssid 1
wpa-ssid "WLAN-NAME"
wpa-psk "WLAN-KEY"
And do the restart.
sudo service networking restart
After this we need for ease-of-use and for automation the ssh-server capability.
sudo apt-get install openssh-server
However, this was not necessary for us. It seems to be pre-configured in raspbian.

The software

wiringPi

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git-core # was already newest version...
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build

rcswitch-pi

git clone https://github.com/r10r/rcswitch-pi.git
cd rcswitch-pi
make

piphie commands

These scripts are small and at the moment very easy. However, have a look at it and you can change them to your needs.
git clone https://github.com/Boltzmann/piphie.git  

some minor things...*

cd
mkdir bin
ln -s /home//rcswitch-pi/send .
ln -s /home//piphie/switch . 
To have easy ssh access on the raspberry use authentificaton with keys. In short, you need

 ssh-keygen
ssh-copy-id -i .ssh/.pub @
Now, load FunkySwitch, add your key into "SPECIALS"-"IMPORT RSA KEY", in settings specify and for "User name" and "Server name".


Donnerstag, 11. Juni 2015

Gespräch mit Versicherungsberater

Gesetzliche versus Private Krankenversicherung

Werde gerade beraten. Ich fühle mich gerade wie bei "Der gute Mensch von Sezuan". Irgendwie.