Skip to content
davesmeghead edited this page Aug 30, 2024 · 99 revisions

Buy me a coffee

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.

At the current time you cannot use the PowerLink Hardware Module at the same time as using this Home Assistant Integration. You cannot use the VisonicGo App with this Integration. However, this is currently under investigation.

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 template as here in HA.

Supported Visonic Panels

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

Panel Model
Comment
Powermax This Alarm Panel does not work with this Integration. After extensive work, this Panel is not able to be used as it does not support the Powerlink protocol that this integration relies on.
Powermax+ This will work but needs to be Manually Enrolled. Note 1
Powermax Pro This will work but needs to be Manually Enrolled. Note 1
Powermax Complete This will work and will auto enroll.
Powermax Pro Part This will work and will auto enroll.
Powermax Complete Part This will work and will auto enroll.
PowerMax Express This will work and will auto enroll.
Powermaster 10 This will work and will auto enroll. Note 2
Powermaster 30 This will work and will auto enroll. Note 2
Powermaster 33 This will work and will auto enroll. Note 2
Powermaster 33 This will work and will auto enroll. Note 2
Powermaster 360 This only works in Standard Plus Mode (see later) with this Integration. Notes 2 & 3.
Powermaster 360R This only works in Standard Plus Mode (see later) with this Integration. Notes 2 & 3.

Note 1, 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.

Note 2, you may need to disable the battery saver in your PIR sensors to get motion triggers when the alarm is Disarmed. When the PIRs are first installed they default to only sending their detections when the panel is Armed. If you also want to receive 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.

Note 3, Visonic Powermaster 360 and Visonic Powermaster 360R Alarm Panels have the PowerLink hardware built in to the Panel itself. As such, the best Emulation Mode that can be achieved to interact with Home Assistant is Standard Plus Mode (see later). However, there are limitations in capability: The only way to connect to the Panel is by using a USB cable to a PC (and maybe a Raspberry Pi). Also, Sensor trigger events from the Panel seem to take a long time.

One more thing before you go any further ... Security

I take no responsibility for the security of your system, it is all your responsibility. The message data between this Integration and your panel is not encrypted or obfuscated in any way. When you Arm, Disarm and request the panel log file then the Panel User Code is embedded in the message data to your panel.

Supported Panel Functionality

Multiple visonic alarm panels are supported and are integrated in to the same Home Assistant.

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

  • HA Binary Sensor for each alarm sensor
  • HA Select for each alarm sensor to provide Bypass/Armed selection
  • HA Switch for each X10 device
  • Alarm Panel integration Entity so you can:
    • Look at and use the internal state values
    • 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
  • 3 HA Events for several triggers from the sensors and the panel to use in your Automations.

What it doesn't do in Home Assistant

  • Partitions, it currently assumes a single partition for each Alarm Panel.

Installing the Software in to HA

This section tells you how to install the software part of the Integration in to Home Assistant. For Hardware setup see Hardware Setup.

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. 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).
  2. Using HACS. This integration is part of the HACS system so you should be able to search and find it (after installing HACS of course).

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

The Visonic 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 Emulation Mode you want to request: Minimal, Standard or Powerlink. Let's look at these as follows .....

The Different Emulation Modes

There are different Emulation Modes used 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 Emulation Mode but that cannot always be achieved, read on to see why.

You can request Minimal, Standard or Powerlink Emulation Mode when you create and set up this Integration in Home Assistant. If you request Powerlink and that cannot be achieved (for whatever reason) then Standard Plus Emulation Mode may be achieved, and if not that then Standard Emulation Mode. Note that you cannot request Standard Plus Emulation Mode.

Just for ease of reading in the rest of this description, the word Emulation is omitted for brevity, but these are all Emulation Modes, 4 in total, 3 of which you can request in the Integration Configuration Settings.

