Visonic Powermax and Powermaster Component

I continue with work! hehehe In the end I was able to install phyton3 in hassio and perform the test that you indicated.
The result is as follows:

core-ssh:/config/custom_components# python3 test.py -address XXX.XX.X.XX -port XXXX

Traceback (most recent call last):

File “test.py”, line 3, in <module>

import pyvisonic

File “/config/custom_components/pyvisonic.py”, line 33, in <module>

from dateutil.relativedelta import *

ModuleNotFoundError: No module named ‘dateutil’

core-ssh:/config/custom_components# python3 test.py -h

Traceback (most recent call last):

File “test.py”, line 3, in <module>

import pyvisonic

File “/config/custom_components/pyvisonic.py”, line 33, in <module>

from dateutil.relativedelta import *

ModuleNotFoundError: No module named ‘dateutil’

By running it from the command line it looks like you’re not getting the benefit of the python libraries used by HA, I assume that it’s a HASSIO side effect. I suggest you try to install the python libraries as follows:

sudo pip3 install pyserial
sudo pip3 install python-datetime
sudo pip3 install pyserial_asyncio

The python-datetime library should fix the “No module named dateutil”
If not then you may also need:

sudo pip3 install py-dateutil

Let me know how you get on

I’ve checked and the battery level type from the alarm panel is either OK or not so in release 0.0.7.1 I set the battery level to 0 or 100 as a percentage, please install 0.0.7.1. Powerlink does not make a difference.
I also set tripped state, armed state (sensor bypassed or not) and last tripped time to all conform with similar settings within HA itself

At the moment I don’t pass through any X10 devices. I used to have X10 but I gave most of it away as I replaced it with Z-Wave

Good morning Dave,
Excellent!! with the new version no longer gives the error of the battery!
Finally, I installed HA in raspbian and the control panel connects PowerLink mode! It is perfect!
Now the only warning it gives is that the component has not been tested by HA, but the rest works well.

Trying to help the maximum, is it possible to add the siren of the alarm as an entity in HA?

Regards

Hello,
as far as I know it isn’t possible to add the siren, the alarm panel doesn’t provide any information about it. The only indication that the siren is active i.e. making a loud noise! is given in the “Panel Siren Active” attribute in the Switch that I create, a few posts back I describe a little bit about how this is derived as it isn’t direct from the panel. Also, you cannot remotely trigger the siren so it would only be a sensor that indicated whether it was making a big loud noise or not! So, I don’t think that it’s worth it.
Having said that, in HA you can create your own template sensor and connect it to the “Panel Siren Active” attribute, the values are “No” and “Yes”. Like this in your sensors.yaml

- platform: template
  sensors:
      visonic_siren_active:
         value_template: >-
           {{ state_attr('switch.visonic_alarm_panel', 'Panel Siren Active') | title  }}
         friendly_name: 'Alarm Panel Siren Active'

Hi Dave,

Great! I went from 0.0.6.something to 0.0.7.1. Replaced all my visonic sensors with visonic binary_sensors and changed “T” to “on” in all automations. First impression: looks very good!

Did you know about this custom_updater component that can help notifying your users that you released another version? You only have to put a json file in your repo and keep it updated with the version number. Your users can put a tracker card in lovelace to see which custom components (or cards) have a newer version available than currently used in their HA.

Hi Dave,

Since HA 0.86.x if have an issue with the (standard) alarm-panel card. It’s not showing the keyboard buttons anymore. And typing in an alarm code and clicking a button afterwards gives an error in the log: Warning: Valid 4 digit PIN needed and not in Powerlink mode.

Home_Assistant

  - type: alarm-panel
    entity: alarm_control_panel.visonic_alarm
    states:
      - arm_home
      - arm_away

Could it be related to this change in 0.86?

