Visonic Powermax and Powermaster Component

My log file was getting too big, so I just disabled debugging and performed an HA restart. After the restart, I checked the log again and saw the following:

2020-05-07 13:38:26 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback SerialTransport._read_ready()
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
    self._protocol.data_received(data)
  File "/config/custom_components/visonic/pyvisonic.py", line 1521, in data_received
    self.handle_received_byte(databyte)
  File "/config/custom_components/visonic/pyvisonic.py", line 1578, in handle_received_byte
    self.processReceivedMessage(ackneeded = self.pmCurrentPDU.ackneeded, data = self.ReceiveData)
  File "/config/custom_components/visonic/pyvisonic.py", line 1661, in processReceivedMessage
    self.packet_callback(data)
  File "/config/custom_components/visonic/pyvisonic.py", line 2617, in handle_packet
    self.handle_msgtypeB0(packet[2:-2])
  File "/config/custom_components/visonic/pyvisonic.py", line 3447, in handle_msgtypeB0
    if BZero_Enable and msgType == 0x03 and subType == 0x04:
NameError: name 'BZero_Enable' is not defined
2020-05-07 13:38:27 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback SerialTransport._read_ready()
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
    self._protocol.data_received(data)
  File "/config/custom_components/visonic/pyvisonic.py", line 1521, in data_received
    self.handle_received_byte(databyte)
  File "/config/custom_components/visonic/pyvisonic.py", line 1578, in handle_received_byte
    self.processReceivedMessage(ackneeded = self.pmCurrentPDU.ackneeded, data = self.ReceiveData)
  File "/config/custom_components/visonic/pyvisonic.py", line 1661, in processReceivedMessage
    self.packet_callback(data)
  File "/config/custom_components/visonic/pyvisonic.py", line 2617, in handle_packet
    self.handle_msgtypeB0(packet[2:-2])
  File "/config/custom_components/visonic/pyvisonic.py", line 3447, in handle_msgtypeB0
    if BZero_Enable and msgType == 0x03 and subType == 0x04:
NameError: name 'BZero_Enable' is not defined
2020-05-07 13:38:27 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Alarm Panel for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 216, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 137, in async_setup_entry
    return await hass.data[DOMAIN].async_setup_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 163, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
2020-05-07 13:38:27 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Alarm Panel for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 216, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 73, in async_setup_entry
    return await hass.data[DOMAIN].async_setup_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 163, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
2020-05-07 13:38:27 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback SerialTransport._read_ready()
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
    self._protocol.data_received(data)
  File "/config/custom_components/visonic/pyvisonic.py", line 1521, in data_received
    self.handle_received_byte(databyte)
  File "/config/custom_components/visonic/pyvisonic.py", line 1578, in handle_received_byte
    self.processReceivedMessage(ackneeded = self.pmCurrentPDU.ackneeded, data = self.ReceiveData)
  File "/config/custom_components/visonic/pyvisonic.py", line 1661, in processReceivedMessage
    self.packet_callback(data)
  File "/config/custom_components/visonic/pyvisonic.py", line 2617, in handle_packet
    self.handle_msgtypeB0(packet[2:-2])
  File "/config/custom_components/visonic/pyvisonic.py", line 3447, in handle_msgtypeB0
    if BZero_Enable and msgType == 0x03 and subType == 0x04:
NameError: name 'BZero_Enable' is not defined

Otherwise, the integration seems to be working OK.

Hello Dave.

I’ve uploaded two log files, one for the 0.3.4 version init, and one for the 0.4.1 version install, init and a few minutes of running, I’ve followed Wiki instructions to do so and reset the panel prior install of the 0.4.1 version from scratch (and also waited several minutes before launching HA), old entities are still there because I was too lazy to delete them one by one, but as you can see that doesn’t seem to be a real problem (it updates those ok).

Find the files here:

https://nextcloud.dnkroz.es/s/pE5aQojqgpzYmr5

Best regards.

Fabio beat us all to it and had already pushed a fix to github. After it briefly messed me up a bit (differences with line feed and carriage returns on the end of lines) I’ve merged and created a new proper release 0.4.2 that should work with HACS and PowerMaster panels :slight_smile: The fix is associated with a bug in the processing of B0 data that is only received from PowerMaster panels.

Please give it a try and once again let me know of any problems … :smile:

Hello again Dave.

I’m glad to report that 0.4.2 version works fine, I’ll keep it monitored for a while but it seems that previous behavior doesn’t happen anymore.

Thanks a lot for all the work done to both Fabio and you :wink:

Best regards.

I’ve updated to v0.4.2 (w/ Supervisor 222 and Core 0.109.6) and I get some benign errors from the config manager. It could be because I have a secondary dashboard created with the Lovelace configuration UI; it has an alarm panel. Here are the entries:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 216, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 137, in async_setup_entry
    return await hass.data[DOMAIN].async_setup_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 163, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
2020-05-08 12:26:19 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Alarm Panel for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 216, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 73, in async_setup_entry
    return await hass.data[DOMAIN].async_setup_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 163, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!

Yeah, I noticed that in my own log file, the alexa media player has had the same issue here.

It’s on my todo list to fix but it doesn’t seem to be a major issue and it doesn’t stop things working.

1 Like

HACS updated worked perfectly for me and no problems to report (my setup is quite simple however)