Some panels allow arming without the user code. If the Integration connects in Standard Plus or Powerlink Mode then it automatically gets the user codes from your Alarm Panel to arm and disarm, and you do not need to set them in Home Assistant (unless you want to). Note that to arm and disarm the Alarm Panel from Home Assistant you must also set the Configuration Settings to permit this i.e. Allow Remote Panel Arm and Allow Remote Panel Disarm.

Minimal Mode (data only sent to the Panel to obtain panel state)

This is the most basic mode of operation. The Integration has minimal interaction with the Panel and does not allow any commands to be sent to the Panel such as Arm or Disarm. Not all information is available for the Sensors, critically the sensor type is missing so in Home Assistant it looks like a default binary sensor. In addition an Alarm Panel Entity is not created in Home Assistant. Instead a Home Assistant Sensor e.g. sensor.visonic_alarm is created to provide state information only. The EPROM data is not downloaded from the alarm panel and so no Alarm Panel user-codes are retrieved and stored within Home Assistant.

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, again the sensor type is missing. You can arm and disarm the panel by either setting the Panel Code in the Alarm Panel Entity that is created or by entering the code each time manually from the HA Frontend. The EPROM data is not downloaded from the alarm panel and so no Alarm Panel user-codes are retrieved and stored within Home Assistant.

Standard Plus Mode

You cannot request this Mode, the Integration is in this Mode when Powerlink Mode was requested but cannot be achieved (as described above). Standard Plus is achieved when trying to get to Powerlink Mode but the alarm panel refuses in some way. The functionality is 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.

Powerlink Mode

From a Home Assistant functionality view point, there isn't much difference between Standard Plus and Powerlink Modes. 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.

When Powerlink Mode is requested then the Integration:

  • First attempts to download the EPROM data from the Panel,
    • If this fails (after retries) then the Integration enters and remains in Standard Mode.
  • If EPROM data is retrieved from the Panel, the Integration then tries to interact with the Panel using the special Powerlink messages.
    • If this fails then the Integration enters and remains in Standard Plus Mode.
  • If it succeeds then the Integration enters Powerlink Mode.
    • If the Integration has any interruptions in these Powerlink messages then it may enter a Problem state and revert back to Standard Plus Mode whilst it re-establishes the Powerlink messages with the Panel.

Currently, the integration tries to get to Powerlink Mode as follows:

  • For Powermax+ and Powermax Pro users the panel asks the integration to manually enroll. See further down on this page.
  • For all other (supported) panel types, the integration makes 4 attempts over 9 minutes (3 minute gap) to auto-enroll powerlink with the panel.
  • Remember that Powerlink Mode is not possible with 360 and 360R Panels. However, if Powerlink Mode is requested then Standard Plus may still be achieved.
Why would I want to use Minimal or 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 use Minimal or Standard 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 use Standard Mode and enable remote arm and disarm through this Integration (you're presented with a keypad in Home Assistant). Perhaps just enable remote arm but not disarm in the configuration options.
  • For those that have a bit more trust then use Standard Mode, enable remote arm and disarm through this Integration and set your User Code in the Alarm Panel Entity within Home Assistant (no keypad needed).
  • For those that have full trust, request Powerlink Mode, get the emulation connection to at least Standard Plus (but hopefully Powerlink) and enable remote arm and disarm through this Integration (no need to set your User Code in the Alarm Panel Entity within Home Assistant and no keypad needed).

Integration Creation, Modification and Deletion from within Home Assistant

You configure this integration from the Integrations page within Home Assistant. Note that the configuration.yaml file set up is no longer supported for this Integration.

You do this by navigating to the integrations page, selecting the "+ Add Integration" at the bottom right 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. Note that deleting the integration stops everything working and terminates the connection with the panel but it does not remove all the frontend (lots of "Entity Not Found"). You can also Reload the integration, this is a combination of delete and create, it stops and restarts the integration with the same settings.

You can edit some of the settings for the Integration by selecting the "Configure" in the Home Assistant Integration Page. Some of the settings are only used at Creation and you cannot subsequently edit those.

Settings that are only used as part of Creation are:

  • Configure the Connection Settings (Ethernet/USB)
  • Set the Panel Number (see Multiple Visonic Alarm Panels below)
  • Set the Language of Panel Derived Data
  • 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)
  • Set the Download Code for the EPROM
  • Set the Panel Emulation Mode (Minimal, Standard or Powerlink Emulation Mode)
  • Whether to show the full set of Attributes in the Alarm Panel Entity