Alarm control panel entities will now use number as their code_format instead of Number (@balloob - #20077) (alarm_control_panel docs) (breaking change)

Is that something you are able to repair?

I didn’t notice that in the breaking changes, thankyou

I’ve changed “Number” to “number” and uploaded Git to version 0.0.7.2, please give it a try.

1 Like

The keyboard is back on the alarm-panel (and is working). Thank you for the fix, Dave!

Hi

Looking to move over from Vera and really pleased to see a visonic component as I’ve been using it with Vera for years.
I have the component installed and all appears to be loading but getting the following error
[custom_components.pyvisonic] [data receiver] Warning : Construction of incoming packet unknown - Message Type 0XF

Using usb 232 adaptor with hassio.

Do you have any ideas in this error?

Thanks

I’ve looked it up and I do not handle an 0x0F message from the alarm panel but I’ve also looked in the Vera Lua code and it didn’t handle it either. With Vera, if you had debug turned on for the plugin, it would have entered “Unhandled message 0x0F” in to the log. I’m interested in new messages that I don’t handle so I display it as a Warning so people take notice of it so thankyou for letting me know.

Can you turn on debug and let me have the log file, or several lines either side of this warning

I’ve given it another go tonight, now getting different messages with logging enabled

Standard mode
2019-02-07 18:32:28 INFO (MainThread) [custom_components.pyvisonic] Initialising Protocol
2019-02-07 18:32:28 WARNING (MainThread) [homeassistant.loader] You are using a custom component for visonic which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-02-07 18:32:28 INFO (SyncWorker_2) [custom_components.pyvisonic] Setting key MotionOffDelay to value 120
2019-02-07 18:32:28 INFO (SyncWorker_2) [custom_components.pyvisonic] Setting key PluginLanguage to value EN
2019-02-07 18:32:28 INFO (SyncWorker_2) [custom_components.pyvisonic] Setting key ForceStandard to value True
2019-02-07 18:32:28 INFO (SyncWorker_2) [custom_components.pyvisonic] Setting key AutoSyncTime to value True
2019-02-07 18:32:28 INFO (SyncWorker_2) [custom_components.pyvisonic] Setting key EnableRemoteArm to value True
2019-02-07 18:32:28 INFO (SyncWorker_2) [custom_components.pyvisonic] Setting key EnableRemoteDisArm to value True
2019-02-07 18:32:29 INFO (SyncWorker_2) [custom_components.pyvisonic] Setting key OverrideCode to value XXXX
2019-02-07 18:32:29 INFO (SyncWorker_2) [custom_components.pyvisonic] Setting key ResetCounter to value 0
2019-02-07 18:32:29 INFO (SyncWorker_2) [custom_components.visonic] Visonic Connection Device Type is OrderedDict([(‘type’, ‘usb’), (‘path’, ‘/dev/ttyUSB0’), (‘baud’, ‘9600’)])
2019-02-07 18:32:30 INFO (MainThread) [custom_components.pyvisonic] [Connection] Connected. Please wait up to 5 minutes for Sensors and X10 Devices to Appear
2019-02-07 18:32:30 DEBUG (MainThread) [custom_components.pyvisonic] [ClearList] Setting queue empty
2019-02-07 18:32:30 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Exit
2019-02-07 18:32:30 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Exit) raw data 0d 0f f0 0a
2019-02-07 18:32:30 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response []
2019-02-07 18:32:31 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Stop
2019-02-07 18:32:31 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Stop) raw data 0d 0b f4 0a
2019-02-07 18:32:31 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response []
2019-02-07 18:32:32 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Initializing PowerMax/Master PowerLink Connection
2019-02-07 18:32:32 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Initializing PowerMax/Master PowerLink Connection) raw data 0d ab 0a 00 01 00 00 00 00 00 00 00 43 06 0a
2019-02-07 18:32:32 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response [‘0X2’]
2019-02-07 18:32:33 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Getting Status
2019-02-07 18:32:33 WARNING (MainThread) [homeassistant.loader] You are using a custom component for alarm_control_panel which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-02-07 18:32:33 WARNING (MainThread) [homeassistant.loader] You are using a custom component for alarm_control_panel.visonic which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-02-07 18:32:33 WARNING (MainThread) [homeassistant.loader] You are using a custom component for switch.visonic which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-02-07 18:32:42 INFO (MainThread) [custom_components.pyvisonic] [SendCommand] Re-Sending last message Initializing PowerMax/Master PowerLink Connection
2019-02-07 18:32:42 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Initializing PowerMax/Master PowerLink Connection) raw data 0d ab 0a 00 01 00 00 00 00 00 00 00 43 06 0a
2019-02-07 18:32:42 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response [‘0X2’]
2019-02-07 18:32:53 INFO (MainThread) [custom_components.pyvisonic] [SendCommand] Tried Re-Sending last message but didn’t work. Assume a powerlink timeout state and reset
2019-02-07 18:32:53 DEBUG (MainThread) [custom_components.pyvisonic] [ClearList] Setting queue empty
2019-02-07 18:32:53 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Getting Status
2019-02-07 18:32:53 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Getting Status) raw data 0d a2 00 00 00 00 00 00 00 00 00 00 43 1a 0a
2019-02-07 18:32:53 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response [‘0XA5’]
2019-02-07 18:33:03 INFO (MainThread) [custom_components.pyvisonic] [SendCommand] Re-Sending last message Getting Status
2019-02-07 18:33:03 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Getting Status) raw data 0d a2 00 00 00 00 00 00 00 00 00 00 43 1a 0a
2019-02-07 18:33:03 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response [‘0XA5’]

