We have moved at community.getvera.com

Poll

I would like to know which powermax version people are using with this plugin.

PowerMaxPro
62 (54.4%)
PowerMaxComplete
16 (14%)
PowerMaxExpress
3 (2.6%)
PowerMax+
25 (21.9%)
Some other PowerMax variant or OEM version of it
8 (7%)

Total Members Voted: 106

Author Topic: Plugin for Visonic Powermax Integration  (Read 176411 times)

Offline utz

  • Sr. Member
  • ****
  • Posts: 274
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« on: July 17, 2011, 04:56:36 pm »
Here a first attempt of a powermax+/vera interface (not perfect but works for me).

It makes powermax sensors (currently movement, door contacts (fire, flood still to do)) available in vera.

What you need:
1) a powermax+ (other powermax variants may work too)
2) a Visonic Powermax+ RS232 Interface (about £30 in the shop)
3) a serial to USB converter that is recognized by vera
4) the attached plugin files

Howto:
1) Attach the RS232 Interface to the powermax
2) Connect the RS232 Interface to the USB/Serial and that to vera
3) Upload the plugin files; create a device using the files and explain the device to use the usb/serial port
4) In the powermax device advanced control tab specify the powermax zones you would like to have in vera in the variable altid in form of "Z01,Z02,Z03,Z11". After reload zone devices should become visible
5) Enter the installer mode on the powermax panel. Go to the menu where you define a powerlink device. Activate the powerlink device. This should trick powermax into believing it is talking to a powerlink (but it is vera).
6) Now events from powermax sensors should be visible in vera.
 
Versions:
12.11.2011: Version 7
- uses default alarm partition API D_PowermaxPartition2.json
 
07.09.2011: Version 6
- UI panel for reading event logs
- checksum calculation bugfix
- a number of UI bugfixes

28.08.2011: Version 5
- Solves issue with motion sensors not triggered
- Introduces automatic serial connection re-init every 15min (improves stability)
- code moved to (http://code.mios.com/trac/mios_visonic-powermax)

07.08.2011: Version 4
- Allows to arm and disarm the panel
- Supports events and commands for scenes

03.082011: Version 3
- Bug fixes, support of additional messages

The code moved to http://code.mios.com/trac/mios_visonic-powermax
 
« Last Edit: November 21, 2011, 06:58:43 am by utz »

Offline sten

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #1 on: July 25, 2011, 03:57:32 pm »
Hi Utz,

This is absolutely brilliant!! I have been looking for something like this for a long time now. Anyway, I am not experienced with installing and creating device drivers so I would appreciate a walk through example on how to get the subjected three modules installed and working in vera please.

BR
Sten
Vera3 for Z-Wave Control and the followng Units:
Fibaro: 5 x 500W dimmers Duewi: 2xCircuitBreakers, 5xDimmers Cameras: 2xAxis 213 Alarm: PowerMaxPro with Vera Plugin, 6xPIR, 10xMagDoorSwitches, 2xWaterDetectors, 3xFireDet

Offline utz

  • Sr. Member
  • ****
  • Posts: 274
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #2 on: July 25, 2011, 05:50:59 pm »
If I see this correct you have a powermax pro with an internal powerlink module. I tried my code with a powermax+ a slightly older variant of more or less the same system. I looked at the manual of your powermax pro and I think it has a good chance to work. I assume you have already in the powermax the dual rs232 module installed (to connect your internal powerlink). Thus, there should be a free serial port you can connect to vera via a usb/serial converter. All you need is the right cable (which you can buy or just make your own).

Problems could be
- my code aims to mimic a powerlink. I dont know what will happen with your system as there will be a powerlink AND vera aiming to emulate one.
- powermax pro autodetects a powerlink on the serial port. with powermax+ I can tell it that there is one. So, not sure if the autodetect feature prevents the code to work
- the powermax pro may use a different communication protocol then powermax+. In this case the code will not work as expected. I assume they are using the exact same protocol...

Offline sten

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #3 on: July 26, 2011, 06:56:57 am »
Yes I have a PowerMaxPro with (not an internal) but external PowerLink box which is intended for use with the PowerMax+ and works perfectly with the Pro. Therefore the protocol must be the same for both the internal and external units.

However, I need to know the details on how to create a device based on your code in Vera. As I have no clue how that is performed I need a step by step instruction.

I do have a RS323 <-> USB connected but don't know if it works or not. Any clue on how to check this?

Vera3 for Z-Wave Control and the followng Units:
Fibaro: 5 x 500W dimmers Duewi: 2xCircuitBreakers, 5xDimmers Cameras: 2xAxis 213 Alarm: PowerMaxPro with Vera Plugin, 6xPIR, 10xMagDoorSwitches, 2xWaterDetectors, 3xFireDet

Offline utz

  • Sr. Member
  • ****
  • Posts: 274
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #4 on: July 26, 2011, 09:53:01 am »
Uploading files
1) Go to your vera dashboard
2) Klick on the Mios Developers icon
3) Goto the section Luup files
4) Goto the end of the list where you find empty boxes
5) Select the three powermax files in three boxes (D_Powermax.json; D_Powermax.xml; I_Powermax.xml)
6) Select restart Luup after upload
7) Press go
8) On the top right of your dashboard no error message should pop up when it is done

