diff --git a/CHANGED b/CHANGED index 830f9180f..b3468b86c 100644 --- a/CHANGED +++ b/CHANGED @@ -5,7 +5,8 @@ - feature: eventMap enhanced - bugfix: enabled logging for 59_Weather.pm (Boris) - feature: .gplot files renamed from type to content - - bugifix: FS20 on-for-timer error reporting only in the logfile + - bugfix: FS20 on-for-timer error reporting only in the logfile + - bugfix: FHEM2FHEM should work with CUL again, after syntax change - 2011-07-08 (5.1) - feature: smallscreen optimizations for iPhone diff --git a/FHEM/93_FHEM2FHEM.pm b/FHEM/93_FHEM2FHEM.pm index 80d49479d..4e15e9b33 100755 --- a/FHEM/93_FHEM2FHEM.pm +++ b/FHEM/93_FHEM2FHEM.pm @@ -39,9 +39,9 @@ FHEM2FHEM_Define($$) my ($hash, $def) = @_; my @a = split("[ \t][ \t]*", $def); - if(@a != 4 || !($a[3] =~ m/^(LOG|RAW)(:.*)$/)) { - my $msg = - "wrong syntax: define FHEM2FHEM host[:port] [LOG:regexp|RAW:device]"; + if(@a != 4 || !($a[3] =~ m/^(LOG|RAW):(.*)$/)) { + my $msg = "wrong syntax: define FHEM2FHEM host[:port] ". + "[LOG:regexp|RAW:device]"; Log 2, $msg; return $msg; } @@ -49,11 +49,16 @@ FHEM2FHEM_Define($$) $hash->{informType} = $1; if($1 eq "LOG") { $hash->{regexp} = $2; - $hash->{regexp} =~ s/^://; + } else { - $hash->{remoteDevice} = $2; - $hash->{remoteDevice} =~ s/^://; - $hash->{regexpClients} = ".*"; + my $rdev = $2; + my $iodev = $defs{$rdev}; + return "Undefined local device $rdev" if(!$iodev); + $hash->{rawDevice} = $rdev; + $hash->{Clients} = $iodev->{Clients}; + $hash->{Clients} = $modules{$iodev->{TYPE}}{Clients} + if(!$hash->{Clients}); + } my $dev = $a[2]; @@ -88,7 +93,7 @@ FHEM2FHEM_Write($$) return if(!$conn); # Hopefuly it is reported elsewhere $hash->{TCPDev2} = $conn; } - my $rdev = $hash->{remoteDevice}; + my $rdev = $hash->{rawDevice}; syswrite($hash->{TCPDev2}, "iowrite $rdev $fn $msg\n"); } @@ -143,12 +148,10 @@ FHEM2FHEM_Read($) } else { # RAW my ($type, $rname, $msg) = split(" ", $rmsg, 3); - next if($rname ne $hash->{remoteDevice}); - LoadModule($type); - my %fake; - $fake{NAME} = $name; - $fake{TYPE} = $type; - Dispatch(\%fake, $msg, undef); + my $rdev = $hash->{rawDevice}; + next if($rname ne $rdev); + Dispatch($defs{$rdev}, $msg, undef); + } } $hash->{PARTIAL} = $data; diff --git a/docs/commandref.html b/docs/commandref.html index 9498f8ecf..c078e4f40 100644 --- a/docs/commandref.html +++ b/docs/commandref.html @@ -1,6 +1,7 @@ - + - + fhem reference @@ -15,13 +16,14 @@ div#dist { padding-top:0.3em; } a { color: #278727; } +
- + fhem-logo

fhem.pl reference

@@ -97,7 +99,7 @@ FHZ   FS20   HMS   - HMLAN   IPWE   KM271   KS300   @@ -370,7 +372,7 @@ A line ending with \ will be concatenated with the next one, so long lines
@@ -1169,7 +1171,7 @@ A line ending with \ will be concatenated with the next one, so long lines
  • model (fhz1000,fhz1300)

  • -
  • fhtsoftbuffer
    +
  • fhtsoftbuffer
    As the FHZ command buffer for FHT devices is limited (see fhtbuf), and commands are only sent to the FHT device every 120 seconds, the hardware buffer may overflow and FHT commands get lost. @@ -1495,14 +1497,14 @@ A line ending with \ will be concatenated with the next one, so long lines commands in one message at once to the FHT if you specify them all as arguments to the same set command, see the example above.

    -
  • time sets hour and minute to local time

  • +
  • time sets hour and minute to local time

  • -
  • date sets year, month and date to local time

  • +
  • date sets year, month and date to local time

  • -
  • refreshvalues is an alias for report1 255 report2 255

  • +
  • refreshvalues is an alias for report1 255 report2 255

  • All *-temp values need a temperature - as argument, which will be rounded to 0.5 Celsius.
    + as argument, which will be rounded to 0.5 Celsius.
    Temperature values must between 5.5 and 30.5 Celsius. Value 5.5 sets the actuator to OFF, value 30.5 set the actuator to ON

  • @@ -1576,7 +1578,7 @@ A line ending with \ will be concatenated with the next one, so long lines

  • lowtemp-offset needs a temperature as argument, valid - values must be between 1.0 and 5.0 Celsius.
    It will trigger a + values must be between 1.0 and 5.0 Celsius.
    It will trigger a warning if desired-temp - measured-temp > lowtemp-offset in a room for at least 1.5 hours after the last desired-temp change.

    @@ -1592,7 +1594,7 @@ A line ending with \ will be concatenated with the next one, so long lines

  • If a buffer is still in the softbuffer, it will be sent in the - following order:
    desired-temp,mode,report1,report2, + following order:
    desired-temp,mode,report1,report2, holiday1,holiday2,day-temp,night-temp, [all other commands]

    @@ -1623,7 +1625,7 @@ A line ending with \ will be concatenated with the next one, so long lines
  • eventMap

  • -
  • retrycount
    +
  • retrycount
    If the fhtsoftbuffer attribute is set, then resend commands retrycount times if after 240 seconds no confirmation message is received from the corresponding FHT @@ -1631,7 +1633,7 @@ A line ending with \ will be concatenated with the next one, so long lines Default is 3.

  • -
  • minfhtbuffer
    +
  • minfhtbuffer
    FHEM won't send commands to the FHZ if its fhtbuffer is below this value, default is 0. If this value is low, then the ordering of fht commands (see the note in the FHT section of set) @@ -1641,7 +1643,7 @@ A line ending with \ will be concatenated with the next one, so long lines

  • -
  • lazy
    +
  • lazy
    If the lazy attribute is set, FHEM won't send commands to the FHT if the current reading and the value to be set are already identical. This may help avoiding conflicts with the max-1%-time-on-air rule in large @@ -1649,7 +1651,7 @@ A line ending with \ will be concatenated with the next one, so long lines

  • -
  • tmpcorr
    +
  • tmpcorr
    Correct the temperature reported by the FHT by the value specified. Note: only the measured-temp value reported by fhem (used for logging) will be modified. @@ -5998,8 +6000,16 @@ Readings and STATE of temperature/humidity sensors are compatible with the CUL_W fhem device devicename, just like if it would be attached to the local fhem. Drawback: only devices using the Dispatch function (CUL, FHZ, CM11, - SISPM, RFXCOM) generate raw messages. + SISPM, RFXCOM, TCM, TUL) generate raw messages.
    + devicename must exist on the local + fhem server too with the same name and same type as the remote device, but + usually with the device-node "none", so it is only a dummy device. All + necessary attributes (e.g. rfmode if the remote CUL + is in HomeMatic mode) must also be set for the local device. + +
  • +
    Examples:
      define ds1 FHEM2FHEM 192.168.0.1:7072 LOG:.*
      @@ -6058,20 +6068,20 @@ Readings and STATE of temperature/humidity sensors are compatible with the CUL_W Attributes
        -
      • webname
        +
      • webname
        Path after the http://hostname:port/ specification. Defaults to fhem, i.e the default http address is http://localhost:8083/fhem

      • -
      • refresh
        +
      • refresh
        If set, a http-equiv="refresh" entry will be genererated with the given argument (i.e. the browser will reload the page after the given seconds).

      • -
      • plotmode
        +
      • plotmode
        Specifies how to generate the plots:
        • gnuplot
          @@ -6101,7 +6111,7 @@ Readings and STATE of temperature/humidity sensors are compatible with the CUL_W

        • -
        • plotsize
          +
        • plotsize
          the default size of the plot, in pixels, separated by comma: width,height. You can set individual sizes by setting the plotsize of the weblink. Default is 800,160 for desktop, and 480,160 for @@ -6109,8 +6119,8 @@ Readings and STATE of temperature/humidity sensors are compatible with the CUL_W

        • -
        • fixedrange
          - Can be applied to weblink devices (FHEMWEB).
          +
        • fixedrange
          + Can be applied to weblink devices (FHEMWEB).
          Contains two time specs in the form YYYY-MM-DD separated by a space. In plotmode gnuplot-scroll or SVG the given time-range will be used, and no scrolling for this weblinks will be possible. Needed e.g. for @@ -6123,7 +6133,7 @@ Readings and STATE of temperature/humidity sensors are compatible with the CUL_W -
        • smallscreen, touchpad
          +
        • smallscreen, touchpad
          Optimize for small screen size (i.e. smartphones) or for touchpad devices (i.e. tablets)
          Note: The default configuration installed with make install-pgm2 @@ -7068,7 +7078,7 @@ isday Attributes
            -
          • plotmode
            +
          • plotmode
            Specifies how to generate the plots:
            • gnuplot
              @@ -7087,32 +7097,32 @@ isday

            • -
            • plotsize
              +
            • plotsize
              the default size of the plot, in pixels, separated by comma: width,height. You can set individual sizes by setting the plotsize of the weblink.

            • -
            • status
              +
            • status
              Reflects the status, if the renderer timer has been set to ON or OFF. By reading the status, you can detect, if the timer is running, or not.

            • -
            • refresh
              +
            • refresh
              This defines the time-interval in which a new rendering of the defined WebLinks will be done.

            • -
            • tmpfile
              +
            • tmpfile
              This gives the path and a possible prefix for the rendered - filenames.
              You can specify a path to which the files will be + filenames.
              You can specify a path to which the files will be rendered. If you also specify a prefix, this will be used to build the resulting filename.

            • -
            • multiprocess
              - This defines if the Renderer works in a multiprocessing mode.
              +
            • multiprocess
              + This defines if the Renderer works in a multiprocessing mode.
              You can set multiprocessing either to on / off and the renderer will draw the time-scheduled tasks either in multiprocessing mode, or not. NOTE: Direct GET calls, except for a general GET (for all weblinks) will be renderer diff --git a/fhem.pl b/fhem.pl index ddbc76ed5..712de98cc 100755 --- a/fhem.pl +++ b/fhem.pl @@ -167,7 +167,7 @@ my $nextat; # Time when next timer will be triggered. my $intAtCnt=0; my %duplicate; # Pool of received msg for multi-fhz/cul setups my $duplidx=0; # helper for the above pool -my $cvsid = '$Id: fhem.pl,v 1.149 2011-07-30 13:22:25 rudolfkoenig Exp $'; +my $cvsid = '$Id: fhem.pl,v 1.150 2011-08-16 18:06:38 rudolfkoenig Exp $'; my $namedef = "where is either:\n" . "- a single device name\n" . @@ -1222,12 +1222,8 @@ AssignIoPort($) my $cl = $defs{$p}{Clients}; $cl = $modules{$defs{$p}{TYPE}}{Clients} if(!$cl); - my $re = $defs{$p}{regexpClients}; - $re = $modules{$defs{$p}{TYPE}}{regexpClients} if(!$re); - - if(((defined($cl) && $cl =~ m/:$hash->{TYPE}:/) || - (defined($re) && $hash->{TYPE} =~ m/$re/)) && - $defs{$p}{NAME} ne $hash->{NAME}) { # e.g. RFR + if((defined($cl) && $cl =~ m/:$hash->{TYPE}:/) && + $defs{$p}{NAME} ne $hash->{NAME}) { # e.g. RFR $hash->{IODev} = $defs{$p}; last; } @@ -2271,14 +2267,13 @@ Dispatch($$$) my @found; - my $cl = $hash->{Clients}; $cl = $iohash->{Clients} if(!$cl); - my $re = $iohash->{regexpClients}; $re = $iohash->{regexpClients} if(!$re); + my $cl = $hash->{Clients}; + $cl = $iohash->{Clients} if(!$cl); foreach my $m (sort { $modules{$a}{ORDER} cmp $modules{$b}{ORDER} } grep {defined($modules{$_}{ORDER})} keys %modules) { - next if(!(defined($cl) && $cl =~ m/:$m:/) || - (defined($re) && $m =~ m/$re/)); + next if(!(defined($cl) && $cl =~ m/:$m:/)); # Module is not loaded or the message is not for this module next if(!$modules{$m}{Match} || $dmsg !~ m/$modules{$m}{Match}/i);