When you subsequently select "Configure" you can edit and change all other settings (but not the above list).

Note that the EPROM download code can usually be left empty, the Integration then uses the default value of 5650 and/or AAAA as the panel code. On many panels you can set the download code using the panel menus, for example on a PowerMax Pro Part 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.

Multiple Visonic Alarm Panels

The Integration supports multiple Alarm Panels, simply configure each panel from the Integration page within Home Assistant.

In the configuration, when you first set up each Panel Integration, you set the Panel Number. The Panel Number must be unique (across all panels) otherwise Home Assistant gets confused and starts naming Entities incorrectly. Because of this, during the start-up of Home Assistant or after you set-up a new Panel, if the Integration detects a Panel Number that has already been used it will not set up the Panel (and fail to set up the Integration). If this occurs then you may need to delete the Integration (just for that Panel) and set up the Panel again.

Panel and Entity Numbering:

  • Panel 0 creates Entities without a "px" in their names where x is the panel number, for example "binary_sensor.visonic_z01"
  • Other Panels include the panel number in the Entity names e.g. Panel 2 would create Entities with "p2" i.e. "binary_sensor.visonic_p2_z01"

All panels use a common set of Events within Home Assistant. All Events include a "panel" attribute that is an Integer. This panel attribute is what you have set when you created the Panel.

Achieving PowerLink Mode by Manually Enrolling

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 have requested the integration is to remain in Minimal or 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 more minutes 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" (for panel 0). Look for the attribute "Panel Mode:".
  • You should only need to do this once. The first time after you install the hardware you need to do this on your panel (and occasionally after that when you restart Home Assistant and it stops working)

Configuration Settings

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

Within the 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 "Configure".

Also please remember:

  1. You do not need to use the Master or Normal Installer Codes 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.
C
Configuration Name
Default Description List of values
* Panel 0 This Integration supports multiple panels 0, 1, 2 etc
* Language EN Set the Language. EN for English, NL for Dutch or FR for French. EN, NL or FR
* 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
* Emulation Mode Powerlink Request the Mode to connect to the Panel. Note 1 Powerlink, Standard or Minimal
* Download Code This is the 4 digit code used to download the EPROM and to Enroll for Powerlink. Leave this setting empty to see if the internal default codes work (internal codes are 5650 and AAAA) unless you have set the Download Code in the Panel Settings. 4 digits
* Show EEPROM Data No Whether to add the Panel details as Attributes of the Alarm Panel Entity in Home Assistant. No / Yes
Motion/Camera Off delay time 120 The delay time to keep the Motion/Camera zone trigger True after it is triggered. There will not be another trigger for that sensor within this time period. Integer Seconds
Magnet/Wired closed delay time 5 The delay time to keep the Magnet/Wired zone Open after it is triggered. There will not be another change for that sensor within this time period. Integer Seconds
Smoke/Fire off delay time 120 The delay time to keep the Emergency zone trigger True after it is triggered. There will not be another trigger for that sensor within this time period. This is used for all other sensors such as Sound, Flood, Gas etc Integer Seconds
List of Triggers for Siren Intruder A list of reasons that the siren is sounding, you set this as this information is not obtained from the panel. Note 2
List of Sensor Changes to send an Event A list of reasons to create an Event from a Sensor change.
List of Triggers for HA Notification "Connection Problems", "Siren Sounding" A list of reasons to create a Notification in the Frontend of Home Assistant. Note 3
Attempts to Try to Connect 1 This is the number of attempts the integration will try to (re)connect to the panel. If this is set to 0 then the Integration will try to connect once on initial startup but never again (following any disconnection). 0 to 1000
Delay Between Attempts 90 This is the period, in seconds, between connection retries. This is only used when "Attempts to Try to Connect" is 2 or more. 5 to 1000
Arm Without User Code No If the Panel is Disarmed, then Arm without the Usercode/keypad. Note 7 No / Yes
Force use of a Keypad No Display the numeric keypad to force the user to enter the correct code. Note 7 No / Yes
Arm Away Instant No If set to Yes then arm away instant is used instead of a normal arm away. Note 5 No / Yes
Arm Home Instant No If set to Yes then arm home instant is used instead of a normal arm home. Note 5 No / Yes
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
Allow Sensor Bypass No If set to Yes then allow individual sensors to be bypassed (using the HA Select Entities and the Bypass Service) No / Yes
Panel Log Entry Event No Generate an event within HA for each panel log entry (potentially hundreds). 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 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 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 (Notes 4 and 6) '' 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 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 the requested Mode depends on how secure you make your system and how much you trust it.

