diff --git a/fhem/FHEM/00_FBAHA.pm b/fhem/FHEM/00_FBAHA.pm
index 6aa5fb75c..779c733ed 100755
--- a/fhem/FHEM/00_FBAHA.pm
+++ b/fhem/FHEM/00_FBAHA.pm
@@ -328,15 +328,20 @@ FBAHA_Ready($)
Define
- define <name> FBAHA <host>:<port>
+ define <name> FBAHA <device>
+ <device> is either a <host>:<port> combination, where
<host> is normally the address of the FRITZ!Box running the AHA server
- (fritz.box or localhost), and :<port> is 2002.
+ (fritz.box or localhost), and <port> 2002, or
+ UNIX:SEQPACKET:/var/tmp/me_avm_home_external.ctl, the latter only works on
+ the fritz.box. With FRITZ!OS 5.50 the network port is available, on some
+ Labor variants only the UNIX socket is available.
Example:
define fb1 FBAHA fritz.box:2002
+ define fb1 FBAHA UNIX:SEQPACKET:/var/tmp/me_avm_home_external.ctl
@@ -395,15 +400,23 @@ FBAHA_Ready($)
Define
- define <name> FBAHA <host>:<port>
+ define <name> FBAHA <device>
<host> ist normalerweise die Adresse der FRITZ!Box, wo das AHA Server
läuft (fritz.box oder localhost), <port> ist 2002.
+
+ <device> is entweder a eine Kombianation aus <host>:<port>,
+ wobei <host> die Adresse der FRITZ!Box ist (localhost AUF dem
+ FRITZ.BOX) und <port> 2002 ist, oder
+ UNIX:SEQPACKET:/var/tmp/me_avm_home_external.ctl, wobei das nur fuer
+ FHEM@FRITZ!BOX zur Verfügung steht. Mit FRITZ!OS 5.50 steht auch der
+ Netzwerkport zur Verfügung, auf manchen Laborvarianten nur das UNIX socket.
Beispiel:
define fb1 FBAHA fritz.box:2002
+ define fb1 FBAHA UNIX:SEQPACKET:/var/tmp/me_avm_home_external.ctl
diff --git a/fhem/FHEM/DevIo.pm b/fhem/FHEM/DevIo.pm
index 95f756b51..7874e406e 100644
--- a/fhem/FHEM/DevIo.pm
+++ b/fhem/FHEM/DevIo.pm
@@ -108,7 +108,31 @@ DevIo_OpenDev($$$)
Log 3, "Opening $name device $dev"
if(!$reopen);
- if($dev =~ m/^(.+):([0-9]+)$/) { # host:port
+ if($dev =~ m/^UNIX:(SEQPACKET|STREAM):(.*)$/) { # FBAHA
+ my ($type, $fname) = ($1, $2);
+ my $conn;
+ eval {
+ require IO::Socket::UNIX;
+ $conn = IO::Socket::UNIX->new(
+ Type=>($type eq "STREAM" ? SOCK_STREAM:SOCK_SEQPACKET), Peer=>$fname);
+ };
+ if($@) {
+ Log 1, $@;
+ return $@;
+ }
+
+ if(!$conn) {
+ Log(3, "Can't connect to $dev: $!") if(!$reopen);
+ $readyfnlist{"$name.$dev"} = $hash;
+ $hash->{STATE} = "disconnected";
+ return "";
+ }
+ $hash->{TCPDev} = $conn;
+ $hash->{FD} = $conn->fileno();
+ delete($readyfnlist{"$name.$dev"});
+ $selectlist{"$name.$dev"} = $hash;
+
+ } elsif($dev =~ m/^(.+):([0-9]+)$/) { # host:port
# This part is called every time the timeout (5sec) is expired _OR_
# somebody is communicating over another TCP connection. As the connect