Visonic Powermax and Powermaster Integration

This has been resolved, I can’t remember in which release. The Integration now uses 2 time sources. UTC time for all time calculations and time offsets. Local time to provide dates and times for when sensors are triggered etc. So the fact that it uses UTC time means that its OK, in fact mine worked across the time change last weekend.

I removed the red cable (5V) that I’d erroneously added, double checked that the TX and RX were in the right pins (they were).

I ran the python script - my computer skills are enough to debug this, but I’m lacking in figuring out interfacing issues like this.

The output of the script does not look promising…

python3 complete_example.py -usb /dev/ttyUSB1
Starting
General Exception
Goodbye cruel world

If you think it is my cable that is an issue, would you mind recommending something more appropriate to use? I have no experience with ESP32, Wemos etc so I’m more baffled there. The USB approached seemed the most straightforward as I’ve been able to relocate the alarm box into my office right next to my server.

I’ve tried to follow the wiki as best as possible. I have a Raspberry Pi W going spare if you think this might be more appropriate, but I couldn’t get my inexperienced head around what to do with the Wemos D1 for example.

On a side note I cleared all the troubles on the panel so it’s not that preventing it coming in to HA.

If complete_example exits with a general exception then chances are you’re using the wrong linux device. The problem I have is that I’ve never used it on linux, only windows. When you look in /dev does the device exist.

If you have a windows 10/11 PC then plug the USB cable in. Go to device manager and it should appear as a device in “Ports (COM & LPT)”, note down the COM number e.g.COM5

Install python3, install the library requirements (as per my previous post) and run complete_example like this from a Powershell window

python3 .\complete_example.py -usb \\.COM5\

To test it, one thing to try is my “loopback” test here on the wiki. Disconnect all cables from your panel and connect Rx to Tx on the USB cable you have. Run complete_example in the same way that you are, in the output log (in the Powershell window) you should see

[handle_msgtype0F] LOOPBACK TEST SUCCESS, Counter is 2

Where the counter value increments about every 5 seconds.

Thanks for the help. I don’t have access to a Windows PC where I can try this - only my locked down work laptop. After some digging on Ubuntu it’s just not picking up the device even though the drivers are installed.

I think the cable is the issue. I’m returning it and trying something that looks more suitable with 3.3V as standard. I’ll see how that goes and report back.

Just one question though - you said about reversing TX and RX - is it TX on the USB to TX on the alarm, or should it be TX on the USB to RX on the panel?

Connect Gnd to Gnd. Tx on the cable to Rx on the panel connector and Rx on the cable to Tx on the panel. If you are not using power from the panel to power the interface gadget then do not connect the Vcc (i.e. 5 volts / 3.3 volts). If you want to try the loopback test then ignore the panel and Tx to Rx on the cable itself.

Hi,
I should have done this a month ago but can you support my WTH by voting for it please, it this here

Love your integration, thank you for the work.
One thing that I would like to solve, is that sometimes, I suspect after powerloss or something, the panel appear “unavailable”.
The soution to solve it is simple press the reload integration, nothing else required.
Is that known issue ? couldn’t find here something like.

Using Powermax Pro

Hi, there’s a troubleshooting section on the wiki here but if that doesn’t help then create a log file with the settings here and upload part of the log file for me to take a look. As it occurs randomly, I just need the part of the log file that shows the disconnection, say 20 or 30 lines before it.

1 Like

I double checked all my wiring and bought a new USB to TTL device based on the CP2102 chip. TTYUSB1 now appears as a device in Ubuntu, but I still get the same general exception.

Has anyone got any experience with interfacing the Powermax Express to HA via USB? I assumed this would be the simplest method for me, but its looking more likely I’m going to need to try something down the Wemos route - but I’m thinking if I can’t use USB its fruitless with this panel to try anything else.

I found my mistake! I’m running HA in docker, and I wasn’t passing the device through to the container, so I went in and added /dev/ttyUSB1 to the compose file, fired everything up and now I have a Visonic panel appearing in HA along with a door sensor and three Next PG2 PIRs. Now that I’ve got this far I can try and figure out how to get everything else in, or whether it is purely a limitation of the panel.

Hello,
I’m trying to set up my PowerMaxPro with Wemos D1 R2. I successfully flashed the Wemos board and installed visonic_interface in HA. Communication with the board is OK, I can turn off and on the onboard LED. I connected RX, TX and ground signals between panel and Wemos. However I am stuck in integration installation, it fails to connect to the panel. Here is the log

2022-11-19 15:11:22.187 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Panel 3 for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 496, in async_unload
    result = await component.async_unload_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 87, in async_unload_entry
    return await component.async_unload_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 172, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2022-11-19 15:11:22.188 DEBUG (MainThread) [custom_components.visonic.client]           ........... Closing down Current Task
