From 4257ca2fba0bd85ca065e5f3a3ebaaebd987ab21 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 5 Nov 2011 08:59:29 +0000 Subject: [PATCH] SVN-Transfer corrections git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@1090 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- CHANGED | 1 + FHEM/00_TCM.pm | 3 +- FHEM/10_CUL_HM.pm | 80 +++++++++++++++++++++++++------------------ FHEM/10_EnOcean.pm | 63 +++++++++++++++++++++++++++++++--- FHEM/99_updatefhem.pm | 4 +-- Makefile | 11 +++--- README.CVS | 65 ----------------------------------- contrib/fhemupdate.pl | 6 ++-- docs/commandref.html | 4 +-- docs/fhem.html | 10 +++--- 10 files changed, 125 insertions(+), 122 deletions(-) delete mode 100644 README.CVS diff --git a/CHANGED b/CHANGED index 9d0555206..8ca05a6a2 100644 --- a/CHANGED +++ b/CHANGED @@ -13,6 +13,7 @@ - buxgfix: prevent fhem from stalling if telnet times out in 66_ECMD.pm - feature: FHEMWEB longpoll mode, small fixes, tuned smallscreen mode - feature: average module added + - change: moved the berliOS CVS repository to a sourceforge SVN repository - 2011-07-08 (5.1) - feature: smallscreen optimizations for iPhone diff --git a/FHEM/00_TCM.pm b/FHEM/00_TCM.pm index 5bacb79db..6f49b4ee3 100755 --- a/FHEM/00_TCM.pm +++ b/FHEM/00_TCM.pm @@ -101,7 +101,7 @@ TCM_Write($$$) } else { # 310 / ESP3 - if(!$fn) { # Radio Paket from the EnOcean Module + if(!$fn) { # "Old-Type" Radio Packet $msg =~ m/^6B05(..)000000(........)(..)$/; $fn = "00070701"; $msg = "F6$1$2${3}03FFFFFFFFFF00"; @@ -232,6 +232,7 @@ TCM_Read($) } else { # TCM310 / ESP3 if($data =~ m/^55(....)(..)(..)(..)/) { my ($l1, $l2, $t, $crc) = (hex($1), hex($2), $3, $4); + my $tlen = 2*(7+$l1+$l2); if(length($data) < $tlen) { $hash->{PARTIAL} = $data; diff --git a/FHEM/10_CUL_HM.pm b/FHEM/10_CUL_HM.pm index 19d6ca7f1..2a204f315 100755 --- a/FHEM/10_CUL_HM.pm +++ b/FHEM/10_CUL_HM.pm @@ -215,7 +215,7 @@ CUL_HM_Parse($$) return ""; } - CUL_HM_DumpProtocol("CUL_HM RCV", $iohash, @msgarr); + CUL_HM_DumpProtocol("RCV", $iohash, @msgarr); # Generate an UNKNOWN event with a better name if(!$shash) { @@ -253,16 +253,15 @@ CUL_HM_Parse($$) if($lcm eq "1A8400" || $lcm eq "1A8000") { #### Pairing-Request if($shash->{cmdStack}) { - CUL_HM_SendCmd($shash, "++A112$id$src", 1, 1); - } else { - push @event, CUL_HM_Pair($name, $shash, @msgarr); - } + CUL_HM_SendCmd($shash, "++A112$id$src", 1, 1); + } else { + push @event, CUL_HM_Pair($name, $shash, @msgarr); + } } elsif($cmd =~ m/^A0[01]{2}$/ && $dst eq $id) {#### Pairing-Request-Convers. CUL_HM_SendCmd($shash, $msgcnt."8002".$id.$src."00", 1, 0); # Ack push @event, ""; - } elsif($model eq "KS550" || $model eq "HM-WDS100-C6-O") { ############ if($cmd eq "8670" && $p =~ m/^(....)(..)(....)(....)(..)(..)(..)/) { @@ -304,11 +303,20 @@ CUL_HM_Parse($$) $t = ($t & 0x3fff)/10; $t = sprintf("%0.1f", $t-1638.4) if($tsgn); push @event, "state:T: $t H: $h"; + push @event, "measured-temp:$t"; push @event, "temperature:$t"; push @event, "humidity:$h"; # If we have something to tell: - CUL_HM_SendCmd($shash, "++A112$id$src", 1, 1) if($shash->{cmdStack}); + my $sdt = $shash->{SET_DESIRED_TEMP}; # DOES NOT WORK + if($sdt) { + CUL_HM_SendCmd($shash, + sprintf("++A011%s%s0201${sdt}0000", $id,$dst), 1, 1); + delete($shash->{SET_DESIRED_TEMP}); + + } else { + CUL_HM_SendCmd($shash, "++A112$id$src", 1, 1) if($shash->{cmdStack}); + } } if($cmd eq "A258" && $p =~ m/^(..)(..)/) { @@ -329,7 +337,7 @@ CUL_HM_Parse($$) # slot 01. if($cmd eq "A410" && $p =~ m/^0403(......)(..)(..)(..)(..)(....)/) { my ( $tdev, $tchan, $plist, $o1, $v1, $rest) = - (($1), hex($2), hex($3), ($4), hex($5), ($6)); + (($1), hex($2), hex($3), ($4), hex($5), ($6)); my $msg; if($plist == 5) { if($o1 eq "05") { @@ -363,13 +371,13 @@ CUL_HM_Parse($$) if($idx % 4 == 0 && $dayidx < $maxdays) { $idx -= 48*$dayidx; $idx /= 2; - my $day = $days[$dayidx+$dayoff]; - $shash->{TEMPLIST}{$day}{$idx}{HOUR} = int($v1/6); - $shash->{TEMPLIST}{$day}{$idx}{MINUTE} = ($v1 - int($v1/6)*6)*10; - $shash->{TEMPLIST}{$day}{$idx}{TEMP} = $v2/2; - $shash->{TEMPLIST}{$day}{$idx+1}{HOUR} = int($v3/6); - $shash->{TEMPLIST}{$day}{$idx+1}{MINUTE} = ($v3 - int($v3/6)*6)*10; - $shash->{TEMPLIST}{$day}{$idx+1}{TEMP} = $v4/2; + my $ptr = $shash->{TEMPLIST}{$days[$dayidx+$dayoff]}; + $ptr->{$idx}{HOUR} = int($v1/6); + $ptr->{$idx}{MINUTE} = ($v1 - int($v1/6)*6)*10; + $ptr->{$idx}{TEMP} = $v2/2; + $ptr->{$idx+1}{HOUR} = int($v3/6); + $ptr->{$idx+1}{MINUTE} = ($v3 - int($v3/6)*6)*10; + $ptr->{$idx+1}{TEMP} = $v4/2; } } @@ -377,21 +385,17 @@ CUL_HM_Parse($$) my $twentyfour = 0; my $msg = sprintf("tempList%s:", $wd); foreach(my $idx=0; $idx<24; $idx+=1) { - if(defined ($shash->{TEMPLIST}{$wd}{$idx}{TEMP}) && - $shash->{TEMPLIST}{$wd}{$idx}{TEMP} ne "") { + my $ptr = $shash->{TEMPLIST}{$wd}{$idx}; + if(defined ($ptr->{TEMP}) && $ptr->{TEMP} ne "") { if($twentyfour == 0) { $msg .= sprintf(" %02d:%02d %.1f", - $shash->{TEMPLIST}{$wd}{$idx}{HOUR}, - $shash->{TEMPLIST}{$wd}{$idx}{MINUTE}, - $shash->{TEMPLIST}{$wd}{$idx}{TEMP}); + $ptr->{HOUR}, $ptr->{MINUTE}, $ptr->{TEMP}); } else { - $shash->{TEMPLIST}{$wd}{$idx}{HOUR} = ""; - $shash->{TEMPLIST}{$wd}{$idx}{MINUTE} = ""; - $shash->{TEMPLIST}{$wd}{$idx}{TEMP} = ""; + $ptr->{HOUR} = $ptr->{MINUTE} = $ptr->{TEMP} = ""; + } } - if(defined ($shash->{TEMPLIST}{$wd}{$idx}{HOUR}) && - 0+$shash->{TEMPLIST}{$wd}{$idx}{HOUR} == 24) { + if(defined ($ptr->{HOUR}) && 0+$ptr->{HOUR} == 24) { $twentyfour = 1; # next value uninteresting, only first counts. } } @@ -416,7 +420,8 @@ CUL_HM_Parse($$) } elsif($model eq "HM-CC-VD") { ################### # CMD:8202 SRC:13F251 DST:15B50D 010100002A - if($cmd eq "8202" && $p =~ m/^(..)(..)(..)(..)/) { # status ACK to controlling HM-CC-TC + # status ACK to controlling HM-CC-TC + if($cmd eq "8202" && $p =~ m/^(..)(..)(..)(..)/) { my ( $vp, $d1) = (hex($3), $4); $vp = int($vp)/2; # valve position in % @@ -738,9 +743,10 @@ my %culHmSubTypeSets = ( ); my %culHmModelSets = ( "HM-CC-TC"=> - { "day-temp" => "temp", - "night-temp" => "temp", - "party-temp" => "temp", + { "day-temp" => "temp", + "night-temp" => "temp", + "party-temp" => "temp", + #"desired-temp" => "temp", # does not work "tempListSat"=> "HH:MM temp ...", "tempListSun"=> "HH:MM temp ...", "tempListMon"=> "HH:MM temp ...", @@ -880,12 +886,18 @@ CUL_HM_Set($@) CUL_HM_pushConfig($hash, $id, $dst, $bn, 1, $l1); return "Set your remote in learning mode to transmit the data"; - } elsif($cmd =~ m/^(day|night|party)-temp$/) { ############################### + } elsif($cmd =~ m/^desired-temp$/) { ################## my $temp = CUL_HM_convTemp($a[2]); return $temp if(length($temp) > 2); - CUL_HM_pushConfig($hash, $id, $dst, 2, 5, - $st eq "day-temp" ? "03$temp" : - $st eq "night-temp" ? "04$temp" : "06$temp"); + $hash->{SET_DESIRED_TEMP} = $temp; + return; + + } elsif($cmd =~ m/^(day|night|party)-temp$/) { ################## + my %tt = (day=>"03", night=>"04", party=>"06"); + my $tt = $tt{$1}; + my $temp = CUL_HM_convTemp($a[2]); + return $temp if(length($temp) > 2); + CUL_HM_pushConfig($hash, $id, $dst, 2, 5, "$tt$temp"); # List 5 return; } elsif($cmd =~ m/^tempList(...)/) { ################################## @@ -1144,7 +1156,7 @@ CUL_HM_SendCmd($$$$) } } $cmd =~ m/As(..)(..)(....)(......)(......)(.*)/; - CUL_HM_DumpProtocol("CUL_HM SND", $io, ($1,$2,$3,$4,$5,$6)); + CUL_HM_DumpProtocol("SND", $io, ($1,$2,$3,$4,$5,$6)); } ################################### diff --git a/FHEM/10_EnOcean.pm b/FHEM/10_EnOcean.pm index 1cb61ad9d..7b7e373b5 100755 --- a/FHEM/10_EnOcean.pm +++ b/FHEM/10_EnOcean.pm @@ -65,7 +65,8 @@ EnOcean_Initialize($) $hash->{SetFn} = "EnOcean_Set"; $hash->{AttrList} = "IODev do_not_notify:1,0 ignore:0,1 " . "showtime:1,0 loglevel:0,1,2,3,4,5,6 model " . - "subType:switch,contact,sensor,windowHandle,SR04,MD15"; + "subType:switch,contact,sensor,windowHandle,SR04,MD15 ". + "actualTemp"; for(my $i=0; $i<@ptm200btn;$i++) { $ptm200btn{$ptm200btn[$i]} = "$i:30"; @@ -105,11 +106,42 @@ EnOcean_Set($@) my $ll2 = GetLogLevel($name, 2); shift @a; + my $tn = TimeNow(); + for(my $i = 0; $i < @a; $i++) { my $cmd = $a[$i]; + ##################### + # See also http://www.oscat.de/community/index.php/topic,985.30.html if($st eq "MD15") { + my %sets = ( + "desired-temp" => "\\d+\\.\\d+", + "actuator" => "\\d+", + "unattended" => "", + ); + my $re = $sets{$a[0]}; + return "Unknown argument $cmd, choose one of ".join(" ", sort keys %sets) + if(!defined($re)); + return "Need a parameter" if($re && @a < 2); + return "Argument $a[1] is incorrect (expect $re)" + if($re && $a[1] !~ m/^$re$/); + $hash->{CMD} = $cmd; + $hash->{READINGS}{CMD}{TIME} = $tn; + $hash->{READINGS}{CMD}{VAL} = $cmd; + + my $arg = 1; + if($re) { + $hash->{READINGS}{CMD_ARG}{TIME} = $tn; + $hash->{READINGS}{CMD_ARG}{VAL} = $a[1]; + $arg = $a[1]; + shift(@a); + } + + $hash->{READINGS}{$cmd}{TIME} = $tn; + $hash->{READINGS}{$cmd}{VAL} = $arg; + + ########################### } else { # Simulate a PTM my ($c1,$c2) = split(",", $cmd, 2); return "Unknown argument $cmd, choose one of " . @@ -129,11 +161,9 @@ EnOcean_Set($@) } - select(undef, undef, undef, 0.1) if($i < int(@a)-1); } - my $tn = TimeNow(); my $cmd = join(" ", @a); $hash->{CHANGED}[0] = $cmd; $hash->{STATE} = $cmd; @@ -148,6 +178,11 @@ EnOcean_Parse($$) { my ($iohash, $msg) = @_; my (undef,$rorg,$data,$id,$status,$odata) = split(":", $msg); + #Log 1, "RORG: $rorg"; + #Log 1, "DATA: $data"; + #Log 1, "ID: $id"; + #Log 1, "STATUS: $status"; + #Log 1, "ODATA: $odata"; my $rorgname = $rorgname{$rorg}; if(!$rorgname) { @@ -280,7 +315,27 @@ EnOcean_Parse($$) push @event, "3:tempSensor:" . (($db_2 & 0x04) ? "failed" : "ok"); push @event, "3:window:" . (($db_2 & 0x02) ? "open" : "closed"); push @event, "3:actuator:" . (($db_2 & 0x01) ? "ok" : "obstructed"); - push @event, "3:temperature:" . sprintf "%.1f", ($db_1*40/255); + push @event, "3:measured-temp:". sprintf "%.1f", ($db_1*40/255); + + my $cmd = ReadingsVal($name, "CMD", undef); + if($cmd) { + my $msg; + my $arg1 = ReadingsVal($name, "CMD_ARG", 20); + + if($cmd eq "actuator") { + $msg = sprintf("%02X000000", $arg1); + + } elsif($cmd eq "desired-temp") { + $msg = sprintf("%02X%02X0400", $arg1*255/40, + AttrVal($name, "actualTemp", ($db_1*40/255)) * 255/40); + + } + select(undef, undef, undef, 0.1); + IOWrite($hash, "000A0701", + sprintf("A5%s%s0001%sFF00",$msg,$hash->{DEF},$hash->{DEF})) + if($msg); + } + } else { push @event, "3:state:$db_3"; diff --git a/FHEM/99_updatefhem.pm b/FHEM/99_updatefhem.pm index 3a890228a..057d6a6a5 100644 --- a/FHEM/99_updatefhem.pm +++ b/FHEM/99_updatefhem.pm @@ -17,11 +17,11 @@ sub updatefhem_Initialize($$) { my %fhash = ( Fn=>"CommandUpdatefhem", - Hlp=>",update fhem from the nightly CVS" ); + Hlp=>",update fhem from the nightly SVN" ); $cmds{updatefhem} = \%fhash; my %chash = ( Fn=>"CommandCULflash", - Hlp=>" ,flash the CUL from the nightly CVS" ); + Hlp=>" ,flash the CUL from the nightly SVN" ); $cmds{CULflash} = \%chash; } diff --git a/Makefile b/Makefile index 51c950ce2..ee3517802 100644 --- a/Makefile +++ b/Makefile @@ -54,10 +54,9 @@ install-base: dist: @echo Version is $(VERS), Date is $(DATE) mkdir .f - cp -r CHANGED FHEM HISTORY Makefile README.CVS\ + cp -r CHANGED FHEM HISTORY Makefile README.SVN\ TODO contrib docs examples fhem.pl webfrontend .f - find .f -name CVS -print | xargs rm -rf - find .f -name example.CVS -print | xargs rm -rf + find .f -name .svn -print | xargs rm -rf find .f -name \*.orig -print | xargs rm -f find .f -name .#\* -print | xargs rm -f find .f -type f -print |\ @@ -72,8 +71,10 @@ deb: rm -rf .f make ROOT=`pwd`/.f install cp -r contrib/DEBIAN .f - find .f -name CVS -print | xargs rm -rf - find .f -name example.CVS -print | xargs rm -rf + rm -rf .f/$(MODDIR)/contrib/FB7*/var + rm -rf .f/$(MODDIR)/contrib/FB7*/*.image + rm -rf .f/$(MODDIR)/contrib/FB7*/*.zip + find .f -name .svn -print | xargs rm -rf find .f -name \*.orig -print | xargs rm -f find .f -name .#\* -print | xargs rm -f find .f -type f -print |\ diff --git a/README.CVS b/README.CVS deleted file mode 100644 index dfc1e5b88..000000000 --- a/README.CVS +++ /dev/null @@ -1,65 +0,0 @@ -The source of this project is hosted on Berlios, if you wish you can get -the latest version with the following commands: - cvs -d:pserver:anonymous@cvs.fhem.berlios.de:/cvsroot/fhem login - cvs -z3 -d:pserver:anonymous@cvs.fhem.berlios.de:/cvsroot/fhem co fhem - -If you wish to contribute to the project, then -- create a berlios account -- send an email to the project manager to add you as developer to the project - (right know this is r dot koenig at koeniglich dot de) -- check out the source with - % cvs -z3 -d@cvs.berlios.de:/cvsroot/fhem co fhem -- if it is already checked out, it makes sense to do an update before - implementing your changes: - % cvs update -- make your changes -- test if it is working (Really !!!) -- make an entry in the CHANGED file, giving your changes a "title". -- describe your changes in the file HISTORY, and dont forget to mention your - name and the date of change -- it makes sense to do a "cvs diff" before checking in the stuff with - cvs commit -- if you do complex/nontrivial changes affecting more than one file, then - please tag the whole software before and after the change with: - - before: % cvs tag __0 - - after: % cvs tag __1 - You can increase the counter for bugfixing. Dont forget to mention the - tagname in the HISTORY file. Tagging helps to remove more complex changes or - to merge them in other releases/branches. - - -Some useful CVS commands/flags for the beginner: - - -# Get the newest stuff from the server and merge it into your changes. -# Watch out for lines beginning with C (collisions), edit them immediately -# after check out, and look for ==== -# Without -d new directories won't be checked out -cvs update -d . - -# Before checking in, make sure you changed only what you intended: -cvs diff filename - -# Add new file. "-kb" adds binary files. Forgetting -kb will cause -# problems if somebody is checking out on a different OS (windows) -# Note: it is complicated to rename files in CVS, so think twice about -# filenames before adding them. e.g. do not use version names in them. -cvs add [-kb] filename - -# Look at the change history -cvs log - -# Commit changes. Set the EDITOR environment variable to use your editor. -cvs commit . - -# Check which files were changed. Type ^C when it asks you to really release it. -# (is there a more elegant way?) -cvs release . - -# We recommend to set some options in our ~/.cvsrc file: -cvs -q -update -d -# The 'cvs -q' option will suppress some output e.g. during update -# only the updated and unknown files etc. are displayed (not every -# folder etc.). -# The 'update -d' will automatically create folders as required. diff --git a/contrib/fhemupdate.pl b/contrib/fhemupdate.pl index 28c77c121..1f1d3e151 100755 --- a/contrib/fhemupdate.pl +++ b/contrib/fhemupdate.pl @@ -1,14 +1,14 @@ #!/usr/bin/perl -# Server-Side script to check out the fhem CVS repository, and upload the +# Server-Side script to check out the fhem SVN repository, and upload the # changed files to the server print localtime() . "\n"; chdir("/home/rudi/fhemupdate/fhem"); system("mkdir -p UPLOAD"); -system("cvs update . > /dev/null 2>&1"); -die "CVS failed, exiting\n" if($?); +system("svn update . > /dev/null 2>&1"); +die "SVN failed, exiting\n" if($?); my @filelist = ( "./fhem.pl", diff --git a/docs/commandref.html b/docs/commandref.html index 117bef7df..81f0da41e 100644 --- a/docs/commandref.html +++ b/docs/commandref.html @@ -551,7 +551,7 @@ A line ending with \ will be concatenated with the next one, so long lines
    updatefhem [backup] [filename]

    - Update the fhem modules and documentation from a nightly CVS chekout. For + Update the fhem modules and documentation from a nightly SVN chekout. For this purpose fhem contacts http://fhem.de/fhemupdate, compares the stored timestamps of the local files with the filelist on the server, and downloads the files changed on the server. For all downloaded modules a @@ -590,7 +590,7 @@ A line ending with \ will be concatenated with the next one, so long lines
      CULflash <CUL-Name> <CUL-Version>

      - Download the CUL firmware from a nightly CVS chekout and flash the + Download the CUL firmware from a nightly SVN chekout and flash the hardware. Currently only the CUL is supported with its versions: CUL_V2, CUL_V2_HM, CUL_V3, CUL_V4.
      Note: dfu-programmer has to be installed in the path.
      diff --git a/docs/fhem.html b/docs/fhem.html index 86886f164..09c2dca94 100644 --- a/docs/fhem.html +++ b/docs/fhem.html @@ -77,9 +77,7 @@
      See the CHANGED file for current changes.
      - Nightly CVS version: a - - tarball, or from the fhem commandline via updatefhem.

      @@ -272,9 +270,9 @@