Note 2

The complete list of reasons that the siren may be sounding are "Intruder", "Tamper", "Fire", "Emergency", "Gas", "Flood", "X10", "Panic". However, 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 across these values.

Note 3

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

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

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 7

This note defines the combinations of the 2 parameters: Force use of a Keypad, Arm Without User Code and the setting of the Usercode in the Alarm Panel Entity itself. 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). Also remember that Minimal Mode does not allow any of these settings.

With reference to the 2 tables below, the first 4 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.

The function of Arm Without User Code has a slightly different meaning depending on the Panel Mode (Standard, Standard Plus or Powerlink).

In the "Panel State", remember that it is the current panel state i.e. Disarmed means what you see to arm the panel.

For Standard Mode

Note that when Arm Without User Code is used in Standard Mode, it is only used when the panel is Disarmed (in order to arm the Panel).

Panel State
Arm Without User Code
Force use of a Keypad
Usercode Set in Panel Entity
Is Keypad Shown
Code sent to Panel Extra
Disarmed Yes - - No '0000' A
Disarmed No No No Yes Keypad A
Disarmed No No Yes No Usercode Set in Panel Entity A
Disarmed No Yes No Yes Keypad A
Disarmed No Yes Yes No Usercode Set in Panel Entity A
Armed - No No Yes Keypad
Armed - No Yes No Usercode Set in Panel Entity
Armed - Yes - Yes Keypad A

For Standard Plus and Powerlink Modes

Panel State
Arm Without User Code
Force use of a Keypad
Usercode Set in Panel Entity
Is Keypad Shown
Code sent to Panel Extra
Any - No No No User code 1
Any - No Yes No Usercode Set in Panel Entity A
Armed - Yes - Yes Keypad A
Disarmed No Yes - Yes Keypad A
Disarmed Yes Yes No No User code 1
Disarmed Yes Yes Yes No Usercode Set in Panel Entity A

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).

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 overriding the download code to something other than 5650 or AAAA.

Some Panel Models 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).

The Start Up Sequence of the Integration

The Integration attempts to connect to the Panel using the configured mechanism (Ethernet, USB or RS232).

The Achieved Panel Mode
  • At Integration start, the Emulation Mode user setting is examined.
    • If set to Standard Mode it goes directly to Standard Mode and stays there.
    • If set to Minimal Mode it goes directly to Minimal Mode and stays there.
  • If Emulation Mode is set to Powerlink Mode 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 between 10 to 50 seconds, depending on the Panel Type
  • 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.
  • If you have a PowerMax+ or a PowerMax Pro then you need to Manually Enroll (in your control panel menu). Your Panel then asks the Integration to Enroll which it should do
  • For other Panels the Integration then starts trying to Auto Enroll with the Alarm Panel 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 usually get Powerlink Mode within 2 minutes of starting HA
    • On my panel it sometimes fails to enroll the first time and it works the next time around, so about 5 minutes after starting HA
