Visonic Powermax and Powermaster Integration

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.

I’m just moving over from SmartThings as all the useful custom integrations are about to stop working (a lot already have). The last big integration to deal with is our alarm which I started yesterday.
I reflashed my Wemos and setup the HA integration and I can see the sensors registering when they are triggered but when I click the Arm Away/ Home Buttons, nothing happens. Have I missed something in the setup?
Thanks.

Hi and welcome to Home Assistant :slight_smile:
I’m going to need a bit more than what you have told me in your post so that I can be of any help.
Have you seen the wiki for this integration here?
I assume that you have flashed the Wemos with the ESPHome configuration file as described on the wiki here?

If you still have problems then create a Home Assistant log file as defined here on the wiki and upload it to pastebin/dropbox and leave a link to it here as a reply back to my post. I need the first 5 or 10 minutes worth of the log file after you restart Home Assistant so I can see the initial connection to the panel. If you can then include you trying to arm away from Home Assistant and then save the log file to upload.

EDIT: I should ask the obious first, you have ticked the “Allow Panel Arm from Home Assistant” in the configuration?

Hi, thanks for the quick response.
I thought that followed the wiki completely…but maybe I missed something.
Since I posted my original comment, the sensors have started showing as Unavailable :frowning_face:
I restated Home Assistant and this time when I tried to arm the panel, it gave me a slightly different card with the ability to put in the pin, I tried it and it armed the panel…now the card has changed back to just 2 button i.e. no ability to put the pin in - I can see in the log that it says ‘Valid 4 digit PIN not found’ but not sure if I missed that as part of the config.
I’ve copied 2 logs, the first is when I re-added the integration (seems to have more info), the second when I just restarted Home Assistant.

…I did tick the Allow Panel Arm from Home Assistant.

Hi, can you please delete the integration from within HA and then re-install it. From your log file it looks like you do not have a Powermax+ panel and therefore this time can you make sure that Auto Enroll Supported is ticked in the configuration.

In addition, if the above doesn’t work, then delete and re-install it, this time tick Auto Enroll Supported and set the Download Code in the configuration to “AAAA” and then try that.

Give it a try and if it doesn’t work then capture a log file and upload again please. BTW, if you do have a Powermax+ panel then we have bigger problems.

Hi Dave,
It is a Powermax Complete panel.
I deleted & reinstalled it making sure I ticked the Auto Enroll Supported and that worked - I thought that I had ticked that before but you can put it down to ‘Operator Error’!
It’s been running for 18 hours so hopefully all ok thanks for the support and for creating the integration in the first place.
I did notice in the logs that every now and then it logs the line below at which point the panel/ sensors go offline for a few secs and then reconnect. Is that normal/ expected?


2022-12-24 09:10:25.777 ERROR (MainThread) [custom_components.visonic.pyvisonic] ERROR Connection Lost : disconnected because the Ethernet/USB connection was externally terminated.
2022-12-24 09:10:25.783 ERROR (MainThread) [custom_components.visonic.pyvisonic] ERROR Connection Lost : disconnected because of close/abort.
2022-12-24 09:10:25.789 WARNING (MainThread) [homeassistant.util.async_] Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom integration author for visonic doing blocking calls at custom_components/visonic/pyvisonic.py, line 1512: sleep(5.0)  # a bit of time for the watchdog timers and keep alive loops to self terminate
2022-12-24 09:10:30.799 ERROR (MainThread) [custom_components.visonic.pyvisonic]                         Calling Exception handler.
2022-12-24 09:10:32.345 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Panel 0 (PowerMax Complete Part) for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 515, in async_unload
    result = await component.async_unload_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 89, in async_unload_entry
    return await component.async_unload_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!