Visonic Powermax Powerlink protocol description
Moderators: Rene, Willem4ever
Re: Powerlink protocol description
@tek:
Some progress has been made, but Visonic seem to have made it impossible to detect which PIR had movement ... you only can see that -something- happened. See the Vera Plugin for the specific code changes
Some progress has been made, but Visonic seem to have made it impossible to detect which PIR had movement ... you only can see that -something- happened. See the Vera Plugin for the specific code changes
DomotiGa / Z-Wave / RFXCom / Visonic PowerMaster / Home Assistant / Zigbee2MQTT / DSMR Reader / Toon1 (rooted)
Re: Powerlink protocol description
Visonic reports the zone the motion has been detected in and the zone is assigned to a specific motion sensor.
Rene.
Re: Powerlink protocol description
uAlex73,uAlex73 wrote:Yes, when i finally fired out how the powerlink communication is started, i got it working on the RS232 too
Just send an invalid download request, and the PM30 will ask you to enroll
Could you give more detail on the steps you took to do this? I have a similar setup using a PM30 and would prefer to use perl if possible (I think you said on another thread that you are using perl).
Thanks
D
Re: Powerlink protocol description
Does anyone know what byte 7 does represent when the System State Flag (byte 4) does report a problem.
xx xx b1 b2 b3 b4 b5 b6 b7 b9 b9
0d a5 00 04 00 05 00 00 10 03 04 00 43 f6 0a
Byte 4 contains 0x04 (state flag), meaning Ready (bit 0) & Problem (bit 2)
Byte 7 contains 0x10. Normally this is alway 0x00.
The Powermax+ logs this event (byte 7, 0x10) when I disconnect the telephone line.
As long the telephone line is disconnected, every zone motion contains 0x10 in byte 7. For example motion in zone 14 (byte 5, 0x0e)
0d a5 00 04 00 25 0e 05 10 03 04 00 43 c3 0a
Is there a list known of what byte 7 relates to??
Thanks!
Henk.
xx xx b1 b2 b3 b4 b5 b6 b7 b9 b9
0d a5 00 04 00 05 00 00 10 03 04 00 43 f6 0a
Byte 4 contains 0x04 (state flag), meaning Ready (bit 0) & Problem (bit 2)
Byte 7 contains 0x10. Normally this is alway 0x00.
The Powermax+ logs this event (byte 7, 0x10) when I disconnect the telephone line.
As long the telephone line is disconnected, every zone motion contains 0x10 in byte 7. For example motion in zone 14 (byte 5, 0x0e)
0d a5 00 04 00 25 0e 05 10 03 04 00 43 c3 0a
Is there a list known of what byte 7 relates to??
Thanks!
Henk.
Re: Powerlink protocol description
There are 2 options given to calculate the checksum, the first one is always working.
The following one is NOT:
It should be:
BTW, the following shows the "bug":
Total=1019 - 0x03FB => 0xFFFF - 0x03 - 0xFB => 0xFF01 => 0x01 (OK)
Total=1020 - 0x03FC => 0xFFFF - 0x03 - 0xFC => 0xFF00 => 0x00 (OK)
Total=1021 - 0x03FD => 0xFFFF - 0x03 - 0xFD => 0xFEFF => 0xFF (NOT OK) - Should be: 0xFE
Total=1022 - 0x03FE => 0xFFFF - 0x03 - 0xFE => 0xFEFE => 0xFE (NOT OK) - Should be: 0xFD
Total=1023 - 0x03FF => 0xFFFF - 0x03 - 0xFF => 0xFEFD => 0xFD (NOT OK) - Should be: 0xFC
Total=1024 - 0x0400 => 0xFFFF - 0x04 - 0x00 => 0xFFFB => 0xFB (OK)
The following one is NOT:
Code: Select all
Other way to calculate the checksum:
1. Sum all the payload bytes in a word;
2. Subtract both high and low byte from FFFF;
3. Low byte contains the checksum.
Code: Select all
Other way to calculate the checksum:
1. Sum all the payload bytes in a word;
2. Add high and low byte together into variable total
3. If total is > 255 then substract 255
4. Subtract total from FF;
5. Low byte contains the checksum.
Total=1019 - 0x03FB => 0xFFFF - 0x03 - 0xFB => 0xFF01 => 0x01 (OK)
Total=1020 - 0x03FC => 0xFFFF - 0x03 - 0xFC => 0xFF00 => 0x00 (OK)
Total=1021 - 0x03FD => 0xFFFF - 0x03 - 0xFD => 0xFEFF => 0xFF (NOT OK) - Should be: 0xFE
Total=1022 - 0x03FE => 0xFFFF - 0x03 - 0xFE => 0xFEFE => 0xFE (NOT OK) - Should be: 0xFD
Total=1023 - 0x03FF => 0xFFFF - 0x03 - 0xFF => 0xFEFD => 0xFD (NOT OK) - Should be: 0xFC
Total=1024 - 0x0400 => 0xFFFF - 0x04 - 0x00 => 0xFFFB => 0xFB (OK)
DomotiGa / Z-Wave / RFXCom / Visonic PowerMaster / Home Assistant / Zigbee2MQTT / DSMR Reader / Toon1 (rooted)
-
- Member
- Posts: 66
- Joined: Wed Dec 04, 2013 11:06 am
Re: Powerlink protocol description
Hello
I'm trying to write some basic HomeSeer script to interface with my Powermax PRO via RS232
Somebody has a vb.net example to share with me?
Thank you very much.
Mario
I'm trying to write some basic HomeSeer script to interface with my Powermax PRO via RS232
Somebody has a vb.net example to share with me?
Thank you very much.
Mario
-
- Advanced Member
- Posts: 515
- Joined: Tue May 31, 2011 6:44 pm
- Contact:
Re: Powerlink protocol description
Mario,
Any luck writting the script,I am also quite intrested in this script. especially for HS3 (maybe I can assist in rewriting it for hs3). at this moment I use the hs2 plugin, but this will not be ported to HS3.
regards
bart
Any luck writting the script,I am also quite intrested in this script. especially for HS3 (maybe I can assist in rewriting it for hs3). at this moment I use the hs2 plugin, but this will not be ported to HS3.
regards
bart
Software: HS3, HStouch, Plugwise , BLBackup, BLLatestImage, Zwave, JowiHUE, PHlocation, Netcam, Harmony Plugin, ThinkingCleaner, HSPhone, Eneco Toon Script, Pushover, Visonic Powermax LV Interface
(ON ESXI )on NUC
(ON ESXI )on NUC
-
- Member
- Posts: 66
- Joined: Wed Dec 04, 2013 11:06 am
Re: Powerlink protocol description
Hi Bart
I did some preliminary tests but I'm having some issues with the checksum calculation. I hope a fellow member share a working code.
I did some preliminary tests but I'm having some issues with the checksum calculation. I hope a fellow member share a working code.
Re: Powerlink protocol description
Maybe this is of any use to you (this is what's being used in DomotiGa):
you can find the complete source here: domotiga.nl/projects/domotiga/repositor ... tiGa3/.src
Code: Select all
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Check the CRC of the received data
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub CheckCRC(bData As Byte[]) As Boolean
Dim bChecksum As Byte
Dim bDataTmp As Byte[]
' first copy the bData - else we loose information
bDataTmp = bData.Copy()
' Remove the preamble
bDataTmp.Extract(0, 1)
' Remove the postamble
bDataTmp.Pop()
' Check if Count > 0
If bDataTmp.Count > 0 Then
' Copy and remove the checksum
bChecksum = bDataTmp.Pop()
' Check if calculation and checksum match
If CalculateCRC(bDataTmp) = bChecksum Then Return True
Endif
Return False
End
Re: Powerlink protocol description
@Mario:
If you got issues, maybe you can share some code / examples where it goes wrong?
If you got issues, maybe you can share some code / examples where it goes wrong?
DomotiGa / Z-Wave / RFXCom / Visonic PowerMaster / Home Assistant / Zigbee2MQTT / DSMR Reader / Toon1 (rooted)
Re: Powerlink protocol description
As an alternative this is my perl code to do the checksum ( I am a perl beginner so I am sure it can be improved):uAlex73 wrote:@Mario:
If you got issues, maybe you can share some code / examples where it goes wrong?
Code: Select all
sub CalcChksum {
my $chkstring = shift;
# Read last 4 char which should include x43 checksum indicator
my $chksum = substr($chkstring, -4);
my $chkout = "";
my $base = 0xFFFF;
# Check for checksum character
if(substr($chksum, 0, 2) ne "43"){
# If no checksum return C1 no checksum error
$chkout = "ERR:C1";
return $chkout;
}
else{
# Otherwise calculate checksum
if(substr($chkstring, 0, 2) eq "0d"){
# Strip off carriage return
$chkstring = substr($chkstring, 2, -2);
}
# Get checksum value by removing lead 43
$chksum = substr($chksum, -2);
# Convert ASCII check string back to hex and then convert and calculate in decimal
my @bytes = unpack('C*', pack('H*', $chkstring));
my $chk = 0;
# Split into decimal byte values and sum
foreach my $num (@bytes){
$chk = $chk + $num;
}
# convert decimal check value to hex
my $outhex = sprintf("%04x",$chk);
# Split checksum into hi and lo bytes
my @pairs = $outhex =~ /../sg;
my $hibyte = hex "$pairs[0]";
my $lobyte = hex "$pairs[1]";
# Perform checksum calculation (FFFF - hibyte - lobyte) and return lo byte of result
my $chkcalc = substr(sprintf("%04x",$base - $hibyte - $lobyte), -2);
# If checksum OK set checksum code to OK
if($chkcalc eq $chksum){
$chkout = "OK";
}
else{
# If lobyte = FF hibyte appears to be used
# so check hibyte or return C2 checksum calculation error
$chkcalc = substr(sprintf("%04x",$base - $hibyte - $lobyte), 0, 2);
if($chkcalc eq $chksum){
$chkout = "OK";
}
else{
$chkout = "ERR:C2";
}
}
return $chkout;
}
}
# End of sub CalcChksum
Dad
Re: Powerlink protocol description
I'm looking into purchasing an alarm system and want to use the sensor information in Homeseer to activate other events. I know this is possible with the PowerMax and RFXCom. The PowerMaster seems to be a more modern unit with new technology but without the option to use RFXCom, due to the PowerG technology.uAlex73 wrote:@nlrb:
I am trying to get my PowerMaster 30 work as as i want. I manage to get the status update from the PM30 (after i send a message). How can i get "near" real-time sensor updates from the PM30 as you have build into the Vera package?
None of those messages are send out on the serial on this moment?
Is there a way through the Powerlink protocol that makes in possible to use the sensor information (or any other way)?
HS3, Z-Wave Network, CommandFusion GUI
Re: Powerlink protocol description
I have the PowerMaster 30 (UK) here and I am getting the motion sensor events now (you need to enable "always on" on the motion sensor first) via the serial. It isn't realtime, like the PowerMax. I get them once a minute. I initially had some timing issues in the code i am using, which sometimes drop the packet (and an invalid checksum calculation ;-().
If you want to be 100% safe, then possible the PowerMax + RFXCom option is the way to go. For PowerMaster there will be never a device like RFXCom as you correctly mentioned.
For support of your PowerMax/Master, you need to write the code yourself or use supporting software like HomeSeer/DomotiGa/Vera.
If you want to be 100% safe, then possible the PowerMax + RFXCom option is the way to go. For PowerMaster there will be never a device like RFXCom as you correctly mentioned.
For support of your PowerMax/Master, you need to write the code yourself or use supporting software like HomeSeer/DomotiGa/Vera.
DomotiGa / Z-Wave / RFXCom / Visonic PowerMaster / Home Assistant / Zigbee2MQTT / DSMR Reader / Toon1 (rooted)
Re: Powerlink protocol description
@uAlex: Thanks for the PM, I cannot reply yet as I have not posted enough. Yes my code works - Initially it was failing when the lobyte evaluated to FF, by trial and error I found that if that is the case the checksum appears to be the hibyte instead. Since then all the messages received have calculated correctly.
Dad
Dad
Re: Powerlink protocol description
Can I ask you why you choose the PowerMaster over the PowerMax? Was this because of the newer technology or are there any other reasons that make up for the downside of not being able to get the sensor information directly? The possibilities of communicating through Powerlink or RFXCom seem a big plus for the PowerMax.uAlex73 wrote:I have the PowerMaster 30 (UK) here and I am getting the motion sensor events now (you need to enable "always on" on the motion sensor first) via the serial. It isn't realtime, like the PowerMax. I get them once a minute. I initially had some timing issues in the code i am using, which sometimes drop the packet (and an invalid checksum calculation ;-().
If you want to be 100% safe, then possible the PowerMax + RFXCom option is the way to go. For PowerMaster there will be never a device like RFXCom as you correctly mentioned.
For support of your PowerMax/Master, you need to write the code yourself or use supporting software like HomeSeer/DomotiGa/Vera.
Last edited by Romac on Thu Jan 09, 2014 11:48 pm, edited 1 time in total.
HS3, Z-Wave Network, CommandFusion GUI