The Connection State and Disconnection Handling

This section describes the sequence of connecting to the panel and what happens when problems occur.

The Integration always tries to connect when it is first started (or reloaded from within Home Assistant). The number of times the integration will attempt a connection / reconnection and the time interval between attempts is set in the configuration for this integration. Note that the configured number of attempts can be set to 0 in which case the connection will be attempted once on initial startup but never again, even after a disconnection.

The most common cause of disconnections is when this occurs in the log file:

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

In this case it is usually when the external physical connection is terminated (i.e. disconnected altogether such as a wifi router reboot). If you see this in the log file then I can't help you as it is something going wrong in your setup.

Connection Progress and Connection Attempt Indications

Home Assistant Events are used to inform on progress, see the Panel and Sensor HA Events Section for more details but they are used as follows. For the Home Assistant Event, defined in the Panel and Sensor HA Events Section, to explain the difference between action = "connection" and action = "nopaneldata":

  • action = "connection" is to do with the physical and logical connection between the system on which you run Home Assistant and the Alarm Panel i.e. is there a connected Ethernet / USB / RS232 connection established? The integration tries to keep a permanent connection between the integration and the panel. So the state is:
    • "disconnected" when a break in the connection has occurred, reason is set to:
      • "crcerror" when there have been too many crc errors in the received data
      • "samepacketerror" when the panel sends too many of the same packet in the same sequence
      • "termination" when the external physical connection is terminated
    • "connected" when everything is OK and
    • "failedattempt" when an attempt has been made to connect but that failed (with an attempt counter). The number of attempts can be set in the configuration settings for this integration.
  • action = "nopaneldata" is to do with the receipt of data from the panel. Once action = "connection" is "connected" the integration will interact with the panel. The state is
    • "neverconnected" when, following a successful connection (action = "connection"), no data has been received at all for over 30 seconds, and
    • "disconnected" when data has been received previously but not for the past 4 minutes (and action = "connection", state is "connected" as the Operating System believes that there is still a valid connection to the panel).

So the sequence is, after starting HA with a successful connection i.e. action = "connection" and state="connected":

  • If the integration receives no data from the panel (after sending data to the panel to prompt the panel to respond) then after 30 seconds the integration stops and sends the HA event (action = "nopaneldata", state="neverconnected").
  • If the panel and integration initially communicate and some time later (minutes, hours, days, weeks), after the integration has not received data for 4 minutes then it stops and sends the HA event (action = "nopaneldata", state="disconnected").
    • For some messages to the panel (that explicitly expect a reply from the panel), within that 4 minutes it does try other things like re-sending the message. It also sends a 'restore' message to the panel to trigger it to send back its status. So there are mechanisms within that 4 minutes to try to get the panel to respond.
    • But after 4 minutes if all of these have not worked then it sends the HA Event and it is up to you to create an HA Automation to decide what to do, which could be to send you an email or to restart the integration.
  • For action = "nopaneldata", the integration does not restart itself (it will stop in a dormant state and not reconnect) as:
    • Some users were having issues where it restarts a lot and they wanted to decide what to do
    • The physical connection between HA and the panel looks OK, so the Integration assumes that it's a panel problem

Home Assistant device_class

In Standard Plus & Powerlink Modes the Integration tries to set the device class correctly by default. However, the Integration doesn't know if a particular perimeter sensor "magnet" is on a door or window for example. By default the Integration sets 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, or you can change it in the Entity settings for the sensor itself within Home Assistant.

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

You will find the various settings for device_class here

For Standard Mode the Integration does 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 the Home Assistant built in services, the other 4 are specific to the Integration.

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

Where the code is Optional in the above table it is only needed in Standard Mode. However, if it is set as a parameter in any of the Emulation Modes then it is used. e.g. "code":"1234"

