Visonic Powermax and Powermaster Component

Attached the log files logs.yaml (193.8 KB)

Hi,
Are you using the latest version 0.0.8.1 ??
If so then I’m confused as the only switch I create is to do with X10.
If not then can you please update to 0.0.8.1, try it again and if you still have problems then upload your log file again. Also, make sure you remove custom_components/sensor/visonic.py as it is no longer used.

In either case, when you upload you log file can you make sure you have the logger set to show debug for my Component, please see my post a few posts back.

Thanks

I don’t wish to be mean and discourteous but…

So I appreciate what you’re thinking is here, you’re advertising a plugin for a completely different system (Samsung SmartThings) for a completely different way of connecting to the alarm panel. And in doing so, right in the middle of this forum thread, haven’t done a search for the alternative that you propose on these very forums, see here

I say advertising intentionally, if you check the SmartThings link from your post, there are people selling the necessary hardware.

If you wish to further your discussion on the SmartThings plugin, please do me the courtesy of doing so elsewhere.

@davesmeghead

I’ve made use that all components have been updated to that in the master branch. Attached is the log file following a reboot. I’ve also ensured that the sensor/visonic.py file has been removed.
I’m on 0.87.1

logs.yaml (159.1 KB)

Hi Hombre,

I’ve had a look through your log file and it is indeed now enrolling the sensor as Zone 2. That’s really good to see. I also see that when your panel tells me that it’s enrolled it also sets the zone tamper status, is that something you would expect?

The state of Z02 in the log file is
<state binary_sensor.visonic_z02=off;
device name=Z02,
friendly_name=Garagedeur voorzijde,
zone type name=Perimeter-Follow,
device_armed=True,
zone tamper=Yes,
battery_level=100,
device tamper=No,
visonic device=2,
zone open=No,
zone name=Garage,
zone type=8,
device_tripped=False,
zone chime=Off,
sensor type=UNKNOWN 41,
last_tripped_time=2019-02-14T13:39:49.277656

Although this goes away eventually and is set to No.

The sensor type is set to UNKNOWN 41 as I don’t know what sensor type 41 is. What is the visonic model number of the sensor please and I can add it to my code. Also what type of sensor is it i.e motion, magnet etc. (although if you give me the model number then I can look it up)

Can you check this please. Go in to HA and in to “Configuration”, in “developer tools” select the states “<>” and filter on visonic. Do you see the correct data?

I also see however that you’re still getting the telephone trouble status and I don’t know why, sorry.

I got most of it from the Domotica forums here

Most of it is to do with the Powermax series though so the Powermaster decoding is quite immature in comparison.

OK, I’ve had a look at your log file and you have the problem that I can’t immediatelly resolve. Sometimes the panel just keeps sending a single status message out over and over again.

When the panel does this I’ve tried sending the initialisation commands to it, soft reset commands etc and the panel just ignores them and carries on regardless. What you’re seeing is the effect of this in HA, you get some zone information through but not a lot else. Sorry I can’t be any more help, I can only suggest you leave it alone for a while and go back to it later to try again. I’ll keep searching the internet to see if any other Visonic components for other systems have a solution.

@davesmeghead
no worries. First time it’s done this to me. I’ll leave it for now and do a reset tomorrow morning and come back with an update then.

Hi Dave,

