Skip to content
davesmeghead edited this page Jun 19, 2021 · 122 revisions

Visonic Alarm Panel for Home Assistant

A Custom Integration for Home Assistant

Introduction

Visonic produce the Powermax and Powermaster alarm panel series.

This Home Assistant Integration allows you to control the alarm panel (arm/disarm) and allows you to use the Visonic sensors and events (movement, door contact, ...) and X10 devices within Home Assistant.

Contents

What my Frontend looks like

This is what my sensors look like

And I have 2 cards in Lovelace, they look like this

This last image shows a card in Home Assistant with a set of entities that have been created from attributes of the alarm panel entity "alarm_control_panel.visonic_alarm". This can be done using a templete as here in HA.

Supported Visonic Panels

These are the supported Visonic Panel Types (including specific model information).

Panel Type
Panel Model
Comment
Powermax This doesn't work with this Integration, it doesn't support a Powerlink Hardware Module.
1 (33,47) Powermax+ This will work but needs to be Manually Enrolled (please set force_autoenroll to 'no').
2 (22) Powermax Pro This will work but needs to be Manually Enrolled (please set force_autoenroll to 'no').
3 (?) Powermax Complete This will work and will auto enroll.
4 (17,71,86) Powermax Pro Part This will work and will auto enroll.
5 (18,79) Powermax Complete Part This will work and will auto enroll.
6 PowerMax Express This will work and will auto enroll.
7 (32,68,153) Powermaster 10 This will work and will auto enroll. Note 1
8 (6,53) Powermaster 30 This will work and will auto enroll. Note 1
10 (71,72) Powermaster 33 This will work and will auto enroll. Note 1
15 (146) Powermaster 33 This will work and will auto enroll. Note 1
Visonic 360r This doesn't work with this Integration.

Note 1, you may need to disable the battery saver in your PIR sensors to get motion triggers when the alarm is disarmed.

The Panel Type is the main panel type, the numbers in brackets are the various Model Type attribute that are known to exist and work with this Integration. These attributes are shown in HA after you get it working.

Please note that:

  • After extensive work, the original PowerMax Panel is not able to be used as it does not support the Powerlink protocol that this integration relies on. It only supports EPROM Upload and Download and nothing more.
  • The Visonic 360R Alarm Panel is not fitted with an RS232 connection and cannot have a Powerlink3 fitted (this integration mimics the operation of the Visonic Powerlink Hardware), it is therefore not compatible with this HA Integration.
  • Powermax+ and Powermax Pro users will need to manually enroll at the right point in time (usually within a few minutes of starting this integration). I believe that you do this by INSTALLER MODE → 7. ENROLL PWRLNK → 01: INSTALL. Most users with these 2 panel types only need to do this once, however a few users have found that they need to do this every time they restart the integration.

Supported Panel Functionality

This Integration currently connects to the panel and it creates an:

  • HA Sensor for each alarm sensor
  • HA Switch for each X10 device
  • Alarm Panel integration Entity "alarm_control_panel.visonic_alarm" so you can look at the internal state values
  • "alarm_control_panel" badge so you can arm and disarm the alarm
  • HA Service to arm/disarm the panel
  • HA Service to bypass/re-arm individual sensors
  • HA Service to retrieve the event log and save to an xml and/or a csv file
  • HA Event for several triggers from the panel to use in your Automations.

What it doesn't do in Home Assistant

  • Partitions, it assumes a single partition
  • Multiple visonic alarm panels integrated in to the same Home Assistant.

Hardware Setup

You have a choice, you can connect to your Visonic Alarm Panel using RS232, USB or Ethernet (Wired or Wireless)

The PowerMax/Master Alarm Panels provide an internal panel connector that is labelled as the Control interface, the PC interface or the RS232 interface, this interface directly supports a TTL logic level based RS232 protocol. Visonic do not provide a specification of the RS232 protocol and, thus, the Integration uses the available protocol specification given at the ​domoticaforum. The binding implementation of this protocol is largely inspired by the Vera and OpenHab plugins.

Please understand that RS-232 is a communication protocol (logical definition) as well as a signal level specification. Traditionally, the signalling level states are -12 V (logic 1) and +12 V (logic 0). For convenience, localized connections (within a few meters) have used logic levels for signalling.

For the PowerMax Visonic TTL logic levels, the signalling level states appear to be 0 V (logic 0) and 5.0 V (logic 1).

For the PowerMaster Visonic TTL logic levels, the signalling level states appear to be 0 V (logic 0) and 3.3 V (logic 1).

Do I need the Visonic Powerlink, Powerlink2 or Powerlink3 Hardware Module

No, please do not buy or use any of these modules. My integration mimics the functionality of these visonic modules and is used instead.
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.

Do I need the Visonic RS-232 Adapter Kit

The Visonic PowerMax/Master serial interface is not installed by default but can be ordered from any PowerMax vendor (called the Visonic RS-232 Adaptor Kit). This adaptor kit makes the TTL logic levels on the panel connector in to "proper" RS232 signal levels. I have never tried this and I don't know of anyone that has. If you do it like this you're pretty much on your own.

The panel has TTL logic levels for its RS-232 connector. The Visonic RS-232 Adapter Kit converts these TTL logic levels to proper RS-232 voltage levels.

So it depends on what you buy to interface your panel with your Home Assistant, if you buy:

  • An RS-232 cable to plug in to the old style DB9 RS-232 connector on a very old PC then you may need the Visonic RS-232 Adapter kit
  • A USB to RS-232 cable/adapter then you need to check whether the RS-232 is TTL or proper RS-232 +/- voltage levels.
  • Something like a Wemos D1 R2 or a USR-TCP232-E2 then they use TTL logic levels and you do not need the Visonic RS-232 Adapter Kit.

In summary, if the hardware that you buy to connect to your panel uses TTL logic levels for the RS-232 then you do not need the Visonic RS-232 Adapter Kit.

RS232 "Direct" Option

The panels internal RS232 interface can be connected to an RS232 9 pin "DB9" Type connection on the machine running Home Assistant. However, note that the panel interface is an RS232 connector that uses TTL logic signal levels and not "proper" RS232 voltage levels. In this case you may need the Visonic RS-232 Adapter kit.

USB Option

You do not need the Visonic RS-232 Adaptor Kit if you use a USB interface with TTL RS232 logic levels. You can then connect the USB cable to a Windows PC, a Raspberry Pi, or any other Linux capable device such as some NAS devices. If you run Home Assistant on any of these devices it will likely appear to the operating system as a USB device but many of the RS232 to USB devices come with drivers to install that make it appear like a serial device in some way (e.g. on Windows it appears as a COM port)

If you use the USB option on a Raspberry Pi then these commands may be useful to you To check the settings of the serial port, assuming you have determined that /dev/ttyUSB0 is your device.

stty -F /dev/ttyUSB0 -a

