
network={
ssid="YOUR_SSID"
psk="YOUR_PASSWORD"
key_mgmt=WPA-PSK
}


sudo apt-get update sudo apt-get upgrade sudo curl -L -k install.domoticz.com | sudo bash




-- script name : script_device_RelaisSchakelaar.lua
-- This script will trigger a bash script every time the device "RelaisSchakelaar" change status
local sensor = 'RelaisSchakelaar'
commandArray = {}
if (devicechanged[sensor] == 'On') then
os.execute ("python /home/pi/relais/relais-stand-1.py")
end
if (devicechanged[sensor] == 'Off') then
os.execute ("python /home/pi/relais/relais-stand-0.py")
end
return commandArray
from time import sleep # get the GPIO Library import RPi.GPIO as GPIO #BCM GPIO input pin 24 (aangesloten op header18) GPIO.setmode(GPIO.BCM) GPIO.setup(24, GPIO.OUT) #uit GPIO.output(24, 0)
from time import sleep # get the GPIO Library import RPi.GPIO as GPIO #BCM GPIO input pin 24 (aangesloten op header18) GPIO.setmode(GPIO.BCM) GPIO.setup(24, GPIO.OUT) #aan GPIO.output(24, 1)


import RPi.GPIO as GPIO
import datetime
import time
import os
GPIO.setmode(GPIO.BCM) # set up BCM GPIO numbering
GPIO.setwarnings(False)
GPIO.setup(22, GPIO.IN) # Read output from PIR motion sensor
# Define a threaded callback function to run in another thread when events are detected
def my_callback(channel):
if GPIO.input(22): # if port 22 == 1
os.system('curl -s "http://127.0.0.1:8080/json.htm?type=command¶m=switchlight&idx=18&switchcmd=On" > /dev/null')
else: # if port 22 != 1
#os.system('curl -s "http://127.0.0.1:8080/json.htm?type=command¶m=switchlight&idx=18&switchcmd=Off" > /dev/null')
# when a changing edge is detected on port 22, regardless of whatever
# else is happening in the program, the function my_callback will be run
GPIO.add_event_detect(22, GPIO.BOTH, callback=my_callback)
while True:
time.sleep(2)
@reboot python /home/pi/pirsensor/pirsensor-edge.py > /dev/null 2>&1



import RPi.GPIO as GPIO
import datetime
import time
import logging
import os
GPIO.setmode(GPIO.BCM) # set up BCM GPIO numbering
GPIO.setwarnings(False)
GPIO.setup(27, GPIO.IN) # Read output from IR sensor
sensorstate = 0
# Define a threaded callback function to run in another thread when events are detected
def my_callback(channel):
global sensorstate
if GPIO.input(27): # if port 27 == 1
#ts = datetime.datetime.now()
#print ts," Sensor detected on 27, sensorstate:", sensorstate
if sensorstate == 1:
sensorstate = 0
else:
sensorstate = 1
# Update domoticz with new counter
os.system('curl -s "http://127.0.0.1:8080/json.htm?type=command¶m=udevice&idx=19&svalue=1" > /dev/null')
# when a changing edge is detected on port 25, regardless of whatever
# else is happening in the program, the function my_callback will be run
GPIO.add_event_detect(27, GPIO.BOTH, callback=my_callback, bouncetime=200)
while True:
time.sleep(2)
@reboot python /home/pi/watermeter/watermeter.py > /dev/null 2>&1

cd /home/pi git clone git://git.drogon.net/wiringPi cd wiringPi git pull origin ./build
cd /home/pi wget -O lights.zip http://www.mannema.nl/lights.zip unzip lights.zip cd lights g++ -o kaku kaku.cpp -I/usr/local/include -L/usr/local/lib -lwiringPi
sudo ./kaku 19 D on
-- script name : script_device_StopContact2.lua
-- This script will trigger a bash script every time the device "StopContact2" change status
local sensor = 'StopContact2'
commandArray = {}
if (devicechanged[sensor] == 'On') then
os.execute ("/home/pi/lights/kaku D 19 on")
end
if (devicechanged[sensor] == 'Off') then
os.execute ("/home/pi/lights/kaku D 19 off")
end
return commandArray

#!/bin/sh pi=$(ping -c 5 8.8.8.8 -i 0.5 | grep received | cut -f2 -d"," | cut -f2 -d" ") case $pi in 5) curl -s "http://127.0.0.1:8080/json.htm?type=command¶m=udevice&idx=23&nvalue=0&svalue=100" ;; 4) curl -s "http://127.0.0.1:8080/json.htm?type=command¶m=udevice&idx=23&nvalue=0&svalue=80" ;; 3) curl -s "http://127.0.0.1:8080/json.htm?type=command¶m=udevice&idx=23&nvalue=0&svalue=60" ;; 2) curl -s "http://127.0.0.1:8080/json.htm?type=command¶m=udevice&idx=23&nvalue=0&svalue=40" ;; 1) curl -s "http://127.0.0.1:8080/json.htm?type=command¶m=udevice&idx=23&nvalue=0&svalue=20" ;; *) curl -s "http://127.0.0.1:8080/json.htm?type=command¶m=udevice&idx=23&nvalue=0&svalue=0" ;; esac
* * * * * /usr/local/bin/loginternet.sh > /dev/null 2>&1

