Visonic Powermax and Powermaster Component

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

home-assistant.yaml (181.1 KB)

Sorry, I was a bit busy with other things. But here is the log file created by the new pysonic.py.

Oh that’s OK, there’s no hurry for these things, it’s just that I wanted you to still try it.

Have you changed anything, like updated HA at all. The thing is, the log.info logging isn’t working from custom components now, all I can really see from the log file is that my code crashes when decoding one of the panel messages but I can’t see the message content. The logger facility in HA is broken and no one seems to be trying to fix it. Can you make sure you have this in your configuration.yaml and try it again please

logger:
  default: info

@davesmeghead
home-assistant.newpy.yaml (25.0 KB)
home-assistant.oldpy.yaml (71.2 KB)
Well, I allway changes a lot of things but not anything to do with HA. Anyways I made new run with the new pyvisonic.py resulting in the .newpy.yaml file and then I switched back to the previous pyvisonic.py giving oldpy.yaml.

@davesmeghead
home-assistant.3.yaml (320.1 KB)
Problem was in the pysonic.py. Log level set to warning,