To set the parameters as 9600, 8 data bits, 1 stop bit, No parity (i.e. 9600 8, N, 1) you set the parameters with:

stty -F /dev/ttyUSB0 9600 cs8 -parenb -cstopb

This is normally the default anyway but just to make sure.

Ethernet Option

If you want to connect your alarm panel to your home ethernet network then you have 3 further options. You do not need the Visonic RS-232 Adaptor Kit if you use an Ethernet interface with TTL RS232 logic levels.

Ethernet Option 1

This option uses a small Linux based device such as the Raspberry Pi to run the ser2net program to turn it into a network connected device.

Install ser2net on the Linux device and edit the ser2net config file like this:

10628:raw:600:/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A700eRHw-if00-port0:9600 8DATABITS NONE 1STOPBIT

Be sure to change it to the proper serial port that Linux creates (/dev/ttyUSB0 in most cases). After editing, restart the ser2net service.

Now setup the Integration in Home Assistant like the ethernet setup, using the IP address of the Raspberry Pi and 10628 as the port. Of course you can use any other port you like, but be sure to also change it in the ser2net config file and remember to restart ser2net. There are users that have this setup and can help in the forums, one main advantage is that you can use the WiFi capability of the Raspberry Pi.

Ethernet Option 2

Purchase and use a simple device that connects to the RS232 TTL interface inside the panel (without using the Visonic RS-232 Adapter Kit) and create an Ethernet TCP connection. Essentially this is a simple bidirectional bridge between the RS232 and your home network, it is not an intelligent device like a Raspberry Pi and is much smaller and lower power. Some devices are usable as purchased, other devices you will need to 'flash' a firmware on to them.

This allows you to connect your alarm panel to your Ethernet home network. Usually there is a webserver running on the device and you need to set it up for TCP in STA (station) mode as transparent. In the HA configuration you set the IP address and port for this device. I suggest that you avoid port numbers below 1024 as they tend to be special.

Hardware Options

  • I bought this. There is a newer version out called a USR-TCP232-E2.
  • There is also a WiFi version available like this that's a bit more expensive but essentially it's the same. Although you will need to also buy an aerial for it remember!
  • A DOIT device here
  • An iTach IP2SL and with this you can use its PoE capability to power it. If you use PoE then do not connect the power to the panel and therefore only use 3 wires to connect it.
  • A NodeMCU that is flashed with esp-link firmware, it sounds complicated but it isn't really, for more details look here.

Ethernet Option 3

Purchase a Wemos D1 R2 (approx $10) and "flash" my ESPHome build on to it. Connect it to the RS232 TTL interface inside the panel (without using the Visonic RS-232 Adapter Kit) and create an Ethernet Connection from within Home Assistant. Essentially this is a simple bidirectional bridge between the RS232 and your home network.

This allows you to connect your alarm panel to your Ethernet home network, the Wemos ESPHome build creates a web socket. In the HA configuration you set the IP address and port for the Wemos device.

This option supports using relays connected to the wired zones inside your panel so you can trigger your siren from within Home Assistant.

Hardware Setup Example (Using a Wemos and ESPHome, including Siren Triggering)

Wiring it all up (not Ethernet option 3)

Note that wiring for Ethernet option 3 is given in the link

You do not need to buy anything else apart from 4 wires. For some panels you can buy a connector with a cable that you can use to make it easier. I bought an "IDC 10-pin ribbon cable" for my panel but remember that the panels and connectors can be different. I then split the wires to use the 4 that I needed.

You connect it in to your Visonic alarm panel like this but this page also helps with the wiring.

I connected the 3.75v pin on the panel to the Vcc (3.3v) on my device, gnd to gnd and Tx to Rx, Rx to Tx. 4 wires and that's it. It just worked!

Some users have found that they only have 5 volts available and they need 3.3 volts and so need to use a DC supply regulator (with 2 10uF Capacitors) to generate the 3.3 volts and then they also need a logic level shifter between the 5 and 3.3 volt TTL levels.

RS232 and the Baud rate

A quick note on Baud rates. This is relevant for all connection types as it determines the connection to the panel itself (i.e. all connection alternatives need to connect to the panel using RS232 in some way). This needs to be set in either the Ethernet/RS232 connection or the USB/RS232 connection.

The RS232 setup is to disable control flow i.e CTS/RTS, no parity and 1 stop bit.

Different panel firmware versions uses different baudrates. I believe that these are:

  • 17.133 and below - baudrate is 9600
  • 18.XXX and above - baudrate is 38400

However, if you have problems then try the other baudrate. Some early 18.XXX panels (e.g. Powermaster 10 v.18.040) seem to use 9600 baud for example but this isn't properly confirmed.

PowerMaster PIRs

When the PIRs are first installed they default to only sending their detections when the panel is armed. If you also want to send PIR detections when the panel is disarmed then change the “Disarm Activity” in panel device settings. This seems to be as follows in the panels menu and needs to be done for each PIR. installer mode > zones and devices > modify device > motion sensors > device settings > disarm activity > yes +0 seconds.

Installing the Software in to HA

This section tells you how to install the software part of the Integration in to Home Assistant.

