From 188d24b16beb2ec8f42fc3613c8cd2cfb97923fc Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Thu, 9 Feb 2012 08:32:12 +0000 Subject: [PATCH] PM101 by Ignaz git-svn-id: https://svn.fhem.de/fhem/trunk@1245 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/10_EnOcean.pm | 12 +++++++++++- fhem/docs/commandref.html | 7 ++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 2de94cef6..b2a38926b 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -10,6 +10,7 @@ (by datapoint types) (Maz) - feature: NetIO230B module by Andy - feature: Retaining configfile comments (not within a define statement) + - feature: EnOcean PM101 by Ignaz - 2011-12-31 (5.2) - bugfix: applying smallscreen attributes to firefox/opera diff --git a/fhem/FHEM/10_EnOcean.pm b/fhem/FHEM/10_EnOcean.pm index 08dacc511..717b1d14c 100755 --- a/fhem/FHEM/10_EnOcean.pm +++ b/fhem/FHEM/10_EnOcean.pm @@ -66,7 +66,7 @@ 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,PM101,". "dimmer,dimmCtrl actualTemp"; for(my $i=0; $i<@ptm200btn;$i++) { @@ -344,6 +344,16 @@ EnOcean_Parse($$) push @event, "3:measured-temp:". sprintf "%.1f", ($db_1*40/255); EnOcean_MD15Cmd($hash, $name, $db_1); + } elsif($st eq "PM101") { + #################################### + # Ratio Presence Sensor Eagle PM101, code by aicgazi + #################################### + my $lux = sprintf "%3d", $db_2; + # content of $db_2 is the illuminance where max value 0xFF stands for 1000 lx + $lux = sprintf "%04.2f", ( $lux * 1000 / 255 ) ; + push @event, "3:brightness:$lux"; + push @event, "3:channel1:" . ($db_0 & 0x01 ? "off" : "on"); + push @event, "3:channel2:" . ($db_0 & 0x02 ? "off" : "on"); } elsif($st eq "dimmer") { # todo: create a more general solution for the central-command responses diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html index d0c3fe23a..f95f399d4 100644 --- a/fhem/docs/commandref.html +++ b/fhem/docs/commandref.html @@ -3482,7 +3482,12 @@ A line ending with \ will be concatenated with the next one, so long lines
  • actuator: [ok|obstructed]
  • temperature: $tmp - +
  • Ratio Presence Sensor Eagle PM101 (set subType to PM101)
    +