Serial port
1) supported usb to serial devices are listed here: http://wiki.micasaverde.com/index.php/Serial_Supported_Hardware#USB-Serial_Devices
2) there should be hints as well how to verify it is working

Creating device in dashboard
1) Go to your vera dashboard
2) Klick on the Mios Developers icon
3) Goto the section create device
4) In section UpnpDevFilename enter: D_Powermax.xml
6) press create device

Attach device to serial port
1) Go to your vera dashboard
2) Klick on the Mios Developers icon
3) Goto the section serial port configuration
4) Select for the serial port Used by device and enter the device name you just created
5) select parameters: Baud 9600; Data bits 8; Parity none; Stop bit 1

Configure the powermax device:
1) Go to your vera dashboard
2) Click the spanner on the powermax device
3) Goto advanced
4) In the field altid enter the zones you would like to see: for example Z01,Z02,Z03 (in this case you will get 3 additional child devices in dashboard that represent zone devices such as movement detector or PIR sensor)
5) When done some zone devices should appear (the arm/disarm butten will be bit funny but it goes away after a while)

then it should work. I will write more about how to debug if it does not behave.

Useful reading is this: http://wiki.micasaverde.com/index.php/Luup_Somfy_Walkthrough

That is what I followed to create the plugin (be aware some code syntax has changed and is not correct in the wiki)

If my description has errors, let me know (I never did this in one go ...)


Offline rene

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #5 on: July 27, 2011, 03:06:06 pm »
@Sten: Is it possible that you capture the commands send from the Powerlink to the Powermax in order to determine what the commands are for arming and disarming the panel? Or could can utz or I use you Powerlink to figure out?

I can confirm the protocol discovered sofar looks identical for the Powermax Pro.

Offline utz

  • Sr. Member
  • ****
  • Posts: 274
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #6 on: July 27, 2011, 05:08:19 pm »
There are now a few people at different places that try to make sense of the powermax protocol.

I created a wiki page here: http://powermax.wikia.com/wiki/Powermax_Wiki

The idea is to use this place to collaboratively come up with the protocol specification.

Please edit if you find out more about the protocol.

If it does not work let me know (I never used this wiki before, so I do not know if it works out)

Offline sten

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #7 on: July 28, 2011, 11:52:39 am »
I am very interested in getting this up running but currently I am busy with work. Once I have validated that my RS232 <-> USB converter works with VERA 1 (it does not seem to be on the list of working ones but I will give it a go anyway) and got the device driver properly installed (didn't work the first time I did it) then I am willing to see if I can contribute to the protocol.

Yes I could of course lent you the PowerLink box provided you pick it up at my place and return it there again. However, in the weekend I intend to play with the device driver and I may need the PowerLink for that. When/if I get the the PowerMax working via VERA then I will ditch the PowerLink.....
Vera3 for Z-Wave Control and the followng Units:
Fibaro: 5 x 500W dimmers Duewi: 2xCircuitBreakers, 5xDimmers Cameras: 2xAxis 213 Alarm: PowerMaxPro with Vera Plugin, 6xPIR, 10xMagDoorSwitches, 2xWaterDetectors, 3xFireDet

Offline rene

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #8 on: July 28, 2011, 12:32:42 pm »
I already ordered a Powerlink and expect it to be delivered tomorrow (I got sponsored ;-) )