alarm_control_panel.alarm_arm_away, alarm_control_panel.alarm_arm_home and alarm_control_panel.alarm_disarm have the same effect as visonic.alarm_panel_command with different service data.

Note 1

These are all case sensitive. The "Command" is set to one of 'Arm Away', 'Arm Away Instant', 'Arm Home', 'Arm Home Instant', 'Disarm'. The following only work on certain Panel Models: 'Emergency', 'Fire', 'Panic', 'Mute', 'Trigger'.

Home Assistant Panel Events

The Integration generates Events on the Home Assistant Event Bus. Events are part of Home Assistant and the Integration generates an Event for many things such as getting the event log from the panel, changes in the panel state or changes in sensor states.

All Home Assistant Events from the Visonic Integration include the following data items

Data Type Description
panel Integer The panel number. If you only have 1 panel you can ignore this
panel_id Entity ID The panel entity_id e.g. alarm_control_panel.visonic_alarm

The Home Assistant Events created by this Integration are as follows

Name Description
Data Items
visonic_alarm_panel_event_log_entry A single Event log entry has being downloaded, an HA event for every panel log entry (if enabled in configuration) Note 2
visonic_alarm_panel_event_log_complete Event log from the panel has been downloaded (if enabled in configuration)
total is the total number of events reported by the panel
available is the number of events available in the output files
visonic_alarm_panel_state An HA Event for various panel changes Note 3
visonic_alarm_sensor_state An HA Event for various sensor changes (if enabled in configuration using List of Sensor Changes to send an Event) Note 4
visonic_alarm_command_to_panel An HA Event for Home Assistant Commands sent to the Panel. If this Event indicates a problem then the Command has not been sent to the Panel Note 5

To see them in action in your own Home Assistant, go to “Developer Tools”, “Events” and in the bottom where it says “Listen to events” paste the Event name from the table above e.g. visonic_alarm_panel_state 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.

Panel Event Log HA Events (Note 2)

This describes the Event data associated with the visonic_alarm_panel_event_log_entry Event. The list of 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 Events (Note 3)

This describes the Event data associated with the visonic_alarm_panel_state Event. The action data entry is a text string describing the event

  e.g. `action` = "connection" and `state` = "disconnected"
       `action` = "paneltamper"

Most of the action entries do not have any other associated data.

'action'
Meaning
Additional Data
"connection" The state of the logical and physical connection to the Panel.

See the startup sequence section.
state = "disconnected" indicates a communication disconnection

state = "failedattempt" indicates a failed connection attempt.
Note: attempt = attempt counter

state = "connected" indicates a successful connection
Note: attempt = attempt counter
"panelupdate" Panel update name provides the device or location
event provides the activity details
"panelreset" Panel reset
"pinrejected" Pin rejected
"timeoutdownload" EPROM download timeout, go to Standard Mode
"timeoutwaiting" Watchdog timeout, staying in current mode
"timeoutactive" Watchdog timeout, going to try to get a better mode
"nopaneldata" Data not received from the Panel. This condition indicates that a connection to the panel has been established but no data has or is being received from the Panel. See the startup sequence section. state = "neverconnected" indicates that no data has been received

state = "disconnected" indicates that data has stopped being received

Remember, these are to be used in addition to the Alarm Panel Entity state and attributes.

Sensor Events (Note 4)

This describes the Event data associated with the visonic_alarm_sensor_state Event.

Data Item Description
zone The Zone Number of the Sensor (integer 1 to 64)
entity_id The Home Assistant Entity ID of the Sensor
event The Event string: "Problem", "Fire", "Emergency", "Panic"

Remember, an Event is only generated if you have included it in the Configuration setting. Also, these are to be used in addition to the Sensor Entity state and attributes.

Command State Events (Note 5)

This describes the Event data associated with the visonic_alarm_command Event. This Event represents the information associated with sending a command to the panel and whether it actually gets sent or not. The action data entry is a text string describing the event

