Montag, 15. Februar 2016

Part 5: install #pilight on your #pi and controll your lightswitches

TinkerTable switches on and off one of my lights in my flat when I come home or leave home (using IFTTT and geofences and pilight and a python script. And it provides a nice website to switch my lights on and off using my mobile.


installing pilight:

# pilight
https://www.pilight.org/get-started/installation/
run as sudo:
    sudo su
add the apt to the repository:
    nano /etc/apt/sources.list
add this line:
    deb https://apt.pilight.org/ stable main

you'll need a key:
    wget -O - https://apt.pilight.org/pilight.key | apt-key add -

now update the apt package list
    apt-get update
this produced an error so I first installed that driver:
    sudo apt-get install apt-transport-https
and again:
    apt-get update
and install pilight
    apt-get install pilight
Pilight will start itself at boot time
YEAH!

a good guide to pilight in german:
https://raspberry.tips/hausautomatisierung/raspberry-pi-pilight-mit-433mhz-modulen-zur-hausautomatisierung/

you've got to make some changes to the config json file (in the older pilight version there where extra files for hardware and config and settings)
https://wiki.pilight.org/doku.php/config

stop pilight before editing the file:
    sudo service pilight stop
you can start it with
    sudo service pilight start

the config.json looks like
{
"devices": {
"living": {
"protocol": [ "intertechno_old" ],
"id": [{
"id": 0,
"unit": 0
}],
"state": "off"
},
"kitchen": {
"protocol": [ "intertechno_old" ],
"id": [{
"id": 2,
"unit": 0
}],
"state": "off"
},
"corridor": {
"protocol": [ "intertechno_old" ],
"id": [{
"id": 1,
"unit": 0
}],
"state": "on"
},
"bedroom": {
"protocol": [ "intertechno_old" ],
"id": [{
"id": 0,
"unit": 3
}],
"state": "on"
}
},
"rules": {},
"gui": {
"living": {
"name": "Wohnzimmer",
"group": [ "janhimself" ],
"media": [ "all" ]
},
"kitchen": {
"name": "Kueche",
"group": [ "janhimself" ],
"media": [ "all" ]
},
"corridor": {
"name": "Flur",
"group": [ "janhimself" ],
"media": [ "all" ]
},
"bedroom": {
"name": "TinkerTable",
"group": [ "janhimself" ],
"media": [ "all" ]
}
},
"settings": {
"log-level": 6,
"pid-file": "/var/run/pilight.pid",
"log-file": "/var/log/pilight.log",
"webserver-enable": 1,
"webserver-root": "/usr/local/share/pilight/",
"webserver-http-port": 5001,
"webserver-cache": 1
},
"hardware": {
"433gpio": {
"sender": 4,
"receiver": 1
}
},
"registry": {
"pilight": {
"version": {
"current": "7.0"
}
}
}
}

Keine Kommentare:

Kommentar veröffentlichen