Offline utz

  • Sr. Member
  • ****
  • Posts: 274
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #9 on: July 28, 2011, 12:40:54 pm »
@rene: very good, then soon we will have the remaining protocol bits. Finally  ;D. The powerlink is an embedded linux, when done with this you might be able to format it and use it for some other duty around the house.


Offline rene

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #10 on: July 28, 2011, 02:42:12 pm »
@sten: I am not authorized to reply to your pm. But I have ordered the Powerlink so do not need yours anymore. Thanks for the offer. As soon as I have any results I will let you know.

Offline sten

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #11 on: August 02, 2011, 03:19:46 am »
I managed to get as far as to install the PowerMax plugin (I think?) using 10 Zones (I presume zones are the zones I have defined in the PowerMax) and I get an option for arming or bypassing. How can I use these sensors to switch on a light in Vera?

Vera3 for Z-Wave Control and the followng Units:
Fibaro: 5 x 500W dimmers Duewi: 2xCircuitBreakers, 5xDimmers Cameras: 2xAxis 213 Alarm: PowerMaxPro with Vera Plugin, 6xPIR, 10xMagDoorSwitches, 2xWaterDetectors, 3xFireDet

Offline utz

  • Sr. Member
  • ****
  • Posts: 274
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #12 on: August 02, 2011, 04:08:23 am »
@sten

the zone devices Z01 to Z10 represent the 10 Zones you defined in the powermax. Lets say Z01 would be a movement detector. So, if someone walks pass that movement detector that is assigned to zone Z01 then the powermax would send a signal over serial link to vera and the red man should become visible in the UI at the Z01 device for a set period of time (I think I coded 5 minutes or so).

To switch on a light when someone moves in front of Z01 you need to define a scene. The event in the scene would be the device z01 tripped and the action would be to send a command to a light switch.


Offline sten

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #13 on: August 03, 2011, 07:37:49 am »
Thank you for your support. I have not managed to get the PowerMax panel to tricker yet. I presume it is the usb to serial adapter although it works with a PC running the PowerMax serial programming software. I have attached the VERA1 dmesg diff output before and after the usb adapter is connected. From this it seems that the serial adapter is recognized and working - not? Any clue is appreciated...

root@MiOS:~# cat zzz
--- xxx   Wed Aug  3 12:52:22 2011
+++ yyy   Wed Aug  3 12:52:56 2011
@@ -1,8 +1,4 @@
-'s a 5350.
-mini_fo: using base directory: /
-mini_fo: using storage directory: /jffs
-jffs2.bbc: SIZE compression mode activated.
-b44: eth0: Link is up at 100 Mbps, full duplex.
+ex.
 b44: eth0: Flow control is off for TX and off for RX.
 device eth0.0 entered promiscuous mode
 eth0.0: dev_set_promiscuity(master, 1)
@@ -285,3 +281,6 @@
 hub.c: new USB device 00:03.0-1.1, assigned address 11
 usbserial.c: CP210X converter detected
 usbserial.c: CP210X converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
+hub.c: new USB device 00:03.0-1.2, assigned address 12
+usbserial.c: PL-2303 converter detected
+usbserial.c: PL-2303 converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
root@MiOS:~#
Vera3 for Z-Wave Control and the followng Units:
Fibaro: 5 x 500W dimmers Duewi: 2xCircuitBreakers, 5xDimmers Cameras: 2xAxis 213 Alarm: PowerMaxPro with Vera Plugin, 6xPIR, 10xMagDoorSwitches, 2xWaterDetectors, 3xFireDet

Offline utz

  • Sr. Member
  • ****
  • Posts: 274
  • Karma: +0/-0
Plugin for Visonic Powermax Integration
« Reply #14 on: August 03, 2011, 07:58:23 am »
serial port looks fine.

next you have to turn on verbose logging and then have a look in /var/log/cmh/ (I forgot the filename and I am not near my vera). You should see there if data is sent out or is coming in.