'action'
Meaning
Command
"armdisarm" Arm/Disarm feedback "Disarm", "Arm_Home", "Arm_Away", "Arm_Home_Instant", "Arm_Away_Instant"
"bypass" Bypass feedback "Bypass", "Re-Arm"
"eventlog" Event Log feedback "eventLog"
"x10" X10 feedback "x10"

Data associated with this Event

Name Type Description
command String action = "armdisarm" : "Disarm", "Arm_Home", "Arm_Away", "Arm_Home_Instant", "Arm_Away_Instant"
action = "bypass" : "Bypass", "Re-Arm"
action = "eventlog" : "Eventlog"
action = "x10" : "X10"
reason Integer Depends on which event 'Command', one of 0, 1, 2, 3, 4 or 5 (See Note 1)
message String A string representation of the Event
ready Boolean The Panel Ready state (True or False)
open 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.

Meaning
reason
"armdisarm" Arm/Disarm feedback 0,1,2,3,4,6
"bypass" Bypass feedback 0,1,2,3,6
"eventlog" Event Log feedback 0,1,2
"x10" X10 feedback 0,1,5

Reasons 0 to 6 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
6 Not sending command to panel, disabled by panel configuration

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

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, these are in addition to the attributes that Home Assistant creates.

Name Type Description
'mode' String The Panel Mode. Set to one of "Unknown", "Problem", "Starting", "Download", "Minimal Only", "Standard", "Standard Plus", "Powerlink", "Powerlink (Bridged)", "Stopped"
'state' String The Panel State. Set to one of "Triggered", "Disarmed", "Arming Home", "Armed Home", "Arming Away", "Armed Away", "Special", "Downloading" and "Entry Delay"
'ready' Boolean Is the Panel Ready, set to true or false
'tamper' Boolean Is the Panel in the Tamper state, set to true or false
'memory' Boolean Is there a Panel Alert In Memory, set to true or false
'bypass' Boolean Is the Panel Bypass set, set to true or false
'alarm' String The Panel Alarm Status, set to "None", "Intruder", "Tamper", "Panic", "Fire", "Emergency", "Gas", "Flood"
'trouble' String The Panel Trouble Status, set to "None", "Communication", "General", "Battery", "Power", "Jamming", "Telephone"
'lasteventname' String The name of the last event (zone, fob etc), initialised to "Startup"
'lasteventaction' String The action of the last event, initialised to "Startup"
'lasteventtime' String This is the date and time of the 'lasteventname' and 'lasteventaction' attribute above
'panel' Integer This is the panel number as set when the panel was created on the Integrations page
'Protocol Version' String The low level protocol version number
'Panel Model' String The model type of the alarm panel (or "Unknown")
'Power Master' String Whether connected to a PowerMaster Panel, set to 'yes' or 'no'
'Watchdog Timeout (Total)' Integer Counts how many watchdog timeouts there has been in total (interruptions but not disconnected)
'Watchdog Timeout (Past 24 Hours)' Integer Counts how many watchdog timeouts there has been in the past 24 hours (interruptions but not disconnected)
'Download Timeout' Integer Counts how many failed attempts to download the panel EPROM data
'Download Retries' Integer Counts how many EPROM data blocks failed to upload and were re-attempted (max 30 and then stop)
'Panel Problem Count' Integer Counts how many times the Integration has had a Problem that it may have been able to recover from
'Last Panel Problem Time' Time The time of the last problem
'Client Version' String Set to the current Integration version
'Exception Count' Integer Counts how many comms disconnections there has been

In addition, if Show EEPROM Data is selected in the Configuration then a selection of Panel settings are also added when in Powerlink Emulation Mode, with the following:

Name Type Description
'Door Zones' List of Strings A list of the Magnetic/Wired sensor names
'Motion Zones' List of Strings A list of the Motion/Camera sensor names
'Smoke Zones' List of Strings A list of the Smoke/Gas 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

