From: Michael Wagner Date: Thu, 26 Nov 2020 11:02:37 +0000 (+0100) Subject: Merge branch 'master' of http://wagnertech.de/git/xhome X-Git-Tag: verleihnix_0.1-2~1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8d00b092ec8d9b993776937f48a5a88de19cacda;hp=5246653c90e3e0b87a4b8f44ade6300e2e51e057;p=projects.git Merge branch 'master' of wagnertech.de/git/xhome --- diff --git a/Dokumente/.dummy b/Dokumente/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/Dokumente/SWUbersicht.txt b/Dokumente/SWUbersicht.txt new file mode 100644 index 0000000..24b1f0f --- /dev/null +++ b/Dokumente/SWUbersicht.txt @@ -0,0 +1,33 @@ +KNX-SW-Projekte +=============== + +https://github.com/franckmarini/KnxDevice +Adurino + TPUART = KNX-Device + +https://github.com/thelsing/knx +Adurino/Linux KNX Device Stack + +https://github.com/takeshixx/knxmap +Python IP/KNX Busmonitor + +https://github.com/calimero-project/calimero-core +Java KNX-Access + +https://github.com/calimero-project/calimero-server +Java KNX-Server + +https://github.com/mfussenegger/knx +Python i/f to knxd + +https://github.com/open-homeautomation/pknx +Python access to knx via KNX-IP-Interface + +Hardware +======== +www.Freebus.org +Selbstbau-KNX-Devices +- 4-Kanal-Temperatursensor + +https://www.dehof.de/eib/DE/raspi.htm +Einfachere TPUART-Schnittstelle + diff --git a/Griesstatt/99_myUtils.pm b/Griesstatt/99_myUtils.pm new file mode 100644 index 0000000..eb76ed9 --- /dev/null +++ b/Griesstatt/99_myUtils.pm @@ -0,0 +1,48 @@ +############################################## +# $Id: myUtilsTemplate.pm 7570 2015-01-14 18:31:44Z rudolfkoenig $ +# +# Save this file as 99_myUtils.pm, and create your own functions in the new +# file. They are then available in every Perl expression. + +package main; + +use strict; +use warnings; +use POSIX; + +sub +myUtils_Initialize($$) +{ + my ($hash) = @_; +} + +# Enter you functions below _this_ line. + +sub setHeizstatus { + my $heizstatus = shift; + my $force = shift; + + # parameter check + die ("Ungültiger Heizstatus (1 .. 4)") if ($heizstatus < 1 or $heizstatus > 4); + + # status check + my $hstat = Value("KNX_0000001"); + if ($hstat == 4 or $hstat == 1) { + # Frostschutz/Aufheizen + if (!defined($force)) { + die "setHeizstatus nicht ausgeführt, da Frostschutz/Aufheizbetrieb. Setze mit '(F)orce'."; + } + } + fhem("set KNX_0000001 g1 $heizstatus"); + Log(1, "Set Heizstatus to $heizstatus"); + fhem("set KNX_LED1 g1 off"); + fhem("set KNX_LED2 g1 off"); + fhem("set KNX_LED3 g1 off"); + fhem("set KNX_LED4 g1 off"); + + fhem("set KNX_LED1 g1 on") if ($heizstatus == 1); + fhem("set KNX_LED2 g1 on") if ($heizstatus == 2); + fhem("set KNX_LED3 g1 on") if ($heizstatus == 3); + fhem("set KNX_LED4 g1 on") if ($heizstatus == 4); +} +1; diff --git a/Griesstatt/Griesstatt.knxproj b/Griesstatt/Griesstatt.knxproj new file mode 100644 index 0000000..33acc74 Binary files /dev/null and b/Griesstatt/Griesstatt.knxproj differ diff --git a/Griesstatt/fhem.cfg b/Griesstatt/fhem.cfg new file mode 100644 index 0000000..65d7d65 --- /dev/null +++ b/Griesstatt/fhem.cfg @@ -0,0 +1,117 @@ +attr global userattr cmdIcon devStateIcon devStateIcon:textField-long devStateStyle icon sortby webCmd webCmdLabel:textField-long widgetOverride +attr global autoload_undefined_devices 1 +attr global autosave 0 +attr global logfile ./log/fhem-%Y-%m.log +attr global modpath . +attr global motd SecurityCheck:\ + telnetPort is not password protected\ +\ +Protect this FHEM installation by configuring the allowed device allowed_WEB\ +You can disable this message with attr global motd none +attr global statefile ./log/fhem.save +attr global verbose 3 + +define WEB FHEMWEB 8083 global +setuuid WEB 5d07a041-f33f-d703-bb00-f5a252e8b7a1a442 +attr WEB editConfig 1 +define allowed_WEB allowed +setuuid allowed_WEB 5d07a041-f33f-d703-11a1-1b4c3372df08fe0f +attr allowed_WEB basicAuth cmFpbmVyOkZpbmtlbndlZzU= +attr allowed_WEB validFor WEB + +# Fake FileLog entry, to access the fhem log from FHEMWEB +define Logfile FileLog ./log/fhem-%Y-%m.log fakelog +setuuid Logfile 5d07a041-f33f-d703-9c49-a9ebbdff8eb16730 + +define autocreate autocreate +setuuid autocreate 5d07a041-f33f-d703-e88f-8ceeb477d5e04772 +attr autocreate filelog ./log/%NAME-%Y.log + +define eventTypes eventTypes ./log/eventTypes.txt +setuuid eventTypes 5d07a041-f33f-d703-e43c-930c656ddea2cd5a + +# Disable this to avoid looking for new USB devices on startup +define initialUsbCheck notify global:INITIALIZED usb create +setuuid initialUsbCheck 5d07a041-f33f-d703-f259-0751a20adc04fee2 +define RPi GPIO4 BUSMASTER +setuuid RPi 5d07a041-f33f-d703-88e1-d3df5301a9a2810c +define KellerTemp GPIO4 28-00000a54cd2a +setuuid KellerTemp 5d07a041-f33f-d703-1079-da21805d0c596460 +attr KellerTemp model DS18B20 +attr KellerTemp room Temperaturen +attr KellerTemp tempOffset -1.0 +define KNX TUL tul:/dev/ttyACM0@57600 1.1.255 +setuuid KNX 5d07a18b-f33f-d703-97fe-8c0cc64740b9ed0b +define KNX_0000003 KNX 0/0/3:dpt9.001 +setuuid KNX_0000003 5d07a2ce-f33f-d703-92d0-f28f6329df06b1bd +attr KNX_0000003 IODev KNX +attr KNX_0000003 alias WohnzimmerTemp +attr KNX_0000003 room KNX,Temperaturen +define FileLog_KNX_0000003 FileLog ./log/KNX_0000003-%m.%Y.log KNX_0000003 +setuuid FileLog_KNX_0000003 5d07a3fa-f33f-d703-dea3-fe2cadc45a732339 +attr FileLog_KNX_0000003 logtype text +attr FileLog_KNX_0000003 room KNX +define KNX_0000001 KNX 0/0/1:dpt6 +setuuid KNX_0000001 5d07a446-f33f-d703-512c-cdd3a079a055c862 +attr KNX_0000001 IODev KNX +attr KNX_0000001 room KNX +define KNX_0000002 KNX 0/0/2:dpt9 +setuuid KNX_0000002 5d07a44c-f33f-d703-ce64-672cadeabf414018 +attr KNX_0000002 IODev KNX +attr KNX_0000002 room KNX +define FileLog_KNX_0000001 FileLog ./log/KNX_0000001-%Y.log KNX_0000001 +setuuid FileLog_KNX_0000001 5d07a44c-f33f-d703-6fee-cbbab18f34c5eb89 +attr FileLog_KNX_0000001 logtype text +attr FileLog_KNX_0000001 room KNX +define KNX_LED2 KNX 0/1/2:dpt1.001 +setuuid KNX_LED2 5d07b290-f33f-d703-f038-0ddf855521469d08 +attr KNX_LED2 IODev KNX +attr KNX_LED2 room KNX +define KNX_LED3 KNX 0/1/3:dpt1.001 +setuuid KNX_LED3 5d07b298-f33f-d703-5783-d5d6fb7d3b39a5ff +attr KNX_LED3 IODev KNX +attr KNX_LED3 room KNX +define KNX_LED4 KNX 0/1/4:dpt1.001 +setuuid KNX_LED4 5d07b2a2-f33f-d703-7018-de5d38adf8813077 +attr KNX_LED4 IODev KNX +attr KNX_LED4 room KNX +define KNX_LED1 KNX 0/1/1:dpt1.001 +setuuid KNX_LED1 5d07b2c5-f33f-d703-9842-8a48f65177f4c666 +attr KNX_LED1 IODev KNX +attr KNX_LED1 room KNX +define FileLog_KNX_0000002 FileLog ./log/KNX_0000002-%Y.log KNX_0000002 +setuuid FileLog_KNX_0000002 5d07b42b-f33f-d703-fcc1-a4ef9876715dea5f +attr FileLog_KNX_0000002 logtype text +attr FileLog_KNX_0000002 room KNX +define KNX_0000002_notify_1 notify KNX_0000001:getG1:..* \ +\ +{ \ +my $heizstatus = $EVTPART1;;\ +Log 1, "processing $heizstatus";;\ +fhem("set KNX_LED1 g1 off");;\ +Log 1, "LED1 off";;\ +fhem("set KNX_LED2 g1 off");;\ +Log 1, "LED2 off";;\ +fhem("set KNX_LED3 g1 off");;\ +Log 1, "LED3 off";;\ +fhem("set KNX_LED4 g1 off");;\ +Log 1, "LED4 off";;\ +\ +fhem("set KNX_LED1 g1 on") if ($heizstatus == 1);;\ +fhem("set KNX_LED2 g1 on") if ($heizstatus == 2);;\ +fhem("set KNX_LED3 g1 on") if ($heizstatus == 3);;\ +fhem("set KNX_LED4 g1 on") if ($heizstatus == 4);;\ +Log 1, "LED set";;\ +}\ + +setuuid KNX_0000002_notify_1 5d07f609-f33f-d703-d7ab-35661dde8ebe4b02 +define KNX_0003188 KNX 0/3/188:MODEL_NOT_DEFINED +setuuid KNX_0003188 5d08b7d7-f33f-d703-97e6-db5c03954880ba87 +attr KNX_0003188 IODev KNX +attr KNX_0003188 room KNX +define FileLog_KNX_0003188 FileLog ./log/KNX_0003188-%Y.log KNX_0003188 +setuuid FileLog_KNX_0003188 5d08b7d7-f33f-d703-edc8-4501566baeec6d7c +attr FileLog_KNX_0003188 logtype text +attr FileLog_KNX_0003188 room KNX +define telnetPort telnet 7072 global +setuuid telnetPort 5df68b4a-f33f-d703-4f7b-cb3742bcd8220943 diff --git a/TestXfhem/.dummy b/TestXfhem/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/TestXfhem/FitnessePages/.dummy b/TestXfhem/FitnessePages/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/TestXfhem/FitnessePages/AaaPrepare/.dummy b/TestXfhem/FitnessePages/AaaPrepare/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/TestXfhem/FitnessePages/AaaPrepare/content.txt b/TestXfhem/FitnessePages/AaaPrepare/content.txt new file mode 100644 index 0000000..b75ee2f --- /dev/null +++ b/TestXfhem/FitnessePages/AaaPrepare/content.txt @@ -0,0 +1,8 @@ +Sysal-Stub installieren + +!|test.util.CallScript| +|call script|sudo bin/install-sysal-stub| + +Anmerkung: Falls eine komplett neue Installation des sysal-stub erzwungen werden soll: +sudo rm /etc/apache2/sites-available/sysal_stub.conf +ausführen. diff --git a/TestXfhem/FitnessePages/AaaPrepare/properties.xml b/TestXfhem/FitnessePages/AaaPrepare/properties.xml new file mode 100644 index 0000000..3e87512 --- /dev/null +++ b/TestXfhem/FitnessePages/AaaPrepare/properties.xml @@ -0,0 +1,12 @@ + + + true + true + true + true + true + true + + true + true + diff --git a/TestXfhem/FitnessePages/TestWatchdog/.dummy b/TestXfhem/FitnessePages/TestWatchdog/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/TestXfhem/FitnessePages/TestWatchdog/content.txt b/TestXfhem/FitnessePages/TestWatchdog/content.txt new file mode 100644 index 0000000..8b3a0b9 --- /dev/null +++ b/TestXfhem/FitnessePages/TestWatchdog/content.txt @@ -0,0 +1,20 @@ +Install Watchdog + +!|test.util.CallScript| +|call script|xfhem define watchdog localhost| + +Entferne Sysal-Stub-Output +|call script|!-sudo rm /var/test/sysal-stub.out || true -!| + +Verkürze Zeit +|call script|/opt/fhem/fhem.pl 7072 "modify watchdog +*00:00:05"| + +Warte Auslösezeit +|call script|sleep 6| + +Prüfe Watchdog +|call script|grep rwd /var/test/sysal-stub.out| + +Entferne Watchdog +|call script|xfhem delete watchdog| + diff --git a/TestXfhem/FitnessePages/TestWatchdog/properties.xml b/TestXfhem/FitnessePages/TestWatchdog/properties.xml new file mode 100644 index 0000000..e13fdf4 --- /dev/null +++ b/TestXfhem/FitnessePages/TestWatchdog/properties.xml @@ -0,0 +1,12 @@ + + + true + true + true + true + true + true + true + true + true + diff --git a/TestXfhem/FitnessePages/content.txt b/TestXfhem/FitnessePages/content.txt new file mode 100644 index 0000000..5f3d863 --- /dev/null +++ b/TestXfhem/FitnessePages/content.txt @@ -0,0 +1,2 @@ +#!contents -R2 -g -p -f -h +!contents diff --git a/TestXfhem/FitnessePages/properties.xml b/TestXfhem/FitnessePages/properties.xml new file mode 100644 index 0000000..3096ff6 --- /dev/null +++ b/TestXfhem/FitnessePages/properties.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/TestXfhem/bin/.dummy b/TestXfhem/bin/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/TestXfhem/bin/install-sysal-stub b/TestXfhem/bin/install-sysal-stub new file mode 100755 index 0000000..0121c38 --- /dev/null +++ b/TestXfhem/bin/install-sysal-stub @@ -0,0 +1,27 @@ +#!/bin/bash +set -e + +# test if apache-conf already installed +if [ -e /etc/apache2/sites-enabled/sysal_stub.conf ] +then + exit +fi + +mkdir -p /var/test +chmod 777 /var/test + +cwd=$(pwd) +# write apache conf +echo "# Apache conf for sysal stub +Alias /sysal/rest/AlarmInterface/RemoteWatchdog $cwd/bin/sysal-stub.pl + + Require all granted + Options +ExecCGI + AddHandler cgi-script .pl + +" > /etc/apache2/sites-available/sysal_stub.conf +a2ensite sysal_stub +a2enmod cgi + +systemctl restart apache2 + diff --git a/TestXfhem/bin/sysal-stub.pl b/TestXfhem/bin/sysal-stub.pl new file mode 100755 index 0000000..03f6b95 --- /dev/null +++ b/TestXfhem/bin/sysal-stub.pl @@ -0,0 +1,14 @@ +#!/usr/bin/perl -w + +print "Content-type: text/html\n\n"; +print "\n"; + + +open (OUT, ">/var/test/sysal-stub.out"); +while (my $line = ) { + print OUT "$line\n"; + print "$line\n"; +} + +print "\n"; + diff --git a/Vindelicia/fhem.cfg b/Vindelicia/fhem.cfg new file mode 100644 index 0000000..688ea23 --- /dev/null +++ b/Vindelicia/fhem.cfg @@ -0,0 +1,109 @@ +attr global userattr cmdIcon devStateIcon devStateStyle icon sortby webCmd webCmdLabel:textField-long widgetOverride +attr global autoload_undefined_devices 1 +attr global logfile ./log/fhem-%Y-%m.log +attr global modpath . +attr global motd none +attr global statefile ./log/fhem.save +attr global updateInBackground 1 +attr global verbose 3 + +define telnetPort telnet 7072 global + +define WEB FHEMWEB 8083 global +attr WEB icon it_i-net + +define WEBphone FHEMWEB 8084 global +attr WEBphone stylesheetPrefix smallscreen + +define WEBtablet FHEMWEB 8085 global +attr WEBtablet stylesheetPrefix touchpad + +# Fake FileLog entry, to access the fhem log from FHEMWEB +define Logfile FileLog ./log/fhem-%Y-%m.log fakelog + +define autocreate autocreate +attr autocreate filelog ./log/%NAME-%Y.log + +define eventTypes eventTypes ./log/eventTypes.txt + +# Disable this to avoid looking for new USB devices on startup +define initialUsbCheck notify global:INITIALIZED usb create +define hmUART HMUARTLGW /dev/ttyAMA0 +attr hmUART hmId 651487 +attr hmUART room CUL_HM +define HM.Saal.Wandthermostat CUL_HM 633FF9 +attr HM.Saal.Wandthermostat IODev hmUART +attr HM.Saal.Wandthermostat actCycle 000:10 +attr HM.Saal.Wandthermostat actStatus alive +attr HM.Saal.Wandthermostat autoReadReg 4_reqStatus +attr HM.Saal.Wandthermostat expert 3_allReg+raw +attr HM.Saal.Wandthermostat firmware 1.3 +attr HM.Saal.Wandthermostat model HM-TC-IT-WM-W-EU +attr HM.Saal.Wandthermostat msgRepeat 1 +attr HM.Saal.Wandthermostat room Heizung,CUL_HM +attr HM.Saal.Wandthermostat serialNr OEQ1675256 +attr HM.Saal.Wandthermostat subType thermostat +attr HM.Saal.Wandthermostat webCmd getConfig:clear msgEvents +define FileLog_HM.Saal.Wandthermostat FileLog ./log/HM.Saal.Wandthermostat-%Y.%m.log HM.Saal.Wandthermostat +attr FileLog_HM.Saal.Wandthermostat logtype text +attr FileLog_HM.Saal.Wandthermostat room Logfiles +define HM.Saal.Wandthermostat_Weather CUL_HM 633FF901 +attr HM.Saal.Wandthermostat_Weather model HM-TC-IT-WM-W-EU +attr HM.Saal.Wandthermostat_Weather peerIDs 00000000, +define HM.Saal.Wandthermostat_Climate CUL_HM 633FF902 +attr HM.Saal.Wandthermostat_Climate model HM-TC-IT-WM-W-EU +attr HM.Saal.Wandthermostat_Climate peerIDs 00000000, +attr HM.Saal.Wandthermostat_Climate room Heizung +define HM.Saal.Wandthermostat_WindowRec CUL_HM 633FF903 +attr HM.Saal.Wandthermostat_WindowRec model HM-TC-IT-WM-W-EU +attr HM.Saal.Wandthermostat_WindowRec peerIDs 00000000, +attr HM.Saal.Wandthermostat_WindowRec stateFormat last:trigLast +define HM.Saal.Wandthermostat_remote CUL_HM 633FF906 +attr HM.Saal.Wandthermostat_remote model HM-TC-IT-WM-W-EU +attr HM.Saal.Wandthermostat_remote peerIDs 00000000, +define HM.Saal.Wandthermostat_SwitchTr CUL_HM 633FF907 +attr HM.Saal.Wandthermostat_SwitchTr model HM-TC-IT-WM-W-EU +attr HM.Saal.Wandthermostat_SwitchTr peerIDs 00000000, +define ActionDetector CUL_HM 000000 +attr ActionDetector event-on-change-reading .* +attr ActionDetector model ActionDetector +define EIB TUL tul:/dev/ttyACM0@57600 1.1.255 +attr EIB room KNX +define HzTimer at *03:59 set HM.Saal.Wandthermostat_Climate controlMode auto +attr HzTimer room Timer,Heizung +attr HzTimer webCmd active:inactive +define SetSollTemp KNX 1/1/0:dpt9.001 +attr SetSollTemp IODev EIB +attr SetSollTemp room Heizung,KNX +define SetIstTemp KNX 1/1/1:dpt9.001 +attr SetIstTemp IODev EIB +attr SetIstTemp room Heizung,KNX +define TimerIst at +*00:01:00 set SetIstTemp value [HM.Saal.Wandthermostat:measured-temp] +attr TimerIst room Heizung,Timer +attr TimerIst webCmd active:inactive +define HeizActor FileLog ./log/HeizActor-%Y.%m.log SetIstTemp:.*|SetSollTemp:.* +attr HeizActor room Logfiles +define TempSollSetter notify HM.Saal.Wandthermostat set SetSollTemp value [HM.Saal.Wandthermostat:desired-temp] +attr TempSollSetter room Heizung,Timer +define BewegungsmelderWC KNX 1/0/1:dpt1.001 +attr BewegungsmelderWC IODev EIB +attr BewegungsmelderWC room KNX +define FileLog_BewegungsmelderWC FileLog ./log/BewegungsmelderWC-%Y.%m.log BewegungsmelderWC +attr FileLog_BewegungsmelderWC logtype text +attr FileLog_BewegungsmelderWC room KNX,Logfiles +define KNX_0100002 KNX 1/0/2:MODEL_NOT_DEFINED +attr KNX_0100002 IODev EIB +attr KNX_0100002 room KNX +define allowed_WEB allowed +attr allowed_WEB basicAuth aGF1c3ZlcndhbHRlcjp2aW5kZWxpY2lhKg== +attr allowed_WEB validFor WEB,WEBphone,WEBtablet,telnetPort +define KNX_1112017 KNX 11/12/17:MODEL_NOT_DEFINED +attr KNX_1112017 IODev EIB +attr KNX_1112017 room KNX +define FileLog_KNX_1112017 FileLog ./log/KNX_1112017-%Y.log KNX_1112017 +attr FileLog_KNX_1112017 logtype text +attr FileLog_KNX_1112017 room KNX +define FileLog_KNX_0100002 FileLog ./log/KNX_0100002-%Y.log KNX_0100002 +attr FileLog_KNX_0100002 logtype text +attr FileLog_KNX_0100002 room KNX + diff --git a/debian/.dummy b/debian/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/debian/xfhem.changelog b/debian/xfhem.changelog new file mode 100644 index 0000000..79596f6 --- /dev/null +++ b/debian/xfhem.changelog @@ -0,0 +1,3 @@ +smart-home (0.1-%BUILD%) unstable; urgency=medium + * WagnerTech utilities for FHEM + -- Michael Wagner Fri, 12 Apr 2019 10:00:00 +0100 diff --git a/debian/xfhem.control b/debian/xfhem.control new file mode 100644 index 0000000..6d1e5ff --- /dev/null +++ b/debian/xfhem.control @@ -0,0 +1,11 @@ +Source: smart-home +Section: main +Priority: optional +Maintainer: Michael Wagner +Build-Depends: git,build-essential + +Package: xfhem +Architecture: all +Depends: fhem,sysal-util +Description: WagnerTech utilities for FHEM + diff --git a/debian/xfhem.cp b/debian/xfhem.cp new file mode 100755 index 0000000..edc0ccb --- /dev/null +++ b/debian/xfhem.cp @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +mkdir -p $1/usr/bin/ +cp xfhem/bin/xfhem $1/usr/bin/ + +mkdir -p $1/opt/fhem/ +cp xfhem/etc/wagnertech.cfg $1/opt/fhem/ + + diff --git a/debian/xfhem.postinst b/debian/xfhem.postinst new file mode 100755 index 0000000..66f4298 --- /dev/null +++ b/debian/xfhem.postinst @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +chown fhem:dialout /opt/fhem/wagnertech.cfg + +if ! grep wagnertech.cfg /opt/fhem/fhem.cfg >/dev/null +then + echo >> /opt/fhem/fhem.cfg + echo "# include from xfhem package" >> /opt/fhem/fhem.cfg + echo "include wagnertech.cfg" >> /opt/fhem/fhem.cfg + systemctl restart fhem +fi + diff --git a/xfhem/.dummy b/xfhem/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/xfhem/bin/.dummy b/xfhem/bin/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/xfhem/bin/xfhem b/xfhem/bin/xfhem new file mode 100755 index 0000000..a1e6ad1 --- /dev/null +++ b/xfhem/bin/xfhem @@ -0,0 +1,51 @@ +#!/bin/bash + +usage="xfhem [define|delete] watchdog [SERVER]" + +PATH="/opt/fhem:$PATH" + +function process_watchdog { + server=$1 + case $operation in + define) + if [ -z "$server" ] + then + echo "SERVER required for define operation" + echo $usage + exit 1 + fi + fhem.pl 7072 "define watchdog at +*00:10:00 \"/usr/share/sysal/bin/triggerWatchdog_REST http://$server/sysal/rest rwd-$hostname $hostname\"" + ;; + delete) + fhem.pl 7072 "delete watchdog" + ;; + *) + echo "invalid operation $operation" + echo $usage + exit 1 + ;; + esac +} + +if [ $# -lt 2 ] +then + echo $usage + exit 1 +fi + +operation=$1 +object=$2 + +hostname=$(hostname) + +case $2 in +watchdog) + process_watchdog $3 + ;; +*) + echo "invalid object $2" + echo $usage + exit 1 + ;; +esac + diff --git a/xfhem/etc/.dummy b/xfhem/etc/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/xfhem/etc/wagnertech.cfg b/xfhem/etc/wagnertech.cfg new file mode 100644 index 0000000..386aab0 --- /dev/null +++ b/xfhem/etc/wagnertech.cfg @@ -0,0 +1,2 @@ +define telnetPort telnet 7072 +