There are 2 ways to do this

  1. Direct download. When you download the github zip file, extract it in your main HA configuration directory. This will create this directory hierarchy custom_components/visonic/**** where **** are all the files of the Integration
  2. Using HACS. Add the Github http website page for this Integration to the HACS repository.

To download the zip file, go to the wiki here https://github.com/davesmeghead/visonic then click the green code button and select "download zip" (as at the time of writing this description).

With both of these ways of installation, please restart Home Assistant in order to include the integration in the integrations page.

The Different Connection Modes

There are different ways to connect to the Panel and each gives it's own advantages and disadvantages. One persons advantage is another persons disadvantage so there are configuration settings to support this. Also, the highest level of interaction is with Powerlink Mode but that cannot always be achieved.

Standard Mode

This is the basic mode where the alarm panel provides an indication of its state and the information about the sensors and X10 devices. However, not all information is available for the Sensors, critically the sensor type is missing. You can arm and disarm the panel by either setting the Override Code in the HA configuration or by entering the code each time manually from the HA Frontend. The EPROM data is not downloaded from the alarm panel.

Standard Plus Mode

As per Standard mode, but in addition the EPROM data has been obtained from the panel. This provides more detailed information about the sensors and X10 devices and it also provides the user code for the panel. You can arm and disarm the panel without entering any user code as the HA Integration already knows it. You do not need to use the Override Code in the HA configuration although there are times when it might be useful. Standard Plus is achieved when trying to get to Powerlink Mode but the alarm panel refuses in some way.

Powerlink Mode

From a functionality view point, there isn't much difference between Standard Plus and Powerlink. Powerlink Mode provides:

  • All the things from Standard Plus Mode
  • More informative panel status messages from the panel, including the external siren status.
  • The interaction with the panel is more robust with continual "Powerlink Alive" messages from the Panel.
  • The Panel recognises that it has an external device attached to it and therefore attempts to maintain the connection / interaction with message retries.

Currently, the integration tries to get to powerlink mode as follows:

  • The integration makes 4 attempts over 9 minutes (3 minute gap) to auto-enroll powerlink with the panel (not for Powermax+ and Powermax Pro users)
  • The panel asks the integration to enroll (this is what happens for Powermax+ and Powermax Pro users when they manually enroll)

You can force it in to Standard mode.

This Integration tries to connect in Powerlink mode by default, unless you set Force Standard in the configuration options.

If the Integration connects in Standard Plus or Powerlink mode then it automatically gets the user codes from the panel to arm and disarm.

If the Integration connects in Standard mode then you must provide the user code to arm and disarm. You can either use Override Code in the HA configuration or manually enter it each time from the HA Frontend. Some panels allow arming without the user code. Note that to arm and disarm you must also set the configuration settings to permit this.

Why would I want to force Standard Mode?

It all comes down to trust and security versus flexibility. Do you trust your home network and the HA connection to it?

  • For those that have no trust then force Standard Mode and disable remote arm and disarm through this Integration. You will see the status of your panel sensors but you will not be able to interact with your panel.
  • For those that have some trust but not too much, then force Standard Mode and enable remote arm and disarm through this Integration (you're presented with a keypad). Perhaps just enable remote arm but not disarm in the configuration options.
  • For those that have a bit more trust, then force Standard Mode, enable remote arm and disarm through this Integration and set the Override Code in your configuration (no keypad needed).
  • For those that have full trust, get the connection to at least Standard Plus (but hopefully Powerlink) and enable remote arm and disarm through this Integration (no need to set the Override Code in your configuration and no keypad needed).

The Home Assistant Integration

This section looks at how you set up the integration within HA. By now you should have the hardware setup and the software for this integration installed. You also need to know which Connection Mode you want: Standard or Powerlink.

Integration Creation, Modification and Deletion from within Home Assistant

Home Assistant have added the ability to configure integrations from within a running Home Assistant installation i.e. without having any configuration in the configuration.yaml file. The configuration.yaml file set up is no longer supported for this Integration.

You do this by navigating to the integrations page, selecting the big + symbol at the bottom right of the page "Add Integration" and then finding "Visonic Intruder Alarm". You then go through the menus to set the settings as per the descriptions in the table below.

You can delete the integration from within HA (select the 3 vertical dots and then Delete) and optionally restart HA. Note that deleting the integration stops everything working and terminates the connection with the panel but it does not remove all the frontend. You can also Reload the integration (select the 3 vertical dots and then Reload), this is a combination of delete and create, it stops and restarts the integration with the same settings.

You can edit (and this is the clever bit) some of the settings for the integration by selecting the "options" in the integration. Some of the settings are only used at startup and you cannot subsequently edit those.

Settings that are only used as part of creation are:

  • Configure the Connection Settings (Ethernet/USB)
  • Set the Language
  • Whether to Force Standard Mode
  • Whether the panel supports Auto Enroll (Powermax+ and some Powermax Pro users must leave this Unticked, all other Panels, please Tick this)
  • Whether to Synchronize Time with the host (where HA is running), PowerMax Pro panels only
  • Set the Download Code for the EPROM
  • Set the Exclude Sensor list (do not create Sensors in HA for these)
  • Set the Exclude X10 list (do not create Switches in HA for these)

When you subsequently edit you can change the other settings.

Note that the download code can usually be left at the default of 5650, some panel types use AAAA as the default panel code. On many panels you can set the download code, on my panel the menus are INSTALLER MODE → 5. DEFINE COMM → 27: MAST. DL CODE. The download code is not the same as the installer code, please do not use your installer code for anything to do with this integration.

Specifically for PowerMaster users, by default it does not ask you for the experimental B0 settings. If you have a PowerMaster panel and want to use this you can edit an existing integration that is in Powerlink mode and the settings will be there to set/change.

One last thing about the integration, you can only have 1 Visonic Panel integration in HA (connected to a single physical panel). If you try to create a new visonic integration and you already have one, then it will tell you that you cannot create a second.

Achieving PowerLink Mode

For users that do not have a Powermax+ or a Powermax Pro panel, then you should be able to install the integration and it should automatically connect and start. Unless you are forcing the integration to remain in Standard Mode then it should achieve Powerlink Mode. For users that have a Powermax+ or a Powermax Pro panel then you will need to manually enroll the panel to achieve Powerlink Mode:

  • Start the integration in Home Assistant
  • Watch the panel (or the panel status in HA) and you should see it downloading the EPROM from the panel, this normally takes a minute or two.
  • Once it has completed downloading the EPROM from the panel, enter installer mode on the panel then INSTALLER MODE → 7. ENROLL PWRLNK → 01: INSTALL
  • This tells the panel to send an enrollment message to the integration which then tries to enroll with the panel. If successful, after a few moreminutes you should see the mode in HA go to Powerlink.
  • You can see the panel status by going in to "Developer Tools" and searching for the entity "alarm_control_panel.visonic_alarm". Look for the attribute "Panel Mode:".

The complete list of configurable settings

The complete list of configuration settings are defined below with their default value together with the full list of values.

Within the new Integration, No / Yes values are tick boxes. The first column indicates "*" when that setting is only used for the Creation of the integration. All other settings can be modified from within the HA integration "options".

C
Configuration Name
Default Description List of values
* Language EN Set the Language. EN for English, NL for Dutch or FR for French. EN, NL or FR
* Force Standard No Do not attempt to connect in Powerlink Mode, establish a Standard Mode connection only. No / Yes
* Auto Enroll Supported Yes Determine the ability for this Integration to auto-enroll prior to the panel type being known. Powermax+ and some Powermax Pro panels cannot auto enroll, those users need to set this to No. No / Yes
* Synchronise Time Yes Attempt to synchronise the time between the device you run HA on and the alarm panel. Powermax only, not Powermaster. No / Yes
* Download Code 5650 This is the 4 digit code used to download the EPROM and to Enroll for Powerlink. AAAA is also a known Download Code that may work if 5650 doesn't 4 digit string
* Exclude Sensor List A comma separated list of Zone Sensors to exclude e.g to exclude zones Z02 and Z03 then use 2,3 1,2 ... ,64
* Exclude X10 List A comma separated list of X10 devices to exclude e.g to exclude devices X02 and X03 then use 2,3. For PGM use 0 in the list. 0,1,2 ... ,15
Motion Off Delay Time 120 The time to keep the zone trigger True after it is triggered. There will not be another trigger for that sensor within this time period. Integer Seconds
Allow Remote Panel Arm No Determines whether the panel can be Armed from within HA. No / Yes
Allow Remote Panel Disarm No Determines whether the panel can be Disarmed from within HA. No / Yes
Override Code This is a 4 digit code that is used to arm, disarm, bypass and get the log, and allows you to override the code. See notes 1 and 2 below 4 digit hex string
Arm Without User Code No If the Panel is Disarmed, then Arm without the Usercode (your panel must support this). See note 2 below. No / Yes
Force use of a Keypad No Display the numeric keypad to force the user to enter the correct code. See note 2 below. No / Yes
Arm Away Instant No If set to Yes then arm away instant is used instead of a normal arm away. See Note 5 below. No / Yes
Arm Home Instant No If set to Yes then arm home instant is used instead of a normal arm home. See Note 5 below. No / Yes
Allow Sensor Bypass No If set to Yes then allow individual sensors to be bypassed (using the HA service) No / Yes
List of Trigger for Siren Intruder A list of reasons that the siren is sounding, you set this as this information is not obtained from the panel. See Note 6
List of Trigger for HA Notification See Note 7 A list of reasons to create a Notification in the Frontend of Home Assistant. See Note 7
Panel Log Entry Event No Generate an event within HA for each panel log entry (potentially hundreds). No / Yes
Panel Log XML Filename If this is set to something other than an empty string, create an xml file with the content of the panel event log using an xml template (Note 3 and 4) '' or 'validpath/filename.xml'
Panel Log CSV Filename If this is set to something other than an empty string, create a csv file with the content of the panel event log (Note 4) '' or 'validpath/filename.csv'
Panel Log CSV Add Title Row No If creating a csv file, then do or do not include a title row at the top No / Yes
Panel Log Completion Event No Generate an event within HA at the end of the log retrieval. As this could take tens of seconds, this HA Event marks the end. No / Yes
Panel Log Reverse Order No Reverse the order of the entries in the saved file(s) No / Yes
Panel Log Max Entries 10000 Retrieve at most this number of log entries. For example, set this to 1 to get the most recent, etc... Integer

Note 1: The use of this depends on how secure you make your system and how much you trust it.

Note 2: This note defines the combinations of the 3 parameters: Force use of a Keypad, Arm Without User Code and Override Code (assuming a valid 4 digit code). In addition, the effect of these parameters is also influenced by the Panel Mode (Standard, Standard Plus or Powerlink) and the current Panel State (Disarmed or Armed).

With reference to the table below, the first 5 columns constitute the input parameters to determine whether to show the keypad in the HA Frontend and what code to send to the panel. The 3 output columns indicate:

  • Is Keypad Shown : This indicates when the Keypad is show in the HA Frontend
  • Code sent to Panel : This indicates the actual 4 digit code that is sent to the Alarm Panel. "User code 1" is the first user code in your panel as obtained from the panels EPROM.
  • Extras : Where the Extra column has an A, some panels will arm with any 4 digit user code, including 0000.
Panel Mode Panel State
Arm Without User Code
Force use of a Keypad
Override Code Valid
Is Keypad Shown
Code sent to Panel Extra
All Any No Yes - Yes Keypad A
All Disarmed No No Yes No Override A
All Disarmed Yes - Yes No Override A
All Armed - No Yes No Override
All Armed Yes Yes - Yes Keypad
Standard Disarmed No No No Yes Keypad A
Standard Disarmed Yes - No No '0000' A
Standard Armed - No No Yes Keypad
Std+/Plink Any - No No No User code 1
Std+/Plink Disarmed Yes Yes No No User code 1

How do I use this Table?

  • Find the Panel Mode that your setup is in (Panel Mode column). All matches any Panel Mode.
  • Do you want to show the keypad to manually enter the arm/disarm code (Is Keypad Shown column)
  • Combine this with what Code you want sending to the Alarm Panel (Code sent to Panel column)
  • Find the Arm/Disarm combination (Panel State column), Any matches to both Arm and Disarm.
  • So by doing this you have narrowed down the rows that fits what you want, look at these closely to decide on the 3 configuration settings that you should consider using.

Note 3: This creates an xml file from an xml jinja2 template defined in a file called 'visonic_template.xml'. There is an example 'visonic_template.xml' file with this Custom Integration BUT it will not find that file (Home Assistant discourage user defined file settings in the custom components directories) so please copy it to one of the valid directories and alter if you wish to. The Integration uses the following directory locations to find the file, in order: ./templates, ./xml, ./www, '.' (where '.' is your configuration directory). The dictionary variables entries total and available are passed in to the jinja2 xml file for processing. Take a look at the example file and you should see what I mean.

Note 4: Be careful with the filename path, especially putting a leading "/". By default, if you do not specify a path, the file is created in your configuration directory.

Note 5: Arming Instant has an exit delay as normal but does not have an entry delay. Once armed, any detection will trigger an immediate alarm. Arm home instant is the most useful for me when setting an alarm overnight.

Note 6: The complete list of reasons that the siren may be sounding are "Intruder", "Tamper", "Fire", "Emergency", "Gas", "Flood", "X10", "Panic". Just to be clear, the Panel does not provide a direct indication that the external siren is sounding. Powerlink and Standard Plus Mode provide a more reliable and timely indication than Standard Mode but all methods need a combination of values from the panel. I’ve found that in Standard mode, the Panel is lazy in passing me the values.

Note 7: The complete list of reasons to create a Notification in the Home Assistant Frontend are:

  • Siren Sounding : The Siren is Sounding i.e. the Main Alarm has been Triggered
  • Panel Tamper : The Main Alarm Panel Tamper has been Triggered
  • Panel System Reset : The Panel has undergone a System Reset i.e. Enter and then Exit Installer mode on the Panel
  • Code Rejected By Panel : The 4 digit code has been rejected by the panel
  • Panel Operation : There has been an issue with downloading the panel EPROM data or there is a Watchdog Timeout
  • Connection Problems : This indicates when there is a connection problem with the Alarm Panel
  • Sensor Bypass Problems : If you try to Bypass a Sensor, this indicates specific problems
  • Event Log Problems : This indicates when there have been problems getting the data and then writing it to the log files
  • Command Not Sent To Panel : There are many data checks performed before a command is sent to the Panel, these are indicated here.

The default settings are: Connection Problems and Siren Sounding

Further Notes:

  1. You do not need to use the Master Installer Code from your panel with this integration, please keep that a secret.
  2. Only 1 Home Assistant Notification will be generated at a time, you must "Dismiss" it before you may get future notifications.

The Download Code setting

To connect in Standard Plus and Powerlink mode, the Integration uses a special Download Code to download the EPROM data from the panel (this is not the Master Installer Code). The Download Code defaults to "5650" (for those with ASCII knowledge this is hex for the characters VP for Visonic Panel I believe), but you can override it in the configuration when creating the integration.

The default Download Code seems to vary across the different panel models and seem to have 1 of 2 download codes if you haven't changed them. The 2 possible default download codes seem to be "5650" or "AAAA". So if you don't get to Standard Plus or Powerlink modes then try deleting and recreating the integration and overriding the download code to "AAAA".

In addition, some panels allow you to set the download code using the panels menu. For example, on a UK Powermax Pro using the menus: 5.Define Communication=>C.S. Reporting=>PSTN Up/Down, in this menu there is a Master Download Code setting and an Installer Download Code setting the default to AAAA and 0000 respectively. You could change the Master Download Code within your alarm panel and then set it in the settings for this Integration. Do not set the download code to 0000 in your panel settings as I believe that this disables EPROM download from your panel (or perhaps it will then only use the installer code which you don't want to do).

Home Assistant device_class

In Standard Plus & Powerlink Modes, I try to set the device class correctly by default however I don't know if a particular perimeter sensor "magnet" is on a door or window for example. By default I set all:

  • "PIRs" to device_class "motion"
  • "magnet" to device_class "window"
  • "wired" to device_class "door"

You can change this in your customize configuration file customize.yaml like this for example

    "binary_sensor.visonic_z04":
      friendly_name: 'Kitchen Door'
      device_class: door

You will find the various settings for device_class here

For Standard Mode I do not get any information from the panel so you can use this method to set the device class in Home Assistant.

Home Assistant Panel Services

The Integration responds to some of the built in HA Alarm Panel Services. The first 3 are HA built in, the other 4 I have added.

Name Code Description
alarm_control_panel.alarm_arm_away Optional Arm the panel away e.g. "entity_id":"alarm_control_panel.visonic_alarm"
alarm_control_panel.alarm_arm_home Optional Arm the panel home e.g. "entity_id":"alarm_control_panel.visonic_alarm"
alarm_control_panel.alarm_disarm Optional Disarm the panel e.g. "entity_id":"alarm_control_panel.visonic_alarm"
visonic.alarm_sensor_bypass Optional Bypass/Arm individual sensors (must be done when panel is disarmed). e.g. "entity_id":"binary_sensor.visonic_z01", "bypass":"True"
visonic.alarm_panel_eventlog Optional Retrieve the panel event log and process it.
visonic.alarm_panel_command Optional Send Arm / Disarm commands to the panel (Note 1) e.g. "Command":"ArmAway"
visonic.alarm_panel_reconnect Reconnect following a previous problem.

Note 1: The "Command" is set to one of 'ARM_AWAY', 'ARM_AWAY_INSTANT', 'ARM_HOME', 'ARM_HOME_INSTANT', 'ArmAway', 'ArmAwayInstant', 'ArmHome', 'ArmHomeInstant', 'Arm_Away', 'Arm_Away_Instant', 'Arm_Home', 'Arm_Home_Instant', 'DISARM', 'Disarm', 'arm_away', 'arm_away_instant', 'arm_home', 'arm_home_instant', 'armaway', 'armawayinstant', 'armhome', 'armhomeinstant', 'disarm'

These are all case sensitive.

In the first 6 services the "code" service data is optional and is only needed in Standard Mode. However, if it is set in any of the connection modes then it is used.

Just to note that alarm_control_panel.alarm_arm_away has the same effect as visonic.alarm_panel_command with different service data. This is similar for alarm_control_panel.alarm_arm_home and alarm_control_panel.alarm_disarm.

Home Assistant Panel Events

The Integration generates these events on the HA event bus. Events are part of HA and I generate an HA event for many things such as changes in the panel or sensor states. Panel events include the detailed panel state data.

To see them in action in your own HA, go to “Developer Tools”, “Events” and in the bottom where it says “Listen to events” paste visonic_alarm_panel_state_update and click “start listening”. Then do things with your alarm panel such as trigger sensors, arm and disarm, you should see what I mean. You should be able to see the events on the same webpage in the HA Frontend.

Name Description Event Data
visonic_alarm_panel_event_log_entry When the event log is being downloaded, an HA event for every panel log entry (if enabled in configuration) see Note 1 below
visonic_alarm_panel_event_log_complete When the event log from the panel has been downloaded (if enabled in configuration) None
visonic_alarm_panel_state_update An HA Event for various panel and sensor changes condition (see Note 2 below)

Panel Event Log HA Events (Note 1)

This describes the HA event data associated with the visonic_alarm_panel_event_log_entry HA event. The list of HA event data parameters for each log entry (that you can also use in the jinja2 xml settings file)

Data Type Description
current Integer The current event log entry
total Integer The total number of event log entries
data Date The date of the event in the historical log
time Time The time of the event in the historical log
partition Integer The panel partition
zone String The Zone of this log
event String The detailed Panel Event

Panel and Sensor HA Events (Note 2)

This describes the HA event data associated with the visonic_alarm_panel_state_update HA event. This is quite complicated but I have tried to make it as easy to understand as possible. I suggest that you view the events live in the developer tools (Events) in combination with this description to try to understand the structure before you use it in your Automations.

The data that appears in every visonic_alarm_panel_state_update HA event is condition: X where X is 0 to 14.

When the condition is set to 11, 12, 13, or 14 then there has been a problem BEFORE the command has been sent to the panel. In other words, these are NOT panel status events, they represent feedback (usually errors) from the Integration itself.

Most of the events do not have any other associated data (other than condition) but some do, the Data Set column indicates which events have additional data associated with them and which of the 3 data sets A, B or C.

X
Meaning
Command
Data Set
0 Problem with the Integration itself (This is usually a communication failure with the panel)
1 Zone update A
2 Panel update B
3 Panel update AND the alarm is active B
4 Panel reset B
5 Pin rejected
6 Panel Tamper alarm
7 EPROM download timeout, go to Standard Mode
8 Watchdog timeout, staying in current mode
9 Watchdog timeout, going to try to get a better mode
10 There has not been any data received from the panel
11 Arm/Disarm feedback "disarmed", "stay", "armed", "stayinstant", "armedinstant" C
12 Bypass feedback "bypass" C
13 Event Log feedback "eventLog" C
14 X10 feedback "x10" C

Data set A

This represents the Zone State and is used when the event condition is set to 1

Data Item Description
'Zone' The Zone (integer 1 to 64)
'Event' The Event as an Integer range 0 to 20 (see below)
'Description' This is a Description of the Event as a String (see below)

The Event is an integer in the range 0 to 20 and the table below shows the Description in English, in your integration it will appear in your chosen language (EN, NL, FR).

Event Description
0 None
1 Tamper Alarm
2 Tamper Restore
3 Open
4 Closed
5 Violated (Motion)
6 Panic Alarm
7 RF Jamming
8 Tamper Open
9 Communication Failure
10 Line Failure
11 Fuse
12 Not Active
13 Low Battery
14 AC Failure
15 Fire Alarm
16 Emergency
17 Siren Tamper
18 Siren Tamper Restore
19 Siren Low Battery
20 Siren AC Fail

Data set B

This represents the Panel State and is used when the event condition is set to 2, 3 or 4.

Notes:

  • 'Type', 'Mode', 'Event' and 'Name' are lists (arrays) that are referenced from 0 to 'Count' - 1
  • 'Count' is usually set to 0 or 1 but it can go to a maximum of 4.
  • If 'Count' is 0 then the lists are empty
  • If 'Count' is 1 then the lists have a single entry, referenced as e.g. data['Type'][0]
  • 'Type' and 'Mode' represent the same thing but as an integer and a string.
  • 'Event' and 'Name' represent the same thing but as an integer and a string.
Name Description
'Zone' The Zone that caused this panel state change (if zero then invalid)
'Entity' The Entity in this panel state. You can use this to directly get the sensor entity data in automations
'Tamper' Panel Tamper (True or False)
'Siren' Is the siren sounding (True or False)
'Reset' Has the panel had a system reset (possibly by exiting installer mode on the panel) (True or False)
'Time' The creation time
'Count' How many messages in the Type, Event, Mode and Name lists
'Type' A list of integers representing an action that has taken place
'Mode' A list of the string representations of the Type list
'Event' A list of integers representing the event that has taken place
'Name' A list of string representations of the Event list

Data set C

This represents the Panel State when the event condition is set to 11, 12, 13 or 14. This is feedback from HA when this components Services are used, from BEFORE the command is sent to the Alarm Panel.

Name Type Description
'Command' String One of "disarmed", "stay", "armed", "stayinstant", "armedinstant", "bypass", "eventlog" or "x10"
'Reason' Integer Depends on which event 'Command', one of 0, 1, 2, 3, 4 or 5 (See Note 1)
'PanelReady' Boolean The Panel Ready state (True or False)
'OpenZones' String List A list of Zones that are open (i.e. not closed)
'Bypass' String List A list of Zones that are bypassed
'Tamper' String List A list of Zones that have the 'raw' tamper set
'ZoneTamper' String List A list of Zones that have the "logical" tamper set

Note 1: Each 'Command' has the following reasons.

X
Meaning
Command
Reason
11 Arm/Disarm feedback "disarmed", "stay", "armed", "stayinstant", "armedinstant" 0,1,2,3,4
12 Bypass feedback "bypass" 0,1,2,3
13 Event Log feedback "eventLog" 0,1,2
14 X10 feedback "x10" 0,1,5

Reasons 0 to 5 are:

Reason Meaning
0 Success, Sending Command to Panel
1 Not sending command to panel, Request only supported when not downloading EPROM
2 Not sending command to panel, not allowed without valid pin
3 Not sending command to panel, user configuration setting prevented access
4 Not sending command to panel, invalid state requested
5 Not sending command to panel, general X10 Problem

Home Assistant Automation Examples

- alias: Alarm Armed So Turn Lights Off
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.visonic_alarm
    to: armed_away
  action:
  - service: script.alarm_armed

- alias: Alarm Disarmed So Email Me
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.visonic_alarm
    to: disarmed
  action:
  - service: script.alarm_disarmed

- alias: 'Alarm Siren Triggered Action'
  initial_state: true
  trigger:
    platform: event
    event_type: visonic_alarm_panel_state_update
    event_data:
      condition: 3
  action:
    service_template: persistent_notification.create
    data_template:
      title: "Alarm Siren"
      message: "{% set ety = trigger.event.data['Entity']|string %}
                {% if ety == 'None' %}
                    Alarm siren from unknown sensor
                {% else %}
                    The Sensor that triggered the Siren is the {{ state_attr(ety, 'friendly_name') }}
                {% endif %}"

- alias: 'Alarm Panel Arm/Disarm Request Action'
  initial_state: true
  trigger:
    platform: event
    event_type: visonic_alarm_panel_state_update
    event_data:
      condition: 11
  condition:
    condition: template
    value_template: >
      {{ trigger.event.data.reason in [1,2,3,4] }}
  action:
    service_template: persistent_notification.create
    data_template:
      title: "Alarm {{ trigger.event.data.Command|title|string }} Request Failed"
      message: "{% set st = trigger.event.data.OpenZones %}
                {% if st|length > 1 %}
                    There are open zones, check the following
                    {% for ent in st %}
                        {{ '\n' ~ ' '|safe*30 ~ state_attr(ent, 'friendly_name') | string }}
                    {% endfor %}
                    \n
                {% elif st|length == 1 %}
                    The {{ state_attr(st[0], 'friendly_name') | string }} is open \n
                {% endif %}
                {% set ta = trigger.event.data.Tamper %}
                {% if ta|length > 1 %}
                    There are zones with Tamper alarms, check the following
                    {% for ent in ta %}
                        {{ '\n' ~ ' '|safe*30 ~ state_attr(ent, 'friendly_name') | string }}
                    {% endfor %}
                {% elif ta|length == 1 %}
                    The {{ state_attr(ta[0], 'friendly_name') | string }} has Tamper set
                {% endif %}"

- alias: 'Alarm Panel Bypass Reject Action'
  initial_state: true
  trigger:
    platform: event
    event_type: visonic_alarm_panel_state_update
    event_data:
      condition: 12
  condition:
    condition: template
    value_template: >
      {{ trigger.event.data.reason|int in [1,2,3,4] }}
  action:
    service_template: persistent_notification.create
    data_template:
      title: "Bypass Request Failed"
      message: "{% set st = trigger.event.data.OpenZones %}
                Could not make the request to your alarm panel \n {{ trigger.event.data.Message|string }}
                {% if st|length > 1 %}
                    Also there are open zones, check the following
                    {% for ent in st %}
                        {{ '\n' ~ ' '|safe*30 ~ state_attr(ent, 'friendly_name') | string }}
                    {% endfor %}
                {% elif st|length == 1 %}
                    Also, the {{ state_attr(st[0], 'friendly_name') | string }} is open
                {% endif %}"

Of course you'll have to write your own scripts!

Attributes of the Alarm Panel Entity

This section shows the attributes that are created for the alarm_control_panel.visonic_alarm Entity.

Most of the attributes are created directly from the downloaded EPROM data that you can use in Automations etc. For attributes that start with a lower case letter, these are built-in HA attributes.

The following attributes are created from the data that is obtained from the panel using the various message data

Name Type Description
'Panel Status Code' Integer This is an integer representation of the main panel state. See Note 1
'Exception Count' Integer Counts how many comms disconnections there has been
'Download Timeout' Integer Counts how many failed attempts to download the panel EPROM data
'Watchdog Timeout' Integer Counts how many watchdog timeouts there has been (interruptions but not disconnected)
'Panel Mode' String Set to one of "Unknown", "Problem", "Starting", "Download", "Standard", "Standard Plus", "Powerlink"
'Model' String The model type of the alarm panel (or "Unknown")
'Panel Name' String The alarm panel name, type number and model number
'Door Zones' List of Strings A list of the Magnetic sensor names
'Motion Zones' List of Strings A list of the Motion sensor names
'Smoke Zones' List of Strings A list of the Smoke sensor names
'Other Zones' List of Strings A list of the Other sensor names
'Devices' List of Strings A list of the X10 switch names
'Power Master' String The Integration is connected to a PowerMaster series Panel, set to 'yes' or 'no'
'Panel Status' String See Note 2
'Plugin Version' String Set to the current plugin version
'Panel Ready' String Is the Panel Ready, set to 'yes' or 'no'
'Panel Alert In Memory' String Is there an alert in panel memory, set to 'yes' or 'no'
'Panel Trouble' String Is the Panel in the Trouble state, set to 'yes' or 'no'
'Panel Bypass' String Is the Panel Bypass set, set to 'yes' or 'no'
'Panel Armed' String Is the Panel armed, set to 'yes' or 'no'
'Panel Status Changed' String Has the panel state changed, set to 'yes' or 'no'
'Panel Alarm Event' String Has there been a Panel Alarm event, set to 'yes' or 'no'
'Panel Siren Active' String Is the Panel Siren Active, set to 'yes' or 'no'
'Panel Last Event' String Shows the last Panel Event, set to a mode string, a forward slash and then the zone string
'Panel Alarm Status' String The Panel Alarm Status, set to "None", "Intruder", "Tamper", "Panic", "Fire", "Emergency", "Gas", "Flood"
'Panel Trouble Status' String The Panel Trouble Status, set to "None", "Communication", "General", "Battery", "Power", "Jamming", "Telephone"
'Panel Last Event Data' Structure This is a data dictionary that contains a lot of information representing the state of the Panel

Note 1

  • -1 = Panel State Undefined (during Startup)
  • 0 = Disarmed
  • 1 = Arming Home
  • 2 = Arming Away
  • 3 = Entry Delay
  • 4 = Armed Home
  • 5 = Armed Away
  • 6 = Special ("User Test", "Downloading", "Programming", "Installer")

Note 2: Set to one of "Unknown", "Disarmed", "Home Exit Delay", "Away Exit Delay", "Entry Delay", "Armed Home", "Armed Away", "User Test", "Downloading", "Programming", "Installer", "Home Bypass", "Away Bypass", "Ready", "Not Ready", "Disarmed Instant", "Home Instant Exit Delay", "Away Instant Exit Delay", "Entry Delay Instant", "Armed Home Instant", "Armed Away Instant"

Extra Hidden Functionality

There are 2 extras that I include in the release

Using Powermaster Remote Programmer

If you connect to your panel using USB then you can plug that USB in to your Windows PC and use the Visonic Remote Programmer software directly

Download the software here

The user manual is here

You'll find the login username and password in the user manual.

"Powermaster Remote Programmer" Bridging

You can use the "Powermaster Remote Programmer" (PRP) from a Windows PC to connect to your panel if using the Ethernet option

  • Download and setup com0com on your PC with a Virtual RS232 connection using COM1 and COM2 (assuming these aren't existing real devices on your Windows PC)
  • Run bridge.py from a command prompt and connect to COM1 like this
python3 bridge.py -address 192.168.X.Y -port YourPort -usb COM1
  • Run PRP and connect to COM2

You can then use PRP with your panel, the bridge command prompt displays the messages going to/from the panel

The bridge can also be used to connect two COM ports together like this

python3 bridge.py -coma COM1 -comb COM2

For Testing without Home Assistant

I have included 2 python scripts that can be used for testing, they are located in the examples sub-directory. Disable the Integration in HA (or disable HA altogether) and use these scripts from a command line.

To install the necessary python libraries you must have an internet connection and type this

pip3 install -r requirements.txt

On Linux you may need to be logged in as root. Also, pip may need to be used instead of pip3.

There are 2 test scripts: a simple script that has a fixed interaction with the panel and a console based script using the library aconsole. Both can use ethernet or USB as the connection type and are configured from the command line.

python3 simple_example.py -address A.B.C.D -port YourPort
On Linux:   python3 simple_example.py -usb /dev/ttyUSB1
On Windows: python3 simple_example.py -usb COM1

Where A.B.C.D is the IP address of the hardware device you have in your panel e.g. 192.168.0.20

It will perform as it does in HA but from the command line.

Note that the other settings from the configuration can be changed by editing either test file and changing the settings in "myconfig", these are the default values. With complete_example you can also change the settings from within aconsole, remember that some settings need you to disconnect and then connect to the panel. Type "v" for the variables list and to make a change type the number, an equals sign and then the new setting.

There is a console based test script.

python3 complete_example.py -address A.B.C.D -port YourPort
On Linux:   python3 complete_example.py -usb /dev/ttyUSB1
On Windows: python3 complete_example.py -usb COM1

Hint: click in the bottom box of the aconsole and type "c" and then enter to connect, you'll see what I mean. Type "h" enter for help.

Troubleshooting

Getting the Panel to Connect to Home Assistant

If you have connected everything up and nothing works then set the HA logger settings to debug for this integration (see below). Go in to your config directory and view the HA log file home-assistant.log

Do you get [data receiver] entries in the log file. If not then we are not receiving any data from your alarm panel.

Especially if you get this in the log file:

[custom_components.visonic.client] Failed to connect to your Visonic Alarm. We have not received any data from the panel at all, not one single byte.

Then there is no data coming from your panel and something is wrong with your hardware setup, port configuration or basic software configuration (outside of HA). If you're using a virtual machine or using docker then you may also need to pass through the USB/Ethernet connectivity for example.

If you are getting [data receiver] entries in your log file then you are receiving some data from your panel, but you may still not get it working properly. So you've got it partially working but it's not quite there.... what can you do.

From experience, if the panel isn't doing what you think it should then leave it alone for a few hours. I believe, although I am not sure, that it has some kind of anti-tamper in the software for the RS232 interface and it stops allowing Powerlink connectivity. This is especially the case when you have been trying over and over again, eventually the panel stops interacting or, even worse, just starts sending the same message over and over again.

  • I try to get it in to Standard Plus or Powerlink mode but it only goes in to Standard mode

    • Check that force_standard is set to 'no'
    • If you have had anything connected to the panel in the past that has been in Powerlink mode then Do a Full Restart (see below what I mean *).
  • I try to get it in to Powerlink mode but it only goes in to Download mode

    • Has it been like this for less than 4 minutes, then wait as it can take a long time with some devices and panels
    • So it's more than 4 minutes, OK. Do a Full Restart Sequence as defined below.
    • Send me a log file (see below)

(*) Full Restart Sequence for Powerlink:

  • Stop HA
  • Restart the panel: Restart your Visonic panel by going in to and out of installer mode. Do not do any panel resets, the act of exiting installer mode is enough.
  • Wait for a couple of minutes for the panel to restart
  • Start HA.

Tips and Tricks

You have it working using ethernet/wifi but it occasionally disconnects and doesn't reconnect

If you have it working but it occasionally disconnects (after hours or days of working OK) with the following in the log file

ERROR Connection Lost : disconnected because the Ethernet/USB connection was externally terminated.

This means that the connection between the Home Assistant device and the device in your alarm panel has been interrupted i.e. the TCP connection has been broken. If you are using wired ethernet then it is most likely that your home router is either re-booting itself or it is re-assigning IP addresses i.e. probably renewing the DHCP lease for the devices. If you are using wifi then as well as the above possibilities, it could also because you have a weak wifi signal that is dropping out. Is this a possibility? If it is then there is nothing I can do to help. If the connection between Home Assistant and the panel is lost, this will make my integration attempt to reconnect to the panel, it should succeed but sometimes it doesn't. Note also that restarting the integration in any way has the same error in the log file, are you calling the Home Assistant restart service?

When the siren is triggered, nothing shows in Home Assistant

First of all, you must have Home Assistant connected to your Alarm Panel in Powerlink Mode for this to work. Everything else should be working, except that when the siren is triggered, nothing shows up in Home Assistant. The Alarm Panel can be configured to provide a delay before reporting an alarm to the monitoring station (not applicable to alarms from FIRE, 24H SILENT, EMERGENCY, GAS FLOOD and TEMPERATURE zones). During this delay period, the external siren will not sound and the alarm is not reported. If the user disarms the system within the delay time, the alarm is aborted (and is not sent to Home Assistant). In this case, Home Assistant acts like a monitoring station as it is connected and mimics a Powerlink device.

In the alarm_control_panel.visonic_alarm Entity attributes in Home Assistant, find "Abort Time". This should be set to None.

On a PowerMaster the menu is: "10:ABORT TIME" under Operating Mode in the Installer Options, change it to 00 seconds.

Tamper setting for the Zones

I’ve done some experimenting and I think there are 3 tamper values. The first is the Main Panel Tamper, this is an attribute of alarm_control_panel.visonic_alarm called Tamper (the panel sends this through in the panel settings PDU A7).

Each zone then has 2 Tamper values, a zone tamper and a device tamper (through the zone settings PDU A5 message). I think that the device tamper is the raw data and the zone tamper is more like a logical setting.

Using a Supervised System (based on Debian) with a USB-to-serial adapter

If Debian is loaded with the USB-to-serial adapter plugged in the host, the OS will detect the serial device and assume it’s associated with a braille display. As a result, the brltty daemon will be loaded which prevents the Visonic integration from using the tty port. It has been this way for at least 8 years (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=721763).

To detect if brltty is running, you can look for issues with the following commands

sudo dmesg | grep tty
sudo dmesg | grep USB
ps -ax | grep brltty

To remove brltty, the following commands can be used

sudo apt-get remove brltty
sudo apt autoremove

Alternately, brltty can be avoided by unplugging the USB serial cable prior to loading Debian.

Ubuntu, Ensure Modem Manager isn’t running

Ensure Modem Manager isn’t running. It’s not loaded by default on Debian, but I’m guessing it could be an issue on a Container or Core installation.

If it's a problem, these commands (or similar) should work:

To disable Modem Manager:

sudo systemctl stop ModemManager
sudo systemctl disable ModemManager

To remove it:

sudo apt remove modemmanager

Panel Interactions

For those interested I'm starting to document the details of the protocol to/from the panel.

We send and receive "Protocol Data Units" (PDU) to/from the panel. For the Visonic Panels, a complete PDU is constructed like this:

    A PDU header (0x0d)
    A PDU identifier byte
    The Message (0 or more bytes)
    A PDU checksum byte
    A PDU footer (0x0a)

All data will be represented as hex (as is the data above)

This is an example PDU received from the panel 0d a5 00 04 00 61 03 05 00 05 00 00 43 a4 0a

Most PDUs are of a fixed number of message bytes and so they are a fixed overall size. In the example, an "a5" PDU is always 15 bytes in total.

There are 3 PDUs that I cannot yet interpret

  • "F1" are variable length PDUs sent only by a Powermax+ panel
  • "22" no idea
  • "b0" are PDUs that are only sent by a Powermaster series panel. They give sensor updates I think but the functionality for this is very experimental.

Logger settings

If there are problems then set your logger: to output debug data to the log file for the visonic integration. The Home Assistant log file is called home-assistant.log and is located in your configuration directory. You'll have to upload your log file to pastebin, dropbox (or another) and put a link in your post so I can get it. Also, give me a bit of a description as to what you have tried and what goes wrong, what do you see in the frontend. Please post for help on the HA forum and not as an issue on Github, unless it is a properly confirmed issue.

In your configuration.yaml file do it exactly like this so I only get logged data from my Integration. You may have to comment out your existing logger: entry and replace it with this temporarily.

logger:
  default: error
  logs:
    custom_components.visonic: debug
    pyvisonic: debug
    custom_components.visonic.pyvisonic: debug
    custom_components.visonic.alarm_control_panel: debug
    custom_components.visonic.binary_sensor: debug
    custom_components.visonic.switch: debug
    custom_components.visonic.client: debug
    custom_components.visonic.config_flow: debug
    custom_components.visonic.create_schema: debug
    custom_components.visonic.__init__: debug

Other Useful Information

The Startup Control Flow

I have worked on the control flow (instead of copying the control flow from other plugins used in other devices) and have altered it so it is more reliable for my panel, I believe that it removes some (or all?) of the timing dependencies. For those interested in the startup control flow.....

  • At Integration start, it checks the "Force Standard" user setting. If set it goes directly to Standard Mode and stays there.
  • If "Force Standard" is not set then it tries to Download the EPROM data from the panel.
    • If this fails immediately then it keeps retrying every 4 minutes.
    • If it fails part way through the download there is something more seriously wrong and it goes to Standard Mode and stays there.
    • The Download step itself takes about 40 seconds on my panel,
  • When EPROM Download succeeds is goes to Standard Plus mode.
    • I get Standard Plus Mode within a minute or so of starting HA.
    • I expect that most people will be happy to get it to Standard Plus mode.
  • It then starts trying to Enroll as a Powerlink device,
    • Trying every 4 minutes.
    • It can't try too often as the panel just blocks the communication, thinking that it's an attack I think, so 4 minutes seems OK
    • I get Powerlink Mode within 2 minutes of starting HA
    • Sometimes it fails the first time (fails to Enroll) and it works the next time around, so about 5 minutes after starting HA
    • For some older panel, you need to manually enroll a powerlink module in your control panel menu

In other words, the Integration continues to try and do the best it can and doesn't give up like previous versions. Previous versions attemped Powerlink enrollment (3 times) and if that failed did not then attempt to Download the EPROM. It now does it the other way around and keeps trying. If I get problems with it trying too often then I may need to limit it.