mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-04 05:16:45 +00:00
MAX: Parse WallThermostatState/Control messages
git-svn-id: https://svn.fhem.de/fhem/trunk@2723 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
131d430d95
commit
b58456e69f
@ -357,7 +357,7 @@ MAX_Set($@)
|
|||||||
my $arg1 = (($arg2&0x100)>>1) | (int(2*$args[1])&0x7F);
|
my $arg1 = (($arg2&0x100)>>1) | (int(2*$args[1])&0x7F);
|
||||||
$arg2 &= 0xFF; #only take the lower 8 bits
|
$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});
|
sprintf("%02x%02x",$arg1,$arg2),"04",undef,undef,$hash->{addr});
|
||||||
} else {
|
} else {
|
||||||
return "fake does not work for device type $hash->{type}";
|
return "fake does not work for device type $hash->{type}";
|
||||||
@ -498,7 +498,7 @@ MAX_Parse($$)
|
|||||||
$devicetype = $args[0] if($msgtype eq "define");
|
$devicetype = $args[0] if($msgtype eq "define");
|
||||||
$devicetype = "ShutterContact" if($msgtype eq "ShutterContactState");
|
$devicetype = "ShutterContact" if($msgtype eq "ShutterContactState");
|
||||||
$devicetype = "Cube" if($msgtype eq "CubeClockState" or $msgtype eq "CubeConnectionState");
|
$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"]);
|
$devicetype = "HeatingThermostat" if($msgtype ~~ ["HeatingThermostatConfig", "ThermostatState"]);
|
||||||
if($devicetype) {
|
if($devicetype) {
|
||||||
return "UNDEFINED MAX_$addr MAX $devicetype $addr";
|
return "UNDEFINED MAX_$addr MAX $devicetype $addr";
|
||||||
@ -567,12 +567,12 @@ MAX_Parse($$)
|
|||||||
readingsBulkUpdate($shash, "temperature", sprintf("%2.1f",$measuredTemperature));
|
readingsBulkUpdate($shash, "temperature", sprintf("%2.1f",$measuredTemperature));
|
||||||
}
|
}
|
||||||
|
|
||||||
}elsif($msgtype eq "WallThermostatState"){
|
}elsif($msgtype ~~ ["WallThermostatState", "WallThermostatControl" ]){
|
||||||
my ($bits2,$displayActualTemperature,$desiredTemperature,$null1,$heaterTemperature,$null2,$temperature);
|
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
|
#This is the message that WallMountedThermostats send to paired HeatingThermostats
|
||||||
($desiredTemperature,$temperature) = unpack("CC",pack("H*",$args[0]));
|
($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=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=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
|
#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, "battery", $batterylow ? "low" : "ok");
|
||||||
readingsBulkUpdate($shash, "displayActualTemperature", ($displayActualTemperature) ? 1 : 0);
|
readingsBulkUpdate($shash, "displayActualTemperature", ($displayActualTemperature) ? 1 : 0);
|
||||||
} else {
|
} else {
|
||||||
Log 2, "Invalid WallThermostatState packet"
|
Log 2, "Invalid $msgtype packet"
|
||||||
}
|
}
|
||||||
|
|
||||||
$desiredTemperature = ($desiredTemperature &0x7F)/2.0; #convert to degree celcius
|
$desiredTemperature = ($desiredTemperature &0x7F)/2.0; #convert to degree celcius
|
||||||
@ -803,7 +803,7 @@ MAX_Parse($$)
|
|||||||
<li>fake <device> <parameters...><br>
|
<li>fake <device> <parameters...><br>
|
||||||
Sends a fake state message of this device over the air to <device>. Works only with CUL_MAX as IODev. For ShutterContacts, sends
|
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.
|
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.</li>
|
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.</li>
|
||||||
<li>weekProfile [<day> <temp1>,<until1>,<temp2>,<until2>] [<day> <temp1>,<until1>,<temp2>,<until2>] ...<br>
|
<li>weekProfile [<day> <temp1>,<until1>,<temp2>,<until2>] [<day> <temp1>,<until1>,<temp2>,<until2>] ...<br>
|
||||||
Allows setting the week profile. For devices of type HeatingThermostat or WallMountedThermostat only. Example:<br>
|
Allows setting the week profile. For devices of type HeatingThermostat or WallMountedThermostat only. Example:<br>
|
||||||
<code>set MAX_12345 weekProfile Fri 24.5,6:00,12,15:00,5 Sat 7,4:30,19,12:55,6</code><br>
|
<code>set MAX_12345 weekProfile Fri 24.5,6:00,12,15:00,5 Sat 7,4:30,19,12:55,6</code><br>
|
||||||
|
@ -230,7 +230,7 @@ CUL_MAX_Parse($$)
|
|||||||
}
|
}
|
||||||
#Todo: CUL_MAX_SendTimeInformation($shash, $src); on Ack for our PairPong
|
#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});
|
Dispatch($shash, "MAX,$isToMe,$msgType,$src,$payload", {RAWMSG => $rmsg});
|
||||||
} else {
|
} else {
|
||||||
Log $ll5, "Unhandled message $msgType";
|
Log $ll5, "Unhandled message $msgType";
|
||||||
|
@ -36,7 +36,7 @@ require Exporter;
|
|||||||
"30" => "ShutterContactState",
|
"30" => "ShutterContactState",
|
||||||
|
|
||||||
"40" => "SetTemperature", #to thermostat
|
"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
|
#Sending this without payload to thermostat sets desiredTempeerature to the comfort/eco temperature
|
||||||
#We don't use it, we just do SetTemperature
|
#We don't use it, we just do SetTemperature
|
||||||
"43" => "SetComfortTemperature",
|
"43" => "SetComfortTemperature",
|
||||||
@ -46,6 +46,8 @@ require Exporter;
|
|||||||
|
|
||||||
"60" => "ThermostatState", #by HeatingThermostat
|
"60" => "ThermostatState", #by HeatingThermostat
|
||||||
|
|
||||||
|
"70" => "WallThermostatState",
|
||||||
|
|
||||||
"82" => "SetDisplayActualTemperature",
|
"82" => "SetDisplayActualTemperature",
|
||||||
|
|
||||||
"F1" => "WakeUp",
|
"F1" => "WakeUp",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user