cul
cul copied to clipboard
Pairing with Max! Thermostat
Pairing with Max! Thermostats seems to be unsupported. Is this feature planned?
This is already implemented by @1stsetup - but only the Shutter Contact is successfully tested, the Thermostat "should" work.

I can't test - got no Max devices. Mind that for the "Moritz" Protocol you have to switch the CUL Mode, that means you can't use any other protocols beside Moritz on the same CUL.
case "PairPing":
data.firmware = hex2byte(data.payload.substr(0,2));
data.msgType = hex2byte(data.payload.substr(2,2));
data.testresult = hex2byte(data.payload.substr(4,2));
data.serial = data.payload.substr(6);
message.device = device_types[message.pairPing.type];
seen_devices[message.address] = message.device;
break;
I think there should be a "PairPong" command in response to the PairPing. Looks like there is no logic implemented to pair a device, the shutter contact can work without any pairing. If i can find some time, i will try to implement the pairing 👍
From https://svn.fhem.de/trac/browser/trunk/fhem/FHEM/14_CUL_MAX.pm:
#There are two variants of PairPing:
--
#1. It has a destination address of "000000" and can be paired to any device.
#2. It is sent after changing batteries or repressing the pair button (without factory reset) and has a destination address of the last paired device. We can answer it with PairPong and even get an Ack, but it will still not be paired to us. A factory reset (originating from the last paired device) is needed first.
if(($dst ne "000000") and !$isToMe) {
Log3 $hash,5 , "Device want's to be re-paired to $dst, not to us";
return $shash->{NAME};
}
#If $isToMe is true, this device is already paired and just wants to be reacknowledged
#If we already have the device created but it was reseted (batteries changed?), we directly re-pair (without pairmode)
if($shash->{pairmode} \|\| $isToMe \|\| exists($modules{MAX}{defptr}{$src})) {
Log3 $hash, 3, "CUL_MAX_Parse: " . ($isToMe ? "Re-Pairing" : "Pairing") . " device $src of type $device_types{$type} with serial $serial";
Dispatch($shash, "MAX,$isToMe,define,$src,$device_types{$type},$serial,0", {});
#Set firmware and testresult on device
my $dhash = CUL_MAX_DeviceHash($src);
if(defined($dhash)) {
readingsBeginUpdate($dhash);
readingsBulkUpdate($dhash, "firmware", sprintf("%u.%u",int($firmware/16),$firmware%16));
readingsBulkUpdate($dhash, "testresult", $testresult);
readingsEndUpdate($dhash, 1);
}
#Send after dispatch the define, otherwise Send will create an invalid device
CUL_MAX_Send($shash, "PairPong", $src, "00");
So we need to check if the PairPing is just a re-pair or a brand new pair request and send a PairPong command.
Moin, geht es denn hier noch weiter? Bis jetzt ist der CUL Adapter für mich unbrauchbar im Moritz Modus. Ich empfange zwar die Daten der einzelnen Thermostate, die mit dem Max!cul Adapter gepairt worden sind, aber alles andere wie z.B. pairing ist nicht möglich. Also kann ich auch keine Temperaturänderungen vornehmen. Ich bräuchte ihn, weil er einen CUN Mod besitzt. Das hat der Max!cul Adapter nicht.
So wie es bis jetzt aussieht, muss ich wohl den Umweg über Fhem machen.....
LG Dirk