Thanks for the reply.
The information about the sensor is now in the binary overview and in the states overview… Maybe it needed some more time.
The telephone line is not connected, so a valid warning.
I intend to use the Powermaster for detecting open/close/movement, to act on it in HA. Later on I will use it also as burglar alarm.
The unknow sensor type is a MC-302V magnet (http://catalog.visonic.com/powermaster/intrusion-detectors/18/).

Very indepth information at the domotica forum. Will have a good look at it to see if I can analyze my own data😁

BR/

I’ve had it running here overnight and have updated the version on Github to 0.0.8.2. I’ve added the sensor type for the Powermaster so you should get the “magnet” binary sensor in HA instead of the generic one (although you can customise this in HA anyway).

Yeah it is quite in depth. As I don’t have a Powermaster, if you work anything out then let me know and we can add it in to the Component.

@davesmeghead
I went back to first principles and striped out the component and re-installed. I’ve rebooted the alarm and everything seems to be back, except the switch which allows you to display the alarm panel properties. Attached the log file following a reboot.logs.yaml (165.3 KB)

I’ve checked and there is no switch.visonic_alarm_panel defined. Any thoughts?

Oh that’s good, I had a cursory look at the log file and it looks OK, no problems.

Ah yes, that’s the breaking change for version 0.8.0.0 onwards. I removed the switch and placed all its attributes in the alarm control itself, see “alarm_control_panel.visonic_alarm”. The only switches created are for X10 devices. The old switch didn’t do anything anyway, it was just a placeholder for the attributes.
I do say this on the Github page, you must have missed it, I hope it goes well.

Hi Dave,

Thanks for the change in the software. Works great. Planning to buy some ‘specific’ PowerMaster sensors, so will send you some new debug info in a short while.
Is the binary sensor information displayed in HA format or do you make the format? I see some redundant information, like zone type and zone type name, device name and visonic device or is just all the information you get from the sensor displayd?
Looked a bit in the code of the ‘pyvisonic’ program, what I saw was a lot of variables which are defined and read. Would’n it be easier to use a configuration file to load the ‘panel specific’ parameters? Would also make it easier to maintain the code.

Will look further in to it, but Python is not one of my programming skills unfortunately.

BR/

HA does all the formatting but you can customise it within HA if you want to. All I do in the binary_sensor is to define the device_class and HA does the rest.

I set all these as attributes of the sensor. If you go in to “developer tools” “states” i.e. “<>” and filter on visonic you’ll see all of these. You can use these attributes in scripts etc.

Yep, but what do I do with them all, there’s a lot of data I can extract from the EEPROM but what use is it, it just fills up HA

Perhaps but I prefer that it’s in this one file.

OK, just let me know the sensor types for each of the zones and I’ll add them in.

@davesmeghead
Apologies, schoolboy error in not reading the documentation. All working now.

Hello there. I’m trying to install this in a PowerMaster 10. I got some help from @Hombre with the wiring and I’m pretty sure everything is as it should. I’m using a USR-WIFI232-A module. I can access its web settings page, and followed instructions. But all I get in the log is a lot of

2019-02-18 06:51:56 DEBUG (MainThread) [custom_components.pyvisonic] [pmSendPdu] waiting for message response ['0X2']

So it doesn’t seem like it is communicating with the panel. Is there something I need to do in the panel itself? Where should I start looking? Thanks!

…and this is what I get running test.py:

INFO:pyvisonic:Setting key OverrideCode to value -1
INFO:pyvisonic:Setting key ForceStandard to value False
DEBUG:asyncio:Using selector: SelectSelector
INFO:pyvisonic:[Connection] Connected to local Protocol handler and Transport Layer
INFO:pyvisonic:[Startup] Trying to initialise panel
DEBUG:pyvisonic:[ClearList] Setting queue empty
INFO:pyvisonic:[QueueMessage] Exit
INFO:pyvisonic:[pmSendPdu] Sending Command (Exit)    raw data 0d 0f f0 0a
DEBUG:pyvisonic:[pmSendPdu]      waiting for message response []
INFO:pyvisonic:[QueueMessage] Stop
INFO:pyvisonic:[pmSendPdu] Sending Command (Stop)    raw data 0d 0b f4 0a
DEBUG:pyvisonic:[pmSendPdu]      waiting for message response []
INFO:pyvisonic:[QueueMessage] Initializing PowerMax/Master PowerLink Connection
INFO: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
DEBUG:pyvisonic:[pmSendPdu]      waiting for message response ['0X2']
DEBUG:pyvisonic:[Startup]       Success: Got only the required messages
INFO:pyvisonic:[Startup]   count is 1
DEBUG:pyvisonic:[Startup] Sending Download Start
INFO:pyvisonic:[Start_Download] Starting download mode
INFO:pyvisonic:[QueueMessage] Start Download Mode
DEBUG:pyvisonic:[pmSendPdu] Options <class 'int'> <class 'bytearray'> 3 bytearray(b'VP') 2
INFO:pyvisonic:[pmSendPdu] Sending Command (Start Download Mode)    raw data 0d 24 00 00 56 50 00 00 00 00 00 00 35 0a
DEBUG:pyvisonic:[pmSendPdu]      waiting for message response ['0X2']

Hello,
There doesn’t seem to be any communication with the panel, there is nothing being received.

The print out

is misleading, it prints this when it doesn’t get any data

I’m not sure that you have your wiring correct or that you’re interacting with the panel, are you connecting to the correct IP and port address?

Hi Dave,
I tried to update from 0.0.7.2 to 0.0.8.2 but there is an error in the logs (HA 0.87.1) and the alarm related components don’t start. The errors keep repeating.

019-02-21 13:28:54 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal error on transport TCPTransport
Traceback (most recent call last):
  File "uvloop/handles/stream.pyx", line 827, in uvloop.loop.__uv_stream_on_read_impl
  File "/config/custom_components/pyvisonic.py", line 1064, in data_received
    self.handle_received_byte(databyte)
  File "/config/custom_components/pyvisonic.py", line 1145, in handle_received_byte
    self.handle_packet(self.ReceiveData)
  File "/config/custom_components/pyvisonic.py", line 2042, in handle_packet
    self.handle_msgtypeA5(packet[2:-2])
  File "/config/custom_components/pyvisonic.py", line 2437, in handle_msgtypeA5
    oldstate = self.pmX10Dev_t[i].state
KeyError: 0
2019-02-21 13:28:54 ERROR (MainThread) [custom_components.pyvisonic] ERROR Connection Lost : disconnected due to exception  <0>
NoneType: None
2019-02-21 13:28:59 ERROR (MainThread) [custom_components.visonic] PyVisonic has caused an exception 0
2019-02-21 13:29:09 ERROR (MainThread) [custom_components.visonic]  ........... attempting reconnection

My config is:

visonic:
  device:
    type: ethernet
    host: '<my_ip>'
    port: 23
  motion_off: 180
  language: 'EN'
  force_standard: 'yes'
  sync_time: 'yes'
  allow_remote_arm: 'yes'
  allow_remote_disarm: 'yes'

Is it a bug or is it me doing something wrong here?

I also noticed when trying to update from HA 0.87.1 to HA 0.88.0 that there were warnings about file paths for your component. Like ‘switch/visonic.py’ should become ‘visonic/switch.py’ soon etc. or it would break in future. (I went back to HA 0.87.1)

Hi, sorry about that, it’s to do with X10 devices when found in Standard mode. Try 0.0.8.3 please and let me know if it’s OK.

Ah yes. HA in their wisdom have changed the directory and file structure of Components. I’m in the process of converting this Component to the new format and will update it on Github when i’ve finished and tested it.

1 Like

Thx, Dave for your help and continuous improvements on this component.

Edit: Oh wait, I have to check if I used all your files.
Edit2: Yes, I used all the files. The text below is valid.

I uploaded 0.0.8.3 and got a new error:

019-02-21 21:42:58 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal error on transport TCPTransport
Traceback (most recent call last):
  File "uvloop/handles/stream.pyx", line 827, in uvloop.loop.__uv_stream_on_read_impl
  File "/config/custom_components/pyvisonic.py", line 1065, in data_received
    self.handle_received_byte(databyte)
  File "/config/custom_components/pyvisonic.py", line 1146, in handle_received_byte
    self.handle_packet(self.ReceiveData)
  File "/config/custom_components/pyvisonic.py", line 2043, in handle_packet
    self.handle_msgtypeA5(packet[2:-2])
  File "/config/custom_components/pyvisonic.py", line 2453, in handle_msgtypeA5
    if i-1 in x10Names:
NameError: name 'x10Names' is not defined
2019-02-21 21:42:58 ERROR (MainThread) [custom_components.pyvisonic] ERROR Connection Lost : disconnected due to exception  <name 'x10Names' is not defined>
NoneType: None
2019-02-21 21:43:03 ERROR (MainThread) [custom_components.visonic] PyVisonic has caused an exception name 'x10Names' is not defined
2019-02-21 21:43:13 ERROR (MainThread) [custom_components.visonic]  ........... attempting reconnection