From b58456e69f3bbf64c4c02d2c9c1aa6a6fd9fc4ab Mon Sep 17 00:00:00 2001 From: mgehre <> Date: Wed, 13 Feb 2013 23:35:10 +0000 Subject: [PATCH] MAX: Parse WallThermostatState/Control messages git-svn-id: https://svn.fhem.de/fhem/trunk@2723 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_MAX.pm | 14 +++++++------- fhem/FHEM/14_CUL_MAX.pm | 2 +- fhem/FHEM/MaxCommon.pm | 4 +++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/fhem/FHEM/10_MAX.pm b/fhem/FHEM/10_MAX.pm index d709dc5a7..9ae3af3c9 100755 --- a/fhem/FHEM/10_MAX.pm +++ b/fhem/FHEM/10_MAX.pm @@ -357,7 +357,7 @@ MAX_Set($@) my $arg1 = (($arg2&0x100)>>1) | (int(2*$args[1])&0x7F); $arg2 &= 0xFF; #only take the lower 8 bits - return ($hash->{IODev}{Send})->($hash->{IODev},"WallThermostatState",$dest, + return ($hash->{IODev}{Send})->($hash->{IODev},"WallThermostatControl",$dest, sprintf("%02x%02x",$arg1,$arg2),"04",undef,undef,$hash->{addr}); } else { return "fake does not work for device type $hash->{type}"; @@ -498,7 +498,7 @@ MAX_Parse($$) $devicetype = $args[0] if($msgtype eq "define"); $devicetype = "ShutterContact" if($msgtype eq "ShutterContactState"); $devicetype = "Cube" if($msgtype eq "CubeClockState" or $msgtype eq "CubeConnectionState"); - $devicetype = "WallMountedThermostat" if($msgtype ~~ ["WallThermostatConfig","WallThermostatState"]); + $devicetype = "WallMountedThermostat" if($msgtype ~~ ["WallThermostatConfig","WallThermostatState","WallThermostatControl"]); $devicetype = "HeatingThermostat" if($msgtype ~~ ["HeatingThermostatConfig", "ThermostatState"]); if($devicetype) { return "UNDEFINED MAX_$addr MAX $devicetype $addr"; @@ -567,12 +567,12 @@ MAX_Parse($$) readingsBulkUpdate($shash, "temperature", sprintf("%2.1f",$measuredTemperature)); } - }elsif($msgtype eq "WallThermostatState"){ + }elsif($msgtype ~~ ["WallThermostatState", "WallThermostatControl" ]){ my ($bits2,$displayActualTemperature,$desiredTemperature,$null1,$heaterTemperature,$null2,$temperature); - if( length($args[0]) == 4 ) { + if( length($args[0]) == 4 ) { #WallThermostatControl #This is the message that WallMountedThermostats send to paired HeatingThermostats ($desiredTemperature,$temperature) = unpack("CC",pack("H*",$args[0])); - } elsif( length($args[0]) == 6 or length($args[0]) == 14 or length($args[0]) == 12) { + } elsif( length($args[0]) == 6 or length($args[0]) == 14 or length($args[0]) == 12) { #WallThermostatState #len=14: This is the message we get from the Cube over MAXLAN and which is probably send by WallMountedThermostats to the Cube #len=12: Payload of an Ack message, last field "temperature" is missing #len=6 : Payload of an Ack message, last four fields (especially $heaterTemperature and $temperature) are missing @@ -593,7 +593,7 @@ MAX_Parse($$) readingsBulkUpdate($shash, "battery", $batterylow ? "low" : "ok"); readingsBulkUpdate($shash, "displayActualTemperature", ($displayActualTemperature) ? 1 : 0); } else { - Log 2, "Invalid WallThermostatState packet" + Log 2, "Invalid $msgtype packet" } $desiredTemperature = ($desiredTemperature &0x7F)/2.0; #convert to degree celcius @@ -803,7 +803,7 @@ MAX_Parse($$)
  • fake <device> <parameters...>
    Sends a fake state message of this device over the air to <device>. Works only with CUL_MAX as IODev. For ShutterContacts, sends a ShutterContactState message; <parameters...> must be 0 or 1 for "window closed" or "window opened". For WallMountedThermostats. - sends a WallThermostatState message; <parameters...> must be "$desiredTemperature $measuredTemperature" (both may have one digit after the decimal point, for desiredTemperature it may only by 0 or 5). Make sure you associate the target device with the source device beforehand.
  • + sends a WallThermostatControl message; <parameters...> must be "$desiredTemperature $measuredTemperature" (both may have one digit after the decimal point, for desiredTemperature it may only by 0 or 5). Make sure you associate the target device with the source device beforehand.
  • weekProfile [<day> <temp1>,<until1>,<temp2>,<until2>] [<day> <temp1>,<until1>,<temp2>,<until2>] ...
    Allows setting the week profile. For devices of type HeatingThermostat or WallMountedThermostat only. Example:
    set MAX_12345 weekProfile Fri 24.5,6:00,12,15:00,5 Sat 7,4:30,19,12:55,6
    diff --git a/fhem/FHEM/14_CUL_MAX.pm b/fhem/FHEM/14_CUL_MAX.pm index ea84b8b64..616098c68 100644 --- a/fhem/FHEM/14_CUL_MAX.pm +++ b/fhem/FHEM/14_CUL_MAX.pm @@ -230,7 +230,7 @@ CUL_MAX_Parse($$) } #Todo: CUL_MAX_SendTimeInformation($shash, $src); on Ack for our PairPong } - } elsif($msgType ~~ ["ShutterContactState", "WallThermostatState", "ThermostatState", "PushButtonState"]) { + } elsif($msgType ~~ ["ShutterContactState", "WallThermostatState", "WallThermostatControl", "ThermostatState", "PushButtonState"]) { Dispatch($shash, "MAX,$isToMe,$msgType,$src,$payload", {RAWMSG => $rmsg}); } else { Log $ll5, "Unhandled message $msgType"; diff --git a/fhem/FHEM/MaxCommon.pm b/fhem/FHEM/MaxCommon.pm index 333f9fe78..08fed8dcf 100644 --- a/fhem/FHEM/MaxCommon.pm +++ b/fhem/FHEM/MaxCommon.pm @@ -36,7 +36,7 @@ require Exporter; "30" => "ShutterContactState", "40" => "SetTemperature", #to thermostat - "42" => "WallThermostatState", #by WallMountedThermostat + "42" => "WallThermostatControl", #by WallMountedThermostat #Sending this without payload to thermostat sets desiredTempeerature to the comfort/eco temperature #We don't use it, we just do SetTemperature "43" => "SetComfortTemperature", @@ -46,6 +46,8 @@ require Exporter; "60" => "ThermostatState", #by HeatingThermostat + "70" => "WallThermostatState", + "82" => "SetDisplayActualTemperature", "F1" => "WakeUp",