My new sdcard arrived, decided on a clan rebuild as I have not used HA much yet, I have copied the visonic plugin files as before into addons/custom_components and pasted in the same configuration.yaml segment that I had previously. When I restart HA I get error “Component error: visonic - Integration ‘visonic’ not found.”, no useful additional info is written if I enable the debug logging.

Configuration=>Server Controls=> Check Configuration tells me that the config is invalid “Component error: visonic - Integration ‘visonic’ not found.”.

Have the installation instructions changed ? I see you mention HACS.

I’m not sure where “addons” is.
I think that you have the files in the wrong place.
From your configuration directory there should be a custom_components, in there should be visonic with all the component files in there.

Apologies, bad notes on my part.

I’ve taken a few hours last night and today to update the Wiki here

It’s quite a restructure with some new bits added so take a look, you might be missing out on something that the Integration can do, especially for all you HACS users with the updated version. I think that the structure is more logical now and I’ve also added a content list with links so it’s easier to navigate.

If you have a spare 10 minutes then take a look and let me have comments or things you think are missing :smile: :wink:

Great that you are maintaining this actively Dave.

Couple of minor points for people starting from scratch -

  • In the hardware setup options under ethernet you don’t mention the NodeMCU option … but you have an excellent separate setup page for it
  • To avoid idiots like me getting the wrong directory again (!) suggest to clarify in the software installation that the full directory path created is /config/custom_components/visonic/****

Cheers.

Good idea, I’ve added a bit of a description and a link for it in the “Ethernet Option 2” section. It’s also referenced from the main contents list at the top so that should be OK I think.

This one isn’t true in all cases, for example I don’t have the /config at the start since I run docker and the /config is part of the docker config. I think it better to do it the way I’ve done it i.e. to go to the HA config directory and show the structure from custom_components. Do you not think so?

Thanks for your comments :smile:

Yes :slight_smile: It’s possible, too.

1 Like

Hello,

Does anybody use this component with the latest Visonic PowerMaster-33 EXP G2 alarm ? :slight_smile:

Still looking for the best alarm system with a perfect HA integration so that I can replace most of my PIR sensors with professional and more reliable PIR sensors. But for that I need an alarm system that will forward all sensor status to Hass without latency and whatever the alarm status (armed, disarmed, partially armed,…).

Visonic and Paradox are on my short-list.

Thanks,
David

Hi Dave, getting this warning since 0.110:

Logger: homeassistant.components.alarm_control_panel
Source: components/alarm_control_panel/init.py:96
Integration: Alarm control panel (documentation, issues)
First occurred: 7:32:20 AM (1 occurrences)
Last logged: 7:32:20 AM

AlarmControlPanel is deprecated, modify VisonicAlarm to extend AlarmControlPanelEntity

And also this error:

Logger: homeassistant.config_entries
Source: helpers/entity_component.py:163
First occurred: 7:32:43 AM (2 occurrences)
Last logged: 7:32:43 AM

Error setting up entry Alarm Panel for binary_sensor
Error setting up entry Alarm Panel for switch
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 217, in async_setup
hass, self
File “/usr/src/homeassistant/homeassistant/components/binary_sensor/init.py”, line 139, in async_setup_entry
return await hass.data[DOMAIN].async_setup_entry(entry)
File “/usr/src/homeassistant/homeassistant/helpers/entity_component.py”, line 163, in async_setup_entry
raise ValueError(“Config entry has already been setup!”)
ValueError: Config entry has already been setup!

Is it something I can fix on my side or does it have to do with new 0.110 requisites?

So for the first problem you identify, I also get the same in my log files. I’ve looked at the latest master HA backend source code and AlarmControlPanelEntity doesn’t exist so for the time being I’ll ignore it and wait and see what happens in the next release. As it says deprecated, it will not make any difference to the existing capabilities i.e it will keep working.

The second problem is a known issue with the HA integration system I think (other custom integrations have the same problem), see this earlier post in this thread. I’m waiting for a solution in other components and then I’ll do the same in this one.

Hi Dave,

I have an issue with GUI config as it refuses to save changes with last version.
Result is i’ve lost possibility to bypass sensors as a (new?) option only exists in Gui for enabling bypass.

Whatever combination of checkbox or options in list i tried, i always have that error :

Any idea ?

I might be the only one using bypass fonctionnality from my dashboard thus.

I have to say i’m a bit lost with new GUI stuff. There are options that seems to overlap yaml ones and GUI doesn’t have all parameters for the integration.
But i guess it’s work in progress and next versions will give a more exhaustive config UI.

I have to admit that looks OK and I’ve tried the same in mine (on PC and android mobile phone) and it works. I do not use the HA app though, on my mobile phone I use it through a web browser, might that be it? Are you using the HA app?

Have you scrolled down to the bottom, the sensor bypass setting is the last entry. Have you tried it on a PC or Mac through a web browser.

This is what mine looks like on my PC.

All configuration.yaml settings are in the integration control flow i.e. all configuration settings are available from the configuration.yaml file and the integration settings. Some of the settings are only used at startup and cannot be altered so when you already have the integration and are modifying it then you only get shown the parameters that can be changed while the integration is running. If you delete the integration from HA and try to recreate it, then you will see all the settings.

The following settings are only used for the initial creation:
language, exclude_sensor, exclude_x10, force_standard, force_autoenroll, sync_time, download_code

When you modify an existing integration you do not see these.

Ah no. All the configuration parameters are there already.

Let me know how you get on :slight_smile:

I’ve updated the wiki here to hopefully make it clearer, please also comment on the wiki text if you think I’ve missed something or not explained it well enough.