From 33672bd88dbb826951f777d87385149a6e85f59b Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 31 Dec 2011 13:31:58 +0000 Subject: [PATCH] Config-file changes git-svn-id: https://svn.fhem.de/fhem/trunk@1159 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/92_FileLog.pm | 2 +- fhem/Makefile | 2 +- fhem/contrib/FB7390/startfhem | 12 ++++++++++++ fhem/docs/commandref.html | 1 + fhem/examples/sample_pgm2 | 6 ++++-- fhem/fhem.pl | 14 ++++++++++++++ 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/92_FileLog.pm b/fhem/FHEM/92_FileLog.pm index ca0de21ab..0d00457b4 100755 --- a/fhem/FHEM/92_FileLog.pm +++ b/fhem/FHEM/92_FileLog.pm @@ -154,7 +154,7 @@ FileLog_Set($@) # - delta-h / delta-d to get rain/h and rain/d values from continuous data. # # It will set the %data values -# min, max, avg, cnt, lastd, lastv, sum +# min, max, avg, cnt, currdate, currval, sum # for each requested column, beggining with = 1 sub diff --git a/fhem/Makefile b/fhem/Makefile index c1ee0db91..b65e5373b 100644 --- a/fhem/Makefile +++ b/fhem/Makefile @@ -14,7 +14,7 @@ RMANDIR=$(ROOT)$(MANDIR) RETCDIR=$(ROOT)$(ETCDIR) VERS=5.2 -DATE=2011-12-29 +DATE=2011-12-31 DESTDIR=fhem-$(VERS) all: diff --git a/fhem/contrib/FB7390/startfhem b/fhem/contrib/FB7390/startfhem index 61f9fe2bb..84e6ec4ba 100755 --- a/fhem/contrib/FB7390/startfhem +++ b/fhem/contrib/FB7390/startfhem @@ -6,6 +6,7 @@ cd $home trap "" SIGHUP modprobe cdc_acm +modprobe ftdi_sio sleep 2 ln -sf $home/FHEM/fhemcmd.sh /var/fhemcmd @@ -16,4 +17,15 @@ export PATH export LD_LIBRARY_PATH=$home/lib export PERL5LIB=$home/lib/perl5/site_perl/5.12.2/mips-linux:$home/lib/perl5/site_perl/5.12.2:$home/lib/perl5/5.12.2/mips-linux:$home/lib/perl5/5.12.2 +# let FHEM run as user boxusr80 +# add user fhem with uid of boxusr80 +id fhem > /dev/null 2>&1 +if [ "$?" -ne "0" ]; then + echo "user fhem does not exist. Adding it." + echo "fhem:any:1080:0:fhem:/home-not-used:/bin/sh" >>/var/tmp/passwd + # set files ownership + chown -R boxusr80 ${home}/log + chown -R boxusr80 ${home}/FHEM +fi + perl fhem.pl fhem.cfg diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html index 6ac0cd987..2e957ed66 100644 --- a/fhem/docs/commandref.html +++ b/fhem/docs/commandref.html @@ -8160,6 +8160,7 @@ isday { OldValue("wz") }
{ time_str2num(OldTimestamp("wz")) }
{ ReadingsVal("wz", "measured-temp", "20")+0 }
+ { ReadingsTimestamp("wz", "measured-temp", 0)}
{ AttrVal("wz", "room", "none") }
diff --git a/fhem/examples/sample_pgm2 b/fhem/examples/sample_pgm2 index 4dbc629b4..2eee04d85 100644 --- a/fhem/examples/sample_pgm2 +++ b/fhem/examples/sample_pgm2 @@ -24,10 +24,12 @@ attr autocreate device_room %TYPE attr autocreate filelog /tmp/%NAME-%Y.log attr autocreate weblink attr autocreate weblink_room Plots +# Disable this to avoid looking for new USB devices on startup +define initialUsbCheck notify global:INITIALIZED usb create -# You probably have to enable some of the following lines. -# Verify first that /dev/xxx ist correct. +# If the above notify did not helped, then you probably have to enable some of +# the following lines. Verify first that /dev/xxx ist correct. #define FHZ FHZ /dev/USB0 #define CUL CUL /dev/ttyACM0@9600 1234 diff --git a/fhem/fhem.pl b/fhem/fhem.pl index b1ea080de..6e3e03eee 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -2480,6 +2480,20 @@ ReadingsVal($$$) return $default; } +sub +ReadingsTimestamp($$$) +{ + my ($d,$n,$default) = @_; + if(defined($defs{$d}) && + defined($defs{$d}{READINGS}) && + defined($defs{$d}{READINGS}{$n}) && + defined($defs{$d}{READINGS}{$n}{TIME})) { + return $defs{$d}{READINGS}{$n}{TIME}; + } + return $default; +} + + sub Value($) {