Extra Hidden Functionality

There are 3 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 I've also used ttyUSB1 andCOM1 as examples, please use the correct port for your device.

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
python3 complete_example.py -usb /dev/ttyUSB1                 <-- On Linux
python3 complete_example.py -usb COM1                         <-- On Windows

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 then enter for help.

With complete_example.py there are additional command line Options

python3 complete_example.py -address A.B.C.D -port YourPort -panel 1 -connect standard -logfile out.txt -print debug

Where - connect can be dataonly, standard or powerlink

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

If you use Ethernet, do you get this in the log file

Setting TCP socket Options Exception [Errno 111] Connection refused
Failed to connect into Visonic Alarm. Check Settings.

If so then there is no connection to the gadget you have inside your panel. It is likely that you have the IP address or port settings wrong. The only other alternative is that the TCP server in your gadget is not working or set up correctly.

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:

[Controller] Visonic Plugin has suspended all operations, there is a problem with the communication with the panel (i.e. no data has been received from the panel)

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 have this in your log file

[Controller] Visonic Plugin has suspended all operations, there is a problem with the communication with the panel (i.e. data has not been received from the panel in 600 seconds)

Then the integration did start receiving data but then it stopped and nothing has been received from the alarm panel in the last approx 600 seconds (approx 10 minutes). Has the connection been broken, a wire became disconnected 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 you 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' (unticked)
    • 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 *).
    • If you have a PowerMax+ or PowerMax Pro then check that Auto Enroll Supported is set to 'no' (unticked)
  • 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

Loopback Test

I have introduced a loopback test in the integration.

So what does this mean and how does it work I hear you ask. In loopback mode, whatever data this integration sends then it will receive the same data back. You can therefore test your system without connecting to the panel to make sure all (most of) the hardware related settings and your wiring are correct.

What you need to do

If you disconnect both the Tx and Rx wires of your RS232 gadget from the panel and then connect the Tx to the Rx on your gadget (with a single wire) then you have a loopback. The data that the integration sends to the panel comes out of the gadgets Tx pin, as you have connected that to the gadgets Rx pin then the gadget believes it has received that data and passes it back to the integration. In other words, whatever data the integration sends to the panel, the integration receives the same data back. This is why it is called a loopback and the integration can be used to check the communication path.

You then need to restart the integration (deleting it and then adding it, or by simply restarting Home Assistant).

Notes:

  • You may still use power from the panel (leave ground and Vcc power wires connected) but connect the Rx to the Tx on the gadget (leave the Rx and Tx on the panel with nothing connected)
  • You may power a gadget (such as a Wemos) at your desk away from the panel and use this loopback test
  • This test validates your setup except for the RS232 settings (such as stop bits and baud rate). It is still possible that these are set incorrectly for your specific panel.

In normal operation, the first command that the integration sends to the panel is STOP. This would stop any ongoing EPROM upload/download.

If the integration receives and detects this (as the panel never sends a STOP command) then it enters in to LOOPBACK mode in the integration software. This suspends all other normal operation.

Note that in LOOPBACK mode:

  • The best way to see the output is to view the log file (although you should also see it on the Home Assistant "logs" page as I log the count output as a Warning)
  • No Home Assistant Entities are created i.e. alarm entity, X10 switches or sensors. You cannot see any entity attribute data so you need to look at the log file.
  • The integration sends an EXIT command every 5 seconds and increments a counter
  • By the time the STOP command is received back the first time, the integration has already sent a few more commands (Start Download etc). Eventually it simply sends and receives the STOP command and increments a counter
  • You should see "LOOPBACK TEST SUCCESS, Counter is 1" quickly after integration start but then it takes 10 seconds to get "LOOPBACK TEST SUCCESS, Counter is 2"

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.

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.select: debug
    custom_components.visonic.__init__: debug
Clone this wiki locally