Powerlinkmode
2019-02-07 18:44:42 INFO (SyncWorker_8) [custom_components.pyvisonic] Setting key MotionOffDelay to value 120
2019-02-07 18:44:42 INFO (SyncWorker_8) [custom_components.pyvisonic] Setting key PluginLanguage to value EN
2019-02-07 18:44:42 INFO (SyncWorker_8) [custom_components.pyvisonic] Setting key ForceStandard to value False
2019-02-07 18:44:42 INFO (SyncWorker_8) [custom_components.pyvisonic] Setting key AutoSyncTime to value True
2019-02-07 18:44:42 INFO (SyncWorker_8) [custom_components.pyvisonic] Setting key EnableRemoteArm to value True
2019-02-07 18:44:42 INFO (SyncWorker_8) [custom_components.pyvisonic] Setting key EnableRemoteDisArm to value True
2019-02-07 18:44:42 INFO (SyncWorker_8) [custom_components.pyvisonic] Setting key OverrideCode to value XXXX
2019-02-07 18:44:42 INFO (SyncWorker_8) [custom_components.pyvisonic] Setting key ResetCounter to value 0
2019-02-07 18:44:42 INFO (SyncWorker_8) [custom_components.visonic] Visonic Connection Device Type is OrderedDict([(‘type’, ‘usb’), (‘path’, ‘/dev/ttyUSB0’), (‘baud’, ‘9600’)])
2019-02-07 18:44:42 INFO (MainThread) [custom_components.pyvisonic] [Connection] Connected. Please wait up to 5 minutes for Sensors and X10 Devices to Appear
2019-02-07 18:44:43 INFO (MainThread) [custom_components.pyvisonic] [Startup] Trying to initialise panel
2019-02-07 18:44:43 DEBUG (MainThread) [custom_components.pyvisonic] [ClearList] Setting queue empty
2019-02-07 18:44:43 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Exit
2019-02-07 18:44:43 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Exit) raw data 0d 0f f0 0a
2019-02-07 18:44:43 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response []
2019-02-07 18:44:43 WARNING (SyncWorker_13) [root] Couldn’t connect to host: 10.0.30.40:5555, error: Connection reset by peer
2019-02-07 18:44:43 WARNING (SyncWorker_13) [homeassistant.components.media_player.firetv] Could not connect to Fire TV at 10.0.30.40:5555 using adbkey=’/config/android/adbkey’
2019-02-07 18:44:44 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Stop
2019-02-07 18:44:44 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Stop) raw data 0d 0b f4 0a
2019-02-07 18:44:44 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response []
2019-02-07 18:44:45 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Initializing PowerMax/Master PowerLink Connection
2019-02-07 18:44:45 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Initializing PowerMax/Master PowerLink Connection) raw data 0d ab 0a 00 01 00 00 00 00 00 00 00 43 06 0a
2019-02-07 18:44:45 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response [‘0X2’]
2019-02-07 18:44:46 WARNING (MainThread) [homeassistant.loader] You are using a custom component for alarm_control_panel which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-02-07 18:44:46 WARNING (MainThread) [homeassistant.loader] You are using a custom component for alarm_control_panel.visonic which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-02-07 18:44:46 WARNING (MainThread) [homeassistant.loader] You are using a custom component for switch.visonic which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-02-07 18:44:50 DEBUG (MainThread) [custom_components.pyvisonic] [Startup] Success: Got only the required messages
2019-02-07 18:44:50 INFO (MainThread) [custom_components.pyvisonic] [Startup] count is 1
2019-02-07 18:44:50 DEBUG (MainThread) [custom_components.pyvisonic] [Startup] Sending Download Start
2019-02-07 18:44:50 INFO (MainThread) [custom_components.pyvisonic] [Start_Download] Starting download mode
2019-02-07 18:44:50 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Start Download Mode
2019-02-07 18:44:50 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Start Download Mode) raw data 0d 24 00 00 56 50 00 00 00 00 00 00 35 0a
2019-02-07 18:44:50 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response [‘0X2’]
2019-02-07 18:46:50 WARNING (MainThread) [custom_components.pyvisonic] ********************** Download Timer has Expired, Download has taken too long *********************
2019-02-07 18:46:50 DEBUG (MainThread) [custom_components.pyvisonic] [ClearList] Setting queue empty
2019-02-07 18:46:50 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Exit
2019-02-07 18:46:50 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Exit) raw data 0d 0f f0 0a
2019-02-07 18:46:50 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response []
2019-02-07 18:46:51 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Stop
2019-02-07 18:46:51 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Stop) raw data 0d 0b f4 0a
2019-02-07 18:46:51 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response []
2019-02-07 18:46:52 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Initializing PowerMax/Master PowerLink Connection
2019-02-07 18:46:52 INFO (MainThread) [custom_components.pyvisonic] [pmSendPdu] Sending Command (Initializing PowerMax/Master PowerLink Connection) raw data 0d ab 0a 00 01 00 00 00 00 00 00 00 43 06 0a
2019-02-07 18:46:52 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response [‘0X2’]
2019-02-07 18:46:53 INFO (MainThread) [custom_components.pyvisonic] [QueueMessage] Getting Status

