Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pairing with Max! Thermostat #18

Open
larsmathuseck opened this issue Jun 9, 2018 · 4 comments
Open

Pairing with Max! Thermostat #18

larsmathuseck opened this issue Jun 9, 2018 · 4 comments

Comments

@larsmathuseck
Copy link

Pairing with Max! Thermostats seems to be unsupported. Is this feature planned?

@hobbyquaker
Copy link
Owner

hobbyquaker commented Jun 17, 2018

This is already implemented by @1stsetup - but only the Shutter Contact is successfully tested, the Thermostat "should" work.

bildschirmfoto 2018-06-17 um 03 28 48

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.

@larsmathuseck
Copy link
Author

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 👍

@larsmathuseck
Copy link
Author

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.

@Menne01
Copy link

Menne01 commented Nov 9, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants