Visonic Powermax and Powermaster Component

Ok, somehow everything breaks after updating to 89.1 (coming from 87.1).
Ik deleted all old files and copied the new file structure (“visonic” folder) into custom_components.

Will try again tomorrow with some debugs.

Edit: nevermind, few restarts did the trick…

edit 2: well, it did break…i put back a 87.1 snapshot and reloaded a few times. Something went wrong there…HA says it is running 89.1, but i still seems to be working with the old custom component filesystem…which is not possible? So i deleted all files again. And uploaden version 0.1.0 to the custom_components folder.

Now it breaks again. Component not available,

I tried debugging but the only visonic related entries are:

2019-03-09 21:38:51 ERROR (MainThread) [homeassistant.config] Invalid config for [visonic]: [debug] is an invalid option for [visonic]. Check: visonic->visonic->debug. (See /config/configuration.yaml, line 313). Please check the docs at https://home-assistant.io/components/visonic/
2019-03-09 21:38:51 ERROR (MainThread) [homeassistant.setup] Setup failed for visonic: Invalid config.

This seems to be caused by the snapshot restore. Should have done a wipe and restore…but did a normal restore of all settings. Going back for a wipe and restore now.

edit: OK restore fixed it again, but the same way. I’m apparently running 89.1, but using the old file structure??? seems im still running version 0.0.7.2? But in 89.1…

I did consider it a couple of months ago but recently HA have changed their directory structure and it seems to be causing people problems so putting it in to HA won’t be soon. Also, there’s a lot of tests that it has to pass first and that takes time. I would need to load the library to pypi and get that working correctly too.

I’m currently trying to get debug statements working again, I assume that it’s a HA issue but I’m not sure.

I took debug out of the config settings a while back but HA 88 onwards is more critical of the settings now and so you will get these are errors. Instead you need to use the “logger” component, look back in this thread as to what to set. However, in HA 88 onwards it doesn’t seem to work anymore for custom components.

As for the version numbers issues I’m not sure what’s going on but let me know if you think I can help

@davesmeghead just want to say hi and thanks for this component!
I just ordered the USR-TCP232-E2 and will try as soon as it arrives.
Currently I have a simple relay attached to my Powermaster 30 PGM output but this only gives me armed/disarmed status, not even armed home/away. So I’m really excited to try this component out.

yeah, i noticed, because i used the logger component like you described earlier…
This versioning issue is really weird. I’m goin to try a complete reinstall using only config files, because i suspect the snapshot recovery messed up my entire setup.

Edit: tried reinstall still no luck…How do, even with a clean install. So i reinstalled the hassio image empty, created a custom_components folder and copied the entire “visonic” folder into it. The put back my configration files.

Do i need to change something in the config file when using the new file structure? This was working fine before:

visonic:
  device:
    type: ethernet
    host: '192.168.xxx.xxx'
    port: 23
  motion_off: 120
  language: 'EN'
  debug: 'yes'
  force_standard: 'no'
  sync_time: 'yes'
  allow_remote_arm: 'yes'
  allow_remote_disarm: 'yes'

edit again:

Put everything to debug, and started searching for Visonic:

ERROR (MainThread) [homeassistant.config] Invalid config for [visonic]: [debug] is an invalid option for [visonic]. Just like you said, but I somehow completly missed this :stuck_out_tongue: 

apparently something changed between 0.0.7.2 and 0.1.0 :slight_smile:
The debug option is no longer valid. Just like you mentioned, but I somehow completly missed this part :stuck_out_tongue:

Took it out,and the issue was fixed! But the fact remains that 0.89 apparently still accepts the old custom component structure…

Hi Dave!
I have updated your version and HA and I get the error “Error loading custom_components.core. Make sure all dependencies are installed”

Do you know what can happen?

Thanks in advance

@davesmeghead Thanks for your effort with the visonic thing. This is some work! Anyways, I have a Powermaster 10 v19.4 and with baud rate 9600 on my **USR-TCP232-E2 I had no success what so ever, absolutely nothinng happend after connect… But after readings some odd post at the openhab forum I changed the baud rate to 38400 and then it work a lot better. But how do I know which mode I am connected in; I assume its standard mode but I’ve not seen anything indicating which mode I’m connected in.

Have you deleted all the old component files from your custom components folder, it may have confused home assistant

Save your log file and rename it’s extension to .yaml and then upload it here and I’ll take a look through. It’s possible that such a new panel has a different protocol or at least a tweaked version of the original.

I got response from Sector Alarm, Swedish reseller, and they confirmed their version of PowerMax firmware has the RS-232 pins disabled :cry:

Is that a recent model or do vendors have the option to enable/disable RS232 communications on all models? Maybe the firmware can be sideloaded…

TheLog.yaml (384.0 KB)

Ok, so I’ve uploaded the log file. There is an “Access Denied” entry in the file, I’m not sure but I think I’ve connected a few times without “Access Denied”. Also It sometimes detects when my front door is open but does not seem to detect when it closes.

Ive had a look through the log file and

  1. The access denied is a normal part of the process. However the sequence is messed up somehow, perhaps it’s your newer panel with a slightly changed protocol. If you can, open pyvisonic.py in a text editor and replace all log.debug with log.info as somehow debug data isn’t coming through with logger and custom components. Re upload your log file please
  2. After a while my watchdog kicks in and establishes a connection in standard mode. This works for a while until something weird happens and it all gets out of sync. Again I would need the detailed log file.
  3. I think your hardware setup is ok. Data is being sent by your panel and I can interpret what I can, something happens that my component doesn’t understand I think.

Thankyou for your patience

I find this hard to believe as many of the add-ons won’t work like the powerlink etc
If it’s a newer panel try a baud rate of 38400 as I found out a few posts back. This is new to me too but you could give it a try perhaps

I’m in the same uncomfortable situation. I just purchased a US version of the Powemaster 10. I’ll be able to perform some debugging as soon as I get a USB-to-serial adapter.

Yes, I delete old component files.
On the other hand, I had to install Hassio and it tells me the following error.

019-03-18 19:13:34 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.introduction. Make sure all dependencies are installed Traceback (most recent call last): File “/usr/local/lib/python3.7/site-packages/homeassistant/loader.py”, line 166, in _load_file module = importlib.import_module(path) File “/usr/local/lib/python3.7/importlib/init.py”, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “<frozen importlib._bootstrap>”, line 1006, in _gcd_import File “<frozen importlib._bootstrap>”, line 983, in _find_and_load File “<frozen importlib._bootstrap>”, line 953, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 219, in _call_with_frames_removed File “<frozen importlib._bootstrap>”, line 1006, in _gcd_import File “<frozen importlib._bootstrap>”, line 983, in _find_and_load File “<frozen importlib._bootstrap>”, line 967, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 677, in _load_unlocked File “<frozen importlib._bootstrap_external>”, line 728, in exec_module File “<frozen importlib._bootstrap>”, line 219, in _call_with_frames_removed File “/config/custom_components/init.py”, line 15, in <module> import custom_components.visonic.pyvisonic as visonicApi # Connection to python Library ModuleNotFoundError: No module named ‘custom_components.visonic’

I suppose it will have to do with the Python requirements, but I can not install them in HAssio. Is there anyone who could have done it?

Thanks Dave

Thanks for your help, I appreciate it!
home-assistant.yaml (381.3 KB)
I’ve change debug to info and attached the log file.

Thanks for the detailed log file, the first line in the log file where there’s a problem is this:

2019-03-18 18:27:18 INFO (MainThread) [custom_components.visonic.pyvisonic] [validatePDU] Not valid packet, CRC failed, may be ongoing and not final 0A

The line after has this:
0d ab 0a 00 01 00 00 00 00 00 00 00 43 07 0a checksum calcs 06

So what does this mean. There is a difference in the message checksum (07) and my calculated checksum (06). My checksum calculator has worked for all other messages so I’m not sure why this is suddenly a problem. Further down in your log file I noticed that again there is a checksum problem and there is 1 difference in the checksums.

While I work this out I have attached a pyvisonic.py file (with a yaml extension) pyvisonic.py.yaml (181.0 KB), please rename and replace the existing pyvisonic.py with this file and try it again please and then upload your log file again. Thankyou.

Something strange happens at 2019-03-18 18:29:20.

raw data “0d ab 0a 00 01 00 00 00 00 00 00 00 43 06 0a” is sent…

…and Dumping Current PDU “0d ab 0a 00 01 00 00 00 00 00 00 00 43 07 0a” is received.

There’s no indication of looking for a continuation payload, and no indication of a failed checksum.

Is this expected behavior?

I did not look that far through the time sequence in detail, that is my error. You have highlighted a bug in my code which I believe that I have now fixed so thankyou for that, but I will not upload it yet as it is not vitally necessary.

Let me explain in detail. Where things start to go wrong is still at time 2019-03-18 18:27:18 i.e. earlier than you highlight. The problem is that the checksum is incorrect (and I still don’t know why, it seems to be 1 different) that my code did not react to the original “ab 0a 00 01” at time 2019-03-18 18:27:18, this is an auto-enrolling request from the panel, vitally important to achieve powerlink status and part of the access denied sequence. Because this sequence did not work properly the download timer expired at 2019-03-18 18:29:17 which triggered the bug that I have found and now believe fixed. Do you see what I mean?

UffeNisse
The code that I uploaded as pyvisonic.py.yaml still needs to be tried and new logs uploaded please

Thankyou again