Visonic Powermax and Powermaster Component

Hi Rob, just to explain a bit more
On line 530 of your log file

[pmSendPdu] Sending Command (Exit)    raw data 0d 0f f0 0a    waiting for message response []

This should kick the panel out of the downloading state but the panel can be a bit lazy sometimes so the log file entry you see (on line 541) is my component kicking it out of download state again. That’s all :wink:

Apart from that, is it behaving itself?

1 Like

Hi Steve, just a bit more info for you …
You’ve joined HA just at the time when the HA core developers are completely changing the config system. The old way is to use the configuration.yaml file but this is seen to be too difficult for new users and users who don’t have any software skills. The new way is via the integrations page in the frontend, a simpler way for non-technical people to set up the components/integrations they wish to use.

I recently updated this visonic component to migrate from the yaml file to the HA integration by reading the yaml file only when there is not a visonic integration already in HA. Therefore, after the first time the yaml file is read, it is then ignored as this first time creates an integration in HA.

Hope this makes sense :slight_smile:
D

Yes, it seems to be working as before, perhaps better. From first activity of the UI dashboard after a restart, the panel status is displayed in about 15 seconds. From what I remember, it took 20 - 30 seconds the last time I measured it. Powerlink mode takes 1 minute.

Makes sense, thanks for your support. Looks like new HA has died anyway (suspect old SD card), awaiting new SD card for next attempt.

Do you plan to update the HACS version to V4 any point soon?

Yes definitely, I’m tidying up a few of the python functions and then a bit more testing :smile:

I don’t like python functions that grow too big so I’ve been splitting functions up a bit. It’s a bit of an OCD thing for me I think :rofl: :rofl:

1 Like

I have released version 0.4.1, this includes a github release for HACS that will hopefully work.

After James posted I wondered why I wasn’t doing a HACS release and decided that you can test too much, so I thought it better to get it out there and if there are bugs and things that don’t work then I’m sure you’ll report them here :wink:
There are some code paths that I find difficult to test as I need to make things fail (like using bad data) and/or pretend to be a PowerMaster panel. I do have a few tests that do this but after those tests pass, running it in my own system doesn’t seem to make that much difference.

Let me know how it goes, good and bad please :rofl:
D

After removing the integration and restarting twice HA is now connecting to the alarm panel - thanks again for your work here!

A couple of tweaks I suggest to the wiki -

  • For new users like me, suggest Samba add-on to transfer the component
  • Spell out that the “visionic” directory is required (don’t just copy the python files into custom_components (there is a post near the top of the thread July 2018 that tells you to do that)
  • Be a more explicit on the configuration.yaml being one-shot
  • On the esp-link page mention explictly that the port needed is 23

I’m off to solder in the Node MCU and make it permanent. A good thing in the end that the USB serial board didn’t work first time, otherwise I probably wouldn’t have been bothered to try the Node MCU solution which is so much neater, and so easy to configure.

Did I say thanks ? Well I can’t say it enough.

P.S. I had thought my HA SD card had died overnight, looks like its taking expception suddenly to being wifi connected, plugged LAN cable in and its alive. Go figure !

Hello, thanks for the new HACS version and the integrations page availability, it’s very welcome.

However I can’t report a successful upgrade to the last version (0.4.1 from 0.3.4) the panel is not usable in my setup. I’m currently using a Powermaster 30 with an Ethernet module (USR-TCP232-E2), it was working flawlessly before (and after downgrading again to 0.3.4) but with the new version it’s always trying to reconnect to the panel, it does connect (but does not pull-up the sensors) in “Standard Plus” mode (not Powerlink, 0.3.4 does connect in Powerlink mode w/o problems) and it does not stay that way, always reconnecting.

I’ve done all the recommended steps and even try a new configuration from scratch and the integrations panel… no luck.

I can help debug this if you need it me to do so :slight_smile:

Best regards.

Please upload a log file to pastebin and I’ll take a look through :smile:

EDIT: Just a couple of other points as reminders for everyone

  1. If you have a problem then please upload a log file to pastebin/dropbox (or somewhere else) and put a link in your post that tells me i.e. don’t just post and tell me that it doesn’t work as that doesn’t help me.
  2. Give me a bit of a description as to what you have tried and what goes wrong, what do you see in the frontend
  3. To create the necessary information in the log file I need you to follow the logger: settings here near the bottom of the section on the wiki

Thanks :smile:

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.