2022-11-19 15:11:24.189 DEBUG (MainThread) [custom_components.visonic.client]           ........... Current Task Done
2022-11-19 15:11:24.190 DEBUG (MainThread) [custom_components.visonic] ************* terminate connection success **************
2022-11-19 15:11:24.190 DEBUG (MainThread) [custom_components.visonic] ************* create connection here **************
2022-11-19 15:11:24.190 INFO (MainThread) [custom_components.visonic] Starting Visonic with entry id=cc759e1211a75877fd95c9d23e05ee92 configured panels=1
2022-11-19 15:11:24.190 DEBUG (MainThread) [custom_components.visonic] Panel Ident set up: panelident = 3   next auto panelident = 4
2022-11-19 15:11:24.190 DEBUG (MainThread) [custom_components.visonic.client] Exclude sensor list = []     Exclude x10 list = []
2022-11-19 15:11:24.190 DEBUG (MainThread) [custom_components.visonic] Setting client ID for entry id cc759e1211a75877fd95c9d23e05ee92
2022-11-19 15:11:24.191 DEBUG (MainThread) [custom_components.visonic.client] ........... attempting connection
2022-11-19 15:11:24.192 DEBUG (MainThread) [custom_components.visonic.client] Visonic Connection Device Type is ethernet {<PyConfiguration.DownloadCode: 0>: 'AAAA', <PyConfiguration.ForceStandard: 9>: False, <PyConfiguration.ForceAutoEnroll: 1>: False, <PyConfiguration.AutoSyncTime: 2>: True, <PyConfiguration.PluginLanguage: 3>: 'EN', <PyConfiguration.MotionOffDelay: 4>: 120.0, <PyConfiguration.SirenTriggerList: 5>: ['intruder'], <PyConfiguration.B0_Enable: 6>: False, <PyConfiguration.B0_Min_Interval_Time: 7>: 5, <PyConfiguration.B0_Max_Wait_Time: 8>: 30}
2022-11-19 15:11:24.192 DEBUG (MainThread) [custom_components.visonic.pyvisonic] Setting TCP socket Options
2022-11-19 15:11:25.201 DEBUG (MainThread) [custom_components.visonic.pyvisonic] Initialising Protocol - Using Home Assistant Loop
2022-11-19 15:11:25.201 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Settings] Force Standard set to False
2022-11-19 15:11:25.201 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Settings] Force Auto Enroll set to False
2022-11-19 15:11:25.201 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Settings] Force Auto Sync Time set to True
2022-11-19 15:11:25.201 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Settings] Download Code set to AA AA
2022-11-19 15:11:25.201 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Settings] Language set to EN
2022-11-19 15:11:25.201 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Settings] Motion Off Delay set to 120.0
2022-11-19 15:11:25.201 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Settings] Siren Trigger List set to ['intruder']
2022-11-19 15:11:25.201 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Settings] B0 Enable set to False
2022-11-19 15:11:25.201 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Settings] B0 Min Interval set to 5
2022-11-19 15:11:25.201 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Settings] B0 Max Wait Time set to 30
2022-11-19 15:11:25.203 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Connection] Connected to local Protocol handler and Transport Layer
2022-11-19 15:11:25.203 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [_clearList] Setting queue empty
2022-11-19 15:11:25.203 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [StartDownload] Starting download mode
2022-11-19 15:11:25.204 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [sendPdu] Sending Command (Exit)    raw data 0d 0f f0 0a    waiting for message response []
2022-11-19 15:11:25.204 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [sendPdu]          Command has a wait time after transmission 1.5
2022-11-19 15:11:25.204 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Controller] download_counter is 1
2022-11-19 15:11:25.227 ERROR (MainThread) [custom_components.visonic.pyvisonic] ERROR Connection Lost : disconnected because the Ethernet/USB connection was externally terminated.
2022-11-19 15:11:25.228 ERROR (MainThread) [custom_components.visonic.pyvisonic] ERROR Connection Lost : disconnected due to exception [Errno 104] Connection reset by peer
2022-11-19 15:11:30.234 ERROR (MainThread) [custom_components.visonic.pyvisonic]                         No Exception handler to call, terminating Component......
2022-11-19 15:11:30.237 DEBUG (MainThread) [custom_components.visonic.client] ........... connection made
2022-11-19 15:11:30.238 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [sendPdu] Suspended all operations, not sending PDU
2022-11-19 15:11:30.238 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [sendPdu] Resetting expected response counter, it got to 1   Response list length before 0  after 1
2022-11-19 15:11:30.238 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [sendPdu] Suspended all operations, not sending PDU

What could be the problem?
BTW is it mandatory to specify the port in secrets.yaml? I didn’t do it and got default port 6053

