OpenHAB

Exported from Notepad++
__ _____ ____ ____ ____ ___ ____ / / / / | / __ ) / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __ | / /_/ / /_/ / __/ / / / __ / ___ |/ /_/ / \____/ .___/\___/_/ /_/_/ /_/_/ |_/_____/ /_/ 2.4.0 Release Build OpenHAB auf Raspberry PI java -version wget -qO – ‘https://bintray.com/user/downloadSubjectPublicKey?username=openhab’ | sudo apt-key add – apt-get install apt-transport-https echo ‘deb https://dl.bintray.com/openhab/apt-repo2 stable main’ | sudo tee /etc/apt/sources.list.d/openhab2.list apt-get update apt-get install openhab2 #Update Java (damit die Widget-Galerie richtig funktioniert) java -version javac -version Download Java ARM 32 BIT https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html tar -xzf jdk-8u211-linux-arm32-vfp-hflt.tar.gz update-alternatives –install /usr/bin/java java /opt/jdk1.8.0_211/bin/java 1 update-alternatives –install /usr/bin/javac javac /opt/jdk1.8.0_211/bin/javac 1 update-alternatives –config java update-alternatives –config javac java -version javac -version #Bei Suse zypper in java-1_8_0-openjdk java -version #mindest. openjdk version “1.8.0_222” #Remove (wenn gewünscht) #update-alternatives –remove “java” “/opt/jdk1.8.0_121/bin/java” #update-alternatives –remove “javac” “/opt/jdk1.8.0_121/bin/javac” #Manuelle Installation###################################### adduser –system –no-create-home –group –disabled-login openhab Bei Suse ” useradd -g nobody -s /bin/false -c “openhab user” openhab” groupadd openhab usermod -a -G openhab chown -R openhab:openhab /opt/openhab2/ wget https://bintray.com/openhab/mvn/download_file?file_path=org%2Fopenhab%2Fdistro%2Fopenhab%2F2.4.0%2Fopenhab-2.4.0.zip mv -v download_file\?file_path\=org%2Fopenhab%2Fdistro%2Fopenhab%2F2.4.0%2Fopenhab-2.4.0.zip openhab-2.4.0.zip mkdir openhab2 cd openhab2 unzip openhab-2.4.0.zip cd .. mv -v openhab2 /opt/ chmod 777 -R /opt/openhab2 #Für Docker das systemd bei Docker deaktiviert ist #sudo su -s /bin/bash -c ‘/opt/openhab2/start.sh’ openhab #systemd file vi /lib/systemd/system/openhab2.service -> #Bei Suse vi /etc/systemd/system/openhab2.service [Unit] Description=The openHAB 2 Home Automation Bus Solution Documentation=http://docs.openhab.org Wants=network-online.target After=network-online.target [Service] Type=simple User=openhab Group=openhab WorkingDirectory=/opt/openhab2 #EnvironmentFile=/etc/default/openhab2 ExecStart=/opt/openhab2/start.sh server ExecStop=/bin/kill -SIGINT $MAINPID Restart=on-failure [Install] WantedBy=multi-user.target systemctl daemon-reload systemctl enable openhab2.service systemctl start openhab2.service export PATH=$PATH:/opt/openhab2/runtime/bin #firefox http://172.17.190.45:8080 Standard Paket auswählen ###################################### #################################### #Config Bsp. anhand eines ausfübahren Sciptes Zuerst via PaperUI das Add on “Exec Binding” installieren. danach vi /opt/openhab2/conf/sitemaps/Zuhause.sitemap -> sitemap Zuhause label=”Hauptmenu” { Frame label=”Gruppen” { Switch item=Power_Plug_Socket_B label=”Power Plug B” } } vi /opt/openhab2/conf/items/433_mhz.items -> Switch Power_Plug_Socket_B <poweroutlet> vi /opt/openhab2/conf/rules/powerplugs.rules -> rule “Poweroutlet B” when Item Power_Plug_Socket_B received command then if (receivedCommand==ON ) { executeCommandLine(“/opt/openhab2/conf/scripts/codesend 1234”) } else if (receivedCommand==OFF ) { executeCommandLine(“/opt/openhab2/conf/scripts/codesend 5678”) } end #################################### Web Oberfläche. Add-Ons -> Transformations -> #Installieren Exec Transfomration JavaScript Trabsformation JSONPath Transformation Map Transformation RegEx Transformation Scale Transformation XPath Transformation XSLT Transformation Add-Ons -> Bindings -> #Installieren Exec Binding HTTP Binding Network Binding Systeminfo Binding TCP & UDP Binding Add-Ons -> Actions -> #Installieren Mail Actions Add-Ons -> User Interfaces -> #Installieren Classic UI CometVisu Backend HABmin HABot Configuration -> System -> Item Linking -> Simple Mode #Konfig Basic####################################################### ##Ausführbares Script mit Rückgabewert im HApanel. PaperUI: Configuration -> Things -> aus Plus drücken -> Exec Binding -> Command Bsp. Name: Temperaturmessung_Wohnzimmer Location: Wohnzimmer Command: /opt/openhab2/conf/scripts/temperaturmessung_wohnzimmer.sh #Am besten ein Script verwenden da zuviele Befehlsverkettungen nicht akzeptiert werden. Transform: REGEX((.*)) Interval: 60 Tim