Left it 5-10 minutes also rebooted the panel a few times but didn’t seem to make any difference

Thanks

Gjones You’re not getting any data from your panel, all the log shows is HA sending data but getting nothing back. Are you sure your hardware etc is in place, did you change anything?

When I had the original error message i’m not sure i’d disconnected my Vera from the dual serial in my panel like i’d thought.

I’ll double check the connections and try a different usb 232 adapter.

I wasn’t sure if this message was showing connectivity
2019-02-07 18:44:42 INFO (MainThread) [custom_components.pyvisonic] [Connection] Connected

Thanks

Ah I see what you mean. That “Connected” is when my HA Component connects to the transport layer in python, this is the Ethernet TCP or USB/RS232 handler. I’ll change the message to be more meaningful but it won’t get updated on Github until there is another change.

There can only be a single connection to the panel, if there are more than 1 then they and the panel are likely to get very confused.

Hope all goes well

Hi,

I have a PowerMaster 10 panel, which I connected to HASS using TCP. I have one zone configured for testing. In HASS it shows the panel with a ‘disarm’ label and I can see the zone wit an ‘unknown’ label. Arming or dis-arming the panel does not work. I don’t see the details of the panel when I click on the wrench. It seems like the communication between the GUI and the HASS engine is not working well? When I open the zone or try to arm the panel I see messages appearing in the HASS log, but not changing state in the GUI.
I also ran the ‘test.py’ script. I see a lot of ‘INFO:pyvisonic:[Startup] Got at least 1 unexpected message, so starting count again from zero’ messages.

Any help would be appreciated?

The only thing I can suggest is that you send me your log file. If you set your visonic logs to debug, zip the log file and post it here I’ll take a look.

logger:
    default: error
        logs:
            custom_components.visonic: debug
            custom_components.alarm_control_panel.visonic: debug
            custom_components.binary_sensor.visonic: debug
            custom_components.switch.visonic: debug
            custom_components.pyvisonic: debug

Hi Dave,

Thanks for your reply.

I already had de debug mode activated to see if I could find anything strange in the pyvisonic log.
Attached the home assistant log file and the test.py log file (PM10.log).

Hope this helps.
Thanks so far.

BTW I did change the log format extension to xml otherwise I could not upload it. It is zip format!
.
Hass.xml (54.0 KB)

OK, so here are my findings so far.

From the home-assistant log file i’ve found out that:

  1. You’ve tried several times to set the alarm with the code 1111. That code has been denied by the panel as an invalid code. There are a couple of main reasons for this
    • Is this code correct? As it is in Powerlink mode and you have a Powermaster10 which I haven’t been able to test with, the EPROM decode may be incorrect.
    • This could also be because the panel is not “Ready”, it says this here in the log file:

[custom_components.pyvisonic] Model PowerMaster10 PowerMaster Yes LastEvent None Ready No

Does the display on the front of the panel itself say that it’s ready and can you set it (arm home or arm away) without going through the HA component, i.e. set it directly?

  1. You have a single sensor that is not enrolled. Are you sure that you have enrolled it in to the panel? This is panel specific so you would need to follow the panel instructions for sensor enrolment.

To get detailed and geeky :slight_smile: My Component receives this data from your panel:

Parsing complete valid packet: 0d a5 10 06 00 00 00 00 00 00 00 00 43 01 0a

The first 4 “00” are the enrolled bits for the 32 zones (4 bytes is 32 bits).
The second 4 “00” are the bypass bits for the 32 zones (4 bytes is 32 bits).
According to this data, there are no sensors fully enrolled in your panel.

That is why I’m asking whether you can set your panel directly from the keypad/keyfob.

  1. On a positive note, the panel is getting in to Powerlink mode, it downloads the EPROM data and decodes it. It also says that it’s Disarmed and you cannot arm it because it is not “Ready”.

Overall, since there is only a single sensor that is not enrolled, this maybe why the panel is not “Ready”.

On the PM10.log, I have no idea what’s going on. The Panel just repeatedly sends A5 status messages and blocks all communication. I have only once had this myself and I couldn’t work out what was going on but I left it overnight and the next morning it was OK again. I’d like to think that it was a security protocol inside the panel that believed I was tampering with it and it blocks all communication but I don’t think it’s that sophisticated.

Let me know if you make any progress and if you can set the alarm with your keyfob/panel

Hi Dave

Thanks for your help, recabled and it’s now connected. Can’t get it into Powerlink mode but I think this is due to it not clearing the Vera from the panel despite do a restart.