Hi,
Looking at panelident = 3 in your log file you are trying to install your 3rd panel. Assuming that you only have 1 panel please delete the integration (probably multiple times) to remove it completely from HA and start again using the default panel 0. There are currently multiple instances of the integration trying to access the same address and port which could be your problem. It’s also confusing in the log file as the multiple instances all write to the log file so I can’t really tell what’s going on. I did notice however that the integration does try to send data to the panel but it receives nothing back. I’d suggest to check your wiring. Are you connecting Rx to Tx and Tx to Rx? I know it’s obvious but I’ve gotta check.

If you still have problems then try the loopback test as described on the wiki here. i.e. connect Tx to Rx on the Wemos, set the HA logger settings and look in the HA log file for LOOPBACK TEST SUCCESS, Counter is ....

If you still have problems then upload another log file and I’ll take a look.

Yes and use the same IP address and port when you install the integration in HA.
Ports 6052 and 6053 are something to do with ESPHome itself so do not use them.

Regards :slight_smile:

Hi Dave,
Thank you very much for a prompt answer. I will try your suggestions and update.

Update: it works now
This was the culprit

I also experience random disconnections.
Here is one example

2022-11-22 09:35:48.013 DEBUG (MainThread) [custom_components.visonic.pyvisonic]      key 8  Sensor id=9  dname=Z09  stype=Motion   zname=Laundry room   ztypeName=Perimeter  ztamper=0  ztrip=0  bypass=0  lowbatt=0  status=0  tamper=0  enrolled=1  triggered=0 
2022-11-22 09:35:48.013 DEBUG (MainThread) [custom_components.visonic.pyvisonic]      key 9  Sensor id=10 dname=Z10  stype=Motion   zname=Upstairs       ztypeName=Perimeter  ztamper=0  ztrip=0  bypass=0  lowbatt=0  status=0  tamper=0  enrolled=1  triggered=0 
2022-11-22 09:35:48.013 DEBUG (MainThread) [custom_components.visonic.pyvisonic]    Model PowerMax Pro Part      PowerMaster No                     LastEvent Disarm / User 01       Ready   Yes          
2022-11-22 09:35:48.013 DEBUG (MainThread) [custom_components.visonic.pyvisonic]    Mode  Powerlink              Status      Disarmed               Armed     No                     Trouble None              AlarmStatus None        
2022-11-22 09:35:48.013 DEBUG (MainThread) [custom_components.visonic.pyvisonic] ==============================================================================================================
2022-11-22 09:35:48.013 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [sendPdu] Sending Command (Ack Long)    raw data 0d 02 43 ba 0a    waiting for message response []
2022-11-22 09:36:10.712 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [_validatePDU] Validated a Packet with a checksum that is 1 more than the actual checksum!!!! 22 and 21
2022-11-22 09:36:10.713 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [handle_msgtypeA5] Parsing A5 packet 00 02 00 00 00 00 00 00 00 00 43 
2022-11-22 09:36:10.713 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [sendPdu] Sending Command (Ack)    raw data 0d 02 fd 0a    waiting for message response []
2022-11-22 09:36:26.277 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [_validatePDU] Validated a Packet with a checksum that is 1 more than the actual checksum!!!! 22 and 21
2022-11-22 09:36:26.277 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [handle_msgtypeA5] Parsing A5 packet 00 02 00 00 00 00 00 00 00 00 43 
2022-11-22 09:36:26.277 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [sendPdu] Sending Command (Ack)    raw data 0d 02 fd 0a    waiting for message response []
2022-11-22 09:36:26.278 ERROR (MainThread) [custom_components.visonic.pyvisonic] ERROR Connection Lost : disconnected because the Ethernet/USB connection was externally terminated.
2022-11-22 09:36:26.279 ERROR (MainThread) [custom_components.visonic.pyvisonic] ERROR Connection Lost : disconnected because of close/abort.
2022-11-22 09:36:31.288 ERROR (MainThread) [custom_components.visonic.pyvisonic]                         Calling Exception handler.
2022-11-22 09:36:31.289 DEBUG (MainThread) [custom_components.visonic.client] PyVisonic has caused an exception, no exception information is available
2022-11-22 09:36:31.290 DEBUG (MainThread) [custom_components.visonic.client]  ........... terminating connection and setting up reconnection
2022-11-22 09:36:32.792 DEBUG (MainThread) [custom_components.visonic.select] select async_will_remove_from_hass
2022-11-22 09:36:32.793 DEBUG (MainThread) [custom_components.visonic.select] select async_will_remove_from_hass
2022-11-22 09:36:32.793 DEBUG (MainThread) [custom_components.visonic.select] select async_will_remove_from_hass
2022-11-22 09:36:32.793 DEBUG (MainThread) [custom_components.visonic.select] select async_will_remove_from_hass
2022-11-22 09:36:32.793 DEBUG (MainThread) [custom_components.visonic.select] select async_will_remove_from_hass
2022-11-22 09:36:32.793 DEBUG (MainThread) [custom_components.visonic.select] select async_will_remove_from_hass
2022-11-22 09:36:32.794 DEBUG (MainThread) [custom_components.visonic.select] select async_will_remove_from_hass
2022-11-22 09:36:32.794 DEBUG (MainThread) [custom_components.visonic.select] select async_will_remove_from_hass
2022-11-22 09:36:32.794 DEBUG (MainThread) [custom_components.visonic.select] select async_will_remove_from_hass
2022-11-22 09:36:32.794 DEBUG (MainThread) [custom_components.visonic.select] select async_will_remove_from_hass
2022-11-22 09:36:32.794 DEBUG (MainThread) [custom_components.visonic.binary_sensor] binary sensor async_will_remove_from_hass
2022-11-22 09:36:32.795 DEBUG (MainThread) [custom_components.visonic.binary_sensor] binary sensor async_will_remove_from_hass
2022-11-22 09:36:32.795 DEBUG (MainThread) [custom_components.visonic.binary_sensor] binary sensor async_will_remove_from_hass
2022-11-22 09:36:32.795 DEBUG (MainThread) [custom_components.visonic.binary_sensor] binary sensor async_will_remove_from_hass
2022-11-22 09:36:32.795 DEBUG (MainThread) [custom_components.visonic.binary_sensor] binary sensor async_will_remove_from_hass
2022-11-22 09:36:32.795 DEBUG (MainThread) [custom_components.visonic.binary_sensor] binary sensor async_will_remove_from_hass
2022-11-22 09:36:32.795 DEBUG (MainThread) [custom_components.visonic.binary_sensor] binary sensor async_will_remove_from_hass
2022-11-22 09:36:32.796 DEBUG (MainThread) [custom_components.visonic.binary_sensor] binary sensor async_will_remove_from_hass
2022-11-22 09:36:32.796 DEBUG (MainThread) [custom_components.visonic.binary_sensor] binary sensor async_will_remove_from_hass
2022-11-22 09:36:32.796 DEBUG (MainThread) [custom_components.visonic.binary_sensor] binary sensor async_will_remove_from_hass
2022-11-22 09:36:32.796 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Panel 0 (PowerMax Pro Part) for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 496, in async_unload
    result = await component.async_unload_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 87, in async_unload_entry
    return await component.async_unload_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 172, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2022-11-22 09:36:32.817 DEBUG (MainThread) [custom_components.visonic.alarm_control_panel] alarm control panel async_will_remove_from_hass
