Visonic Powermax and Powermaster Component

I suggest that we get it working from the Windows PC first. The last time you ran test.py it gave a load of Access Denied errors when it tries to download the EPROM. I assume that it’s because of the download code being different to the visonic default of “5650”.

So, in test.py go from this (approx line 31)

pyvisonic.setConfig("ForceStandard", False)

and add a line, to this

pyvisonic.setConfig("ForceStandard", False)
pyvisonic.setConfig("DownloadCode", "5650")

That is, insert a new line and add the line to set the download code. Please change the 5650 to your download code that you used in the Visonic PRP when it worked and try running test.py again from your Windows PC command line… and then please upload the output. If the output gets too long you may need to use PasteBin.

EDIT: Oh yeah, forgot to mention, keep going with what Rob is also suggesting as this would be really useful to know what the interaction is between your panel and the Visonic PRP.

Ok, Just to be clear, I’m only trying the PC to Panel conection.
I have changed the Download Code in my panel to 5650, was able to connect to it using the PRP App and to download the EPROM data.

Here is the Output:

python3 test.py -usb COM5
0:00:00 < 3389>     INFO   Setting key OverrideCode to value -1
0:00:00.001034 < 3389>     INFO   Setting key ForceStandard to value False
0:00:00.001034 < 3389>     INFO   Setting key DownloadCode to value 5650
DEBUG:asyncio:Using proactor: IocpProactor
0:00:00.824196 < 1034>     INFO   [Connection] Connected to local Protocol handler and Transport Layer
0:00:00.825184 < 1618>     INFO   [Start_Download] Starting download mode
C:\Users\david\OneDrive\Desktop\Hassio\Visonic\pyvisonic.py:1538: RuntimeWarning: coroutine 'wait_for' was never awaited
  asyncio.wait_for(t, None)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
0:00:00.843172 < 1592>    DEBUG   [pmSendPdu] Resetting expected response counter, it got to 0   Response list before 0  after 1
C:\Users\david\OneDrive\Desktop\Hassio\Visonic\pyvisonic.py:1598: RuntimeWarning: coroutine 'wait_for' was never awaited
  asyncio.wait_for(t, None)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
0:00:00.844170 < 1529>    DEBUG   [pmSendPdu] Sending Command (Start Download Mode)    raw data 0d 24 00 00 56 50 00 00 00 00 00 00 35 0a    waiting for message response ['0X3C']
0:00:00.866709 < 1278>    DEBUG   [data receiver] received data: 0d 02 fd 0a
0:00:00.866709 < 2344>    DEBUG   [handle_msgtype02] Ack Received  data =
0:00:00.881061 < 1278>    DEBUG   [data receiver] received data: 0d 22 fd 0a 01 16 15 00 0d 00 00 00 9c 0a
0:00:00.881501 < 1334>  WARNING   [data receiver] Warning : Construction of incoming packet unknown - Message Type 0X22
0:00:00.881501 < 1455>     INFO   [validatePDU] Not valid packet, CRC failed, may be ongoing and not final 0A
0:00:00.882507 < 1398>    DEBUG   [data receiver] Building PDU: Length is now 4 bytes (apparently PDU not complete)    0d 22 fd 0a     checksum calcs dd
0:00:00.882507 < 1354>  WARNING   [data receiver] Unhandled message 0x22
0:00:00.883497 < 1418>    DEBUG   [Sending ack] PowerlinkMode=False    Is PM Ack Reqd=False    This is an Ack for message=0X0
C:\Users\david\OneDrive\Desktop\Hassio\Visonic\pyvisonic.py:1431: RuntimeWarning: coroutine 'wait_for' was never awaited
  asyncio.wait_for(t, None)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
0:00:00.991127 < 1529>    DEBUG   [pmSendPdu] Sending Command (Ack)    raw data 0d 02 fd 0a    waiting for message response ['0X3C']
0:00:20.215584 < 1278>    DEBUG   [data receiver] received data: 0d 06 f9 0a
0:00:20.216260 < 2357>     INFO   [handle_msgtype06] Timeout Received  data
0:00:20.221252 < 1529>    DEBUG   [pmSendPdu] Sending Command (Stop)    raw data 0d 0b f4 0a    waiting for message response []
0:00:20.221252 < 1531>    DEBUG   [pmSendPdu]          Command has a wait time after transmission 1.5
0:00:20.230596 < 1278>    DEBUG   [data receiver] received data: 0d 02 fd
0:00:20.247059 < 1278>    DEBUG   [data receiver] received data: 0a 0d 08 f7 0a
0:00:20.247473 < 2344>    DEBUG   [handle_msgtype02] Ack Received  data =
0:00:20.251972 < 2372>     INFO   [handle_msgtype08] Access Denied  len 0 data
0:00:20.254447 < 2376>    DEBUG   [handle_msgtype08]                last command 0b
0:00:21.726205 < 1529>    DEBUG   [pmSendPdu] Sending Command (Exit)    raw data 0d 0f f0 0a    waiting for message response []
0:00:21.726205 < 1531>    DEBUG   [pmSendPdu]          Command has a wait time after transmission 1.5
0:00:21.735028 < 1278>    DEBUG   [data receiver] received data: 0d
0:00:21.749254 < 1278>    DEBUG   [data receiver] received data: 02 fd 0a
0:00:21.749254 < 2344>    DEBUG   [handle_msgtype02] Ack Received  data =
0:00:23.635879 < 1278>    DEBUG   [data receiver] received data: 00
0:00:23.653194 < 1278>    DEBUG   [data receiver] received data: 58 08 08 42 00 58 08
0:00:23.668318 < 1278>    DEBUG   [data receiver] received data: 08 42 00
0:00:45.835353 < 1592>    DEBUG   [pmSendPdu] Resetting expected response counter, it got to 25   Response list before 0  after 1
0:00:45.837305 < 1529>    DEBUG   [pmSendPdu] Sending Command (I'm Alive Message To Panel)    raw data 0d ab 03 00 00 00 00 00 00 00 00 00 43 0e 0a    waiting for message response ['0X2']
0:02:26.834833 < 1576>     INFO   [SendCommand] Re-Sending last message  I'm Alive Message To Panel
0:02:26.835771 < 1604>    DEBUG   [ClearList] Setting queue empty
C:\Users\david\OneDrive\Desktop\Hassio\Visonic\pyvisonic.py:1580: RuntimeWarning: coroutine 'wait_for' was never awaited
  asyncio.wait_for(t, None)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-158' coro=<ProtocolBase.SendCommandAsync() done, defined at C:\Users\david\OneDrive\Desktop\Hassio\Visonic\pyvisonic.py:1542> exception=AttributeError("'NoneType' object has no attribute 'triedResendingMessage'")>
Traceback (most recent call last):
  File "C:\Users\david\OneDrive\Desktop\Hassio\Visonic\pyvisonic.py", line 1581, in SendCommandAsync
    self.pmLastSentMessage.triedResendingMessage = True
AttributeError: 'NoneType' object has no attribute 'triedResendingMessage'
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-159' coro=<ProtocolBase.pmSendPdu() done, defined at C:\Users\david\OneDrive\Desktop\Hassio\Visonic\pyvisonic.py:1474> exception=AttributeError("'NoneType' object has no attribute 'command'")>
Traceback (most recent call last):
  File "C:\Users\david\OneDrive\Desktop\Hassio\Visonic\pyvisonic.py", line 1485, in pmSendPdu
    command = instruction.command
AttributeError: 'NoneType' object has no attribute 'command'
0:02:27.834080 < 1592>    DEBUG   [pmSendPdu] Resetting expected response counter, it got to 102   Response list before 0  after 1
0:02:27.836083 < 1529>    DEBUG   [pmSendPdu] Sending Command (I'm Alive Message To Panel)    raw data 0d ab 03 00 00 00 00 00 00 00 00 00 43 0e 0a    waiting for message response ['0X2']
0:04:08.834130 < 1576>     INFO   [SendCommand] Re-Sending last message  I'm Alive Message To Panel
0:04:08.834606 < 1604>    DEBUG   [ClearList] Setting queue empty
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-263' coro=<ProtocolBase.SendCommandAsync() done, defined at C:\Users\david\OneDrive\Desktop\Hassio\Visonic\pyvisonic.py:1542> exception=AttributeError("'NoneType' object has no attribute 'triedResendingMessage'")>
Traceback (most recent call last):
  File "C:\Users\david\OneDrive\Desktop\Hassio\Visonic\pyvisonic.py", line 1581, in SendCommandAsync
    self.pmLastSentMessage.triedResendingMessage = True
AttributeError: 'NoneType' object has no attribute 'triedResendingMessage'
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-264' coro=<ProtocolBase.pmSendPdu() done, defined at C:\Users\david\OneDrive\Desktop\Hassio\Visonic\pyvisonic.py:1474> exception=AttributeError("'NoneType' object has no attribute 'command'")>
Traceback (most recent call last):
  File "C:\Users\david\OneDrive\Desktop\Hassio\Visonic\pyvisonic.py", line 1485, in pmSendPdu
    command = instruction.command
AttributeError: 'NoneType' object has no attribute 'command'
0:04:09.834319 < 1592>    DEBUG   [pmSendPdu] Resetting expected response counter, it got to 102   Response list before 0  after 1
0:04:09.835327 < 1529>    DEBUG   [pmSendPdu] Sending Command (I'm Alive Message To Panel)    raw data 0d ab 03 00 00 00 00 00 00 00 00 00 43 0e 0a    waiting for message response ['0X2']
0:04:19.835241 < 1158>     INFO   [Controller] Trigger Panel Download Attempt
0:04:19.836243 < 1618>     INFO   [Start_Download] Starting download mode
0:04:19.842408 < 1592>    DEBUG   [pmSendPdu] Resetting expected response counter, it got to 10   Response list before 0  after 1
0:04:19.849148 < 1529>    DEBUG   [pmSendPdu] Sending Command (Start Download Mode)    raw data 0d 24 00 00 56 50 00 00 00 00 00 00 35 0a    waiting for message response ['0X3C']
0:07:20.834774 < 1142>  WARNING   [Controller] ********************** Download Timer has Expired, Download has taken too long *********************
0:07:20.835620 < 1143>  WARNING   [Controller] ************************************* Going to standard mode ***************************************
0:07:20.854517 < 1265>     INFO   [Standard Mode] Entering Standard Mode
0:07:20.856040 < 1604>    DEBUG   [ClearList] Setting queue empty
WARNING:__main__:Visonic attempt to add device with type <class 'int'>  device is 7
0:07:20.858040 < 1592>    DEBUG   [pmSendPdu] Resetting expected response counter, it got to 181   Response list before 0  after 1
0:07:20.859036 < 1529>    DEBUG   [pmSendPdu] Sending Command (Exit)    raw data 0d 0f f0 0a    waiting for message response ['0X2']
0:07:20.860031 < 1531>    DEBUG   [pmSendPdu]          Command has a wait time after transmission 1.5
0:07:22.350710 < 1529>    DEBUG   [pmSendPdu] Sending Command (Stop)    raw data 0d 0b f4 0a    waiting for message response ['0X2']
0:07:22.351283 < 1531>    DEBUG   [pmSendPdu]          Command has a wait time after transmission 1.5
0:07:23.850955 < 1529>    DEBUG   [pmSendPdu] Sending Command (Initializing PowerMax/Master PowerLink Connection)    raw data 0d ab 0a 00 01 00 00 00 00 00 00 00 43 06 0a    waiting for message response ['0X2']
0:07:23.851740 < 1531>    DEBUG   [pmSendPdu]          Command has a wait time after transmission 8.0
0:07:30.850636 < 1208>    DEBUG   [Controller] ****************************** Response Timer Expired ********************************
0:07:30.851605 < 1604>    DEBUG   [ClearList] Setting queue empty
0:07:30.857071 < 1592>    DEBUG   [pmSendPdu] Resetting expected response counter, it got to 0   Response list before 0  after 2
0:07:31.849539 < 1529>    DEBUG   [pmSendPdu] Sending Command (Getting Status)    raw data 0d a2 00 00 00 00 00 00 00 00 00 00 43 1a 0a    waiting for message response ['0XA5', '0X2']
0:07:40.850837 < 1208>    DEBUG   [Controller] ****************************** Response Timer Expired ********************************
0:07:40.851675 < 1604>    DEBUG   [ClearList] Setting queue empty
0:07:40.856600 < 1592>    DEBUG   [pmSendPdu] Resetting expected response counter, it got to 0   Response list before 0  after 2
0:07:40.864239 < 1529>    DEBUG   [pmSendPdu] Sending Command (Getting Status)    raw data 0d a2 00 00 00 00 00 00 00 00 00 00 43 1a 0a    waiting for message response ['0XA5', '0X2']
0:07:50.850522 < 1208>    DEBUG   [Controller] ****************************** Response Timer Expired ********************************
0:07:50.850522 < 1604>    DEBUG   [ClearList] Setting queue empty
0:07:50.853253 < 1592>    DEBUG   [pmSendPdu] Resetting expected response counter, it got to 0   Response list before 0  after 2
0:07:50.859207 < 1529>    DEBUG   [pmSendPdu] Sending Command (Getting Status)    raw data 0d a2 00 00 00 00 00 00 00 00 00 00 43 1a 0a    waiting for message response ['0XA5', '0X2']
0:08:00.849973 < 1208>    DEBUG   [Controller] ****************************** Response Timer Expired ********************************
0:08:00.851778 < 1604>    DEBUG   [ClearList] Setting queue empty
0:08:00.855816 < 1592>    DEBUG   [pmSendPdu] Resetting expected response counter, it got to 0   Response list before 0  after 2
0:08:00.857755 < 1529>    DEBUG   [pmSendPdu] Sending Command (Getting Status)    raw data 0d a2 00 00 00 00 00 00 00 00 00 00 43 1a 0a    waiting for message response ['0XA5', '0X2']
0:08:10.851279 < 1208>    DEBUG   [Controller] ****************************** Response Timer Expired ********************************
0:08:10.851279 < 1604>    DEBUG   [ClearList] Setting queue empty
0:08:10.853236 < 1592>    DEBUG   [pmSendPdu] Resetting expected response counter, it got to 0   Response list before 0  after 2
0:08:10.860435 < 1529>    DEBUG   [pmSendPdu] Sending Command (Getting Status)    raw data 0d a2 00 00 00 00 00 00 00 00 00 00 43 1a 0a    waiting for message response ['0XA5', '0X2']
0:08:20.849739 < 1208>    DEBUG   [Controller] ****************************** Response Timer Expired ********************************
0:08:20.850538 < 1604>    DEBUG   [ClearList] Setting queue empty
0:08:20.854533 < 1592>    DEBUG   [pmSendPdu] Resetting expected response counter, it got to 0   Response list before 0  after 2
0:08:20.856534 < 1529>    DEBUG   [pmSendPdu] Sending Command (Getting Status)    raw data 0d a2 00 00 00 00 00 00 00 00 00 00 43 1a 0a    waiting for message response ['0XA5', '0X2']

I have downloaded and installed Windmill ComDebug, started the configuration steps but got stuck in step 3 of the configuration https://www.windmill.co.uk/comiml_ts.html

What I’m supposed to put on step 3, 4, 5 and 6?

On Step 2 I selected COM 5, Baud Rate: 9600, Data Bits: 8, Parity: None, Stop Bits: 1, and Flow Control: None.

I figured the only way to answer your questions was to install the software, remove the USB-to-serial cable from my HA host, plug it into my PC and see how it works. To make a long story short, it was the proverbial ‘epic fail.’ When I tried to assign the COMM port, the program said it was already in use, just like Commfront’s software. Specifically, I had already assigned a port to PuTTY. I was testing to see if it could view and log loop-back data.

Perhaps I’m confused as to how these programs work. Maybe there’s a custom driver or dll I need to install. Or…maybe I just haven’t found the right software. I know for sure a hardware solution with another serial port works, but don’t have the spare time right now to pull the pieces together.

<sigh>

I’ve uninstalled Windmill. I’ll keep looking, though.

That gets us a bit further but it’s still not good news.
With this part of your output (I have removed a few interim lines as these are the important 7)

0:00:00.844170 < 1529>    DEBUG   [pmSendPdu] Sending Command (Start Download Mode)    raw data 0d 24 00 00 56 50 00 00 00 00 00 00 35 0a    waiting for message response ['0X3C']
0:00:00.866709 < 1278>    DEBUG   [data receiver] received data: 0d 02 fd 0a
0:00:00.881061 < 1278>    DEBUG   [data receiver] received data: 0d 22 fd 0a 01 16 15 00 0d 00 00 00 9c 0a
0:00:00.881501 < 1334>  WARNING   [data receiver] Warning : Construction of incoming packet unknown - Message Type 0X22
0:00:00.882507 < 1354>  WARNING   [data receiver] Unhandled message 0x22
0:00:00.991127 < 1529>    DEBUG   [pmSendPdu] Sending Command (Ack)    raw data 0d 02 fd 0a    waiting for message response ['0X3C']
0:00:20.215584 < 1278>    DEBUG   [data receiver] received data: 0d 06 f9 0a

I’ll call them lines 1 to 7.
Line 1 is me sending the download command to the panel
Line 2 is the acknowledge back from the panel, looking good so far
Line 3 is a message from the panel that I’ve never seen before (and it is a valid message with a valid checksum)
Line 4 is me stating that it’s a message I’ve never seen before
Line 5 is me stating that I haven’t processed that message.
Line 6 is me sending an acknowledge back to the panel for the message I don’t understand
Line 7 is nearly 20 seconds later and it’s a panel timeout message

Line 7 means that the panel is waiting for me to tell it or ask it something but I don’t know what to do as I don’t know what it’s previous message to me means from line 3 (are you following this :slight_smile: )

I can dig around the internet looking for message 0x22 from the panel but I’m beginning to think that Visonic updated their protocol after they made your panel and no one has decoded the protocol for yours.

But if there is a problem with your Windows installation/configuration? I think it could be a good idea to try it just to see if it works in my windows ? Just a simple test to see if I can intercept the communication in my COM 5.

Just my Luck!!!

Did you checked in the Visonic Powermax Powerlink protocol description?
But I’m sure you already know this forum

I don’t think it will work, but you don’t need my permission to try. You’ve already gained enough battle scars from the experience.

I think there’s something else that’s needed. There is a software null modem emulator that might work, but it’s only for connecting two programs. What we need is something similar, but works as a shim between a virtual port and a physical port.

I do know that one and a few others… and a few other plugind for other devices like the Vera plugin, I’ll take a look around and see if I can find anything.

To capture the comms maybe we’re going about this the wrong way. I could alter my bridge.py code to bridge between 2 COM ports. At the moment it bridges between a COM port and an Etherenet Address and Port. Something like this

com0com is a free download that creates virtual COM ports on your Windows PC and connects them together. Let me see what I can do over the next few days or so, I’ll let you know how I get on :slight_smile:

That’s the one I was just looking at.

Ok, no problem, and again a big Thank You to you Dave and to Rob for your enormous efforts, no matter in the end we succeed or not I’m very thankful of your help.

You’re most welcome. Having gone through the effort, let’s see if Dave comes up with something having broader application. Wouldn’t that be nice?

Yes it would, and I know at least one person that would also benefit from this, not to mention all my neighbors, just in my condo all our houses came with this Security panel pre installed, I think we are around 50 houses.

Beyond that, a modified bridge.py with PRP might provide Dave and others a tool to reverse engineer additional details of the protocol only visible with Visonic’s software.

Didn’t think of that, even better than, maybe we can help Dave and others take more control over our panels.

I talked to some collegues at work and one them sugested me this softwares, here is the list:

https://www.fabulatech.com/serial-port-splitter.html
https://freevirtualserialports.com/
https://downloads.tomsguide.com/Serial-Port-Splitter,0301-63628.html
https://mobaxterm.mobatek.net/

hello all

sorrry to change the subject but could i ask a question or two.

  1. I can see in the sensor that you can see the battery state but can this be shown on its own? i want to make a battery stat page to try prevent issues

  2. Should i see the siren in my device list (i can only see my PIR and door sensors)

  3. Can you exclude zones in the config.yaml? I only use zones 1-9

TIA

OK, here goes:

  1. Here is a link to the post earlier in this thread where I make sensors from panel attributes. You need to do it in a similar way, create a sensor from the panels sensor attributes and display that new sensor in your frontend (or use it however you would a normal sensor). Note though that the battery sensor always only shows 0% or 100% and nothing in between so you could create a binary sensor out of it.

  2. No, the panel does not report the siren or it’s state

  3. If you mean exclude:

  • them as sensors/devices from within HA then yes, see here for a list of config parameters. You need exclude_sensor and/or exclude_x10.
  • specific sensors (bypass) when you arm the panel then yes but this is set up as a service in the Component, see here. You need to use the visonic.alarm_sensor_bypass service from a HA script. Or set up your own entities to call the service as I do not create them by default.

Dave

Or perhaps take over the world hahahahaha :rofl: :rofl:
Joking aside, I do appreciate your confidence, but let’s see how far we get :slight_smile:

I’ve just uploaded 0.3.3.5 to Github.
It includes some other minor changes but it also includes changes to the bridge. It was quicker than I thought it would be, cheers to modular software :slight_smile:

You use it like I posted in a diagram a couple of posts back, run bridge like this from the command line:

python3 bridge.py -coma COM2 -comb COM5

I think you said COM5 was your connection to the panel.
COM2 is one side of the com0com (or whatever utility you decide to use).
You can then setup the Visonic PRP to connect to COM1, the other side of the com0com pair.
The option -comb is the one used to display to the screen as “to” and “from”.

As an aside: I use Ethernet to my panel so I had it a bit more complicated. I had 2 pairs in com0com and used bridge.py from 2 PowerShell windows, one like the above and the other to connect from a COM to my panel and it worked. It displayed the same text on both PowerShell windows.

Awesome work, Dave. Much respect.