2022-11-22 09:36:32.818 DEBUG (MainThread) [custom_components.visonic.client]           ........... Closing down Current Task
2022-11-22 09:36:34.819 DEBUG (MainThread) [custom_components.visonic.client]           ........... Current Task Done

When a connection is externally terminated that is nothing to do with the integration or HA. It is the wifi connection being terminated by something e.g. your router, the operating system in teh device that you run HA or gadget you have in the panel. Other users have had this problem and may be able to help but you’d need to investigate this yourself, for example is the wifi lease from the router not being renewed properly or perhaps the wifi signal is weak where your panel is.
Sorry but I can’t be much more help, best of luck finding the problem though.

Brilliant integration, works perfectly - many thanks.

Question I have, what configuration changes does the integration make to the alarm panel itself?

Reason being if I need to shut down my HA instance, the alarm panel shows ‘system troubles’ ‘BBA comm lost’ which prevents me from arming the alarm. Any idea what setting I’d need to manually apply to the panel to revert ? If I disconnect mains power & battery backup the issue goes away - but that’s not really a practical solution. Thanks (Powermax complete)

It connects to the panel in a way that the panel thinks it has a “Visonic Powerlink Module” inside it. There are no other configuration changes made to the panel. This HA integration mimics the powerlink module with the necessary messages and interactions.

The panel warning messages that you get is the panel telling you that it has lost communication with the Powerlink Module. So you would need to tell your panel that it no longer has a Powerlink Module attached. This depends on what type of panel you have but it should be in the panels instruction manual.

EDIT: I’ve been thinking about it a bit more, I think that you should be able to simply enter and exit Installer Mode and that clears the Warning. The panel recognises that it’s informed you of the Warning and then doesn’t again. Give it a try and let me know.

1 Like

Hi Dave.

Thank you for maintaining and improving this integration, and replying to all support-issues here!
Much appreciated.

It would be a nice feature for the Powermaster 10/30 that partitions are possible. Otherwise, if the note mentioned in the Wiki is possible for the Powermaster series:

Quote:
However, some panel types can have 2 active powerlink connections and it may be possible to connect both a Powerlink and have a connection to Home Assistant.

With this option I can arm and disarm the panel with partitions directly interfacing the Powerlink3 interface trough the API. Sensors are then monitored by HA for automations only.