SmartThings Community

[RELEASE] Visonic Powermax Alarm

dth_security
dth_sensors
requires_server
project_security
project_sensors

(cjcharles) #306

The level converters I could never get working and reliable hence why I used an Arduino. I think if you just change the level you still get some switching noise passed on to the Wemos, or something similar, hence can get problems, Would suggest that Arduino solution is your best and easiest bet


(Antonio) #307

Thank you Charles for your help.

I have flashed WEMOS and Arduino Nano, and I have the same situation than when direct wired comms.

I think that no powerlink enrolment is possible with my panel. could you help me on this @cjcharles? any clue to work on it?

I copied text data from log file (powermaxwin utility), screen messages and final JSON state.

TEXT LOG DATA:

PC [22:10:52]0x0D,0x0F,0xF0,0x0A [DLOAD EXIT]

PC [22:10:53]0x0D,0xAB,0x0A,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x06,0x0A [INIT]

PM [22:10:53]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PC [22:11:04]0x0D,0x24,0x00,0x00,0x36,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0x0A [DLOAD START]

PM [22:11:05]0x0D,0x02,0xFD,0x0A [ACK]

PM [22:11:05]0x0D,0x08,0xF7,0x0A [ACCESS DENIED]

PM [22:11:17]0x0D,0xA5,0x00,0x04,0x08,0x47,0x00,0x00,0x02,0x00,0x00,0x00,0x43,0xC1,0x0A [Status Update Panel]

PC [22:11:17]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PM [22:11:17]0x0D,0xA7,0x01,0x00,0x00,0x61,0x00,0x00,0x02,0x00,0x00,0x00,0x43,0xB0,0x0A

PC [22:11:17]0x0D,0x02,0x43,0xBA,0x0A [ACK]

P? [22:11:22]0x00,0x0D,0xA5,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x16,0x0A,0x0D,0xF1,0x07,0x43,0x00,0x00,0x8B,0x56,0x0A

PM [22:11:25]0x0D,0xA5,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x16,0x0A

PC [22:11:25]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PM [22:11:25]0x0D,0xA5,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x15,0x0A [Status Update Zone Battery]

PC [22:11:25]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PM [22:11:25]0x0D,0xA5,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x14,0x0A [Status Update Zone tamper]

PC [22:11:25]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PM [22:11:25]0x0D,0xA5,0x00,0x04,0x00,0x41,0x00,0x00,0x00,0x04,0x00,0x00,0x43,0xCD,0x0A [Status Update Panel]

PC [22:11:25]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PM [22:11:25]0x0D,0xA5,0x00,0x05,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x43,0x11,0x0A

PC [22:11:25]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PM [22:11:25]0x0D,0xA5,0x00,0x06,0x00,0x08,0x00,0x30,0x00,0x00,0x00,0x00,0x43,0xD8,0x0A [Status Update Zone Bypassed]

PC [22:11:25]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PM [22:11:25]0x0D,0xA5,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x10,0x0A

PC [22:11:25]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PM [22:11:25]0x0D,0xA5,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x0F,0x0A

PC [22:11:25]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PM [22:11:25]0x0D,0xA7,0x01,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0xF7,0x0A

PC [22:11:25]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PM [22:11:25]0x0D,0xA7,0x01,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0xB3,0x0A

PC [22:11:25]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PM [22:11:27]0x0D,0xA5,0x00,0x04,0x00,0x25,0xFF,0x0D,0x02,0x00,0x00,0x00,0x43,0xDE,0x0A [Status Update Panel]

PC [22:11:27]0x0D,0x02,0x43,0xBA,0x0A [ACK]

PM [22:11:27]0x0D,0xA7,0x01,0x00,0x00,0x2D,0xFF,0x0D,0x02,0x00,0x00,0x00,0x43,0xD7,0x0A

PC [22:11:27]0x0D,0x02,0x43,0xBA,0x0A [ACK]

SCREEN MESSAGES:

[6][serialHandler @ 34] — new packet 22:10:53 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Acknowledgement’

[6][serialHandler @ 34] — new packet 22:11:05 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Acknowledgement 2’

[6][serialHandler @ 34] — new packet 22:11:05 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Access denied’

[6][PowerMaxAlarm::OnAccessDenied @ 1288] Access denied

[6][serialHandler @ 34] — new packet 22:11:17 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Status Update Panel’

[6][PowerMaxAlarm::OnStatusUpdatePanel @ 1464] System status: Programming (8), Flags : Ready Alert-in-Memory Trouble Arm/disarm-event

[6][serialHandler @ 34] — new packet 22:11:17 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Panel status change’

[6][PowerMaxAlarm::OnStatusChange @ 1319] PmaxStatusChange: ‘Installer Programming’ by ‘System’(0x0)

[4][serialHandler @ 50] Passing invalid packet to packetManager

[3][PowerMaxAlarm::handlePacket @ 1800] Packet not correctly formated

[3][logBuffer @ 1588] Buffer: 0D A5 00 01 00 00 00 00 00 00 00 00 43 16 0A 0D F1 07 43 00 00 8B

[6][serialHandler @ 34] — new packet 22:11:25 ----

[6][PowerMaxAlarm::handlePacket @ 1794] Packet not recognized

[6][logBuffer @ 1588] Buffer: A5 00 01 00 00 00 00 00 00 00 00 43

[6][serialHandler @ 34] — new packet 22:11:25 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Status Update Zone Battery’

[6][PowerMaxAlarm::OnStatusUpdateZoneBat @ 1546] Status Update : Zone state/Battery

[6][serialHandler @ 34] — new packet 22:11:25 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Status Update Zone tamper’

[6][PowerMaxAlarm::OnStatusUpdateZoneTamper @ 1375] Status Update : Zone active/tampered

[6][serialHandler @ 34] — new packet 22:11:25 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Status Update Panel’

[6][PowerMaxAlarm::OnStatusUpdatePanel @ 1464] System status: Disarmed (0), Flags : Ready Arm/disarm-event

[6][serialHandler @ 34] — new packet 22:11:25 ----

[6][PowerMaxAlarm::handlePacket @ 1794] Packet not recognized

[6][logBuffer @ 1588] Buffer: A5 00 05 00 00 00 00 01 00 00 00 43

[6][serialHandler @ 34] — new packet 22:11:25 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Status Update Zone Bypassed’

[6][PowerMaxAlarm::OnStatusUpdateZoneBypassed @ 1413] Status Update : Zone Enrolled/Bypassed

[6][PowerMaxAlarm::OnStatusUpdateZoneBypassed @ 1422] Zone 12 is enrolled

[6][PowerMaxAlarm::OnStatusUpdateZoneBypassed @ 1422] Zone 29 is enrolled

[6][PowerMaxAlarm::OnStatusUpdateZoneBypassed @ 1422] Zone 30 is enrolled

[6][serialHandler @ 34] — new packet 22:11:25 ----

[6][PowerMaxAlarm::handlePacket @ 1794] Packet not recognized

[6][logBuffer @ 1588] Buffer: A5 00 07 00 00 00 00 00 00 00 00 43

[6][serialHandler @ 34] — new packet 22:11:25 ----

[6][PowerMaxAlarm::handlePacket @ 1794] Packet not recognized

[6][logBuffer @ 1588] Buffer: A5 00 08 00 00 00 00 00 00 00 00 43

[6][serialHandler @ 34] — new packet 22:11:25 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Panel status change’

[6][PowerMaxAlarm::OnStatusChange @ 1319] PmaxStatusChange: ‘General Restore’ by ‘System’(0x0)

[6][serialHandler @ 34] — new packet 22:11:25 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Panel status change’

[6][PowerMaxAlarm::OnStatusChange @ 1319] PmaxStatusChange: ‘System Reset’ by ‘System’(0x0)

[6][serialHandler @ 34] — new packet 22:11:27 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Status Update Panel’

[6][PowerMaxAlarm::OnStatusUpdatePanel @ 1464] System status: Disarmed (0), Flags : Ready Trouble Zone-event

[6][serialHandler @ 34] — new packet 22:11:27 ----

[6][PowerMaxAlarm::handlePacket @ 1786] Command found: ‘Panel status change’

[6][PowerMaxAlarm::OnStatusChange @ 1319] PmaxStatusChange: ‘Control Panel Low Battery’ by ‘System’(0x0)

JSON STATE

{“stat”:0,
“stat_str”:“Disarmed”,
“lastCom”:397,
“panelType”:-1,
“panelTypeStr”:“Alarm-event”,
“panelModelType”:0,
“alarmState”:0,
“alarmStateStr”:“None”,
“alarmTrippedZones”:,
“flags”:37,
“flags_ready”:true,
“flags_alertInMemory”:false,
“flags_trouble”:true,
“flags_bypasOn”:false,
“flags_last10sec”:false,
“flags_zoneEvent”:true,
“flags_armDisarmEvent”:false,
“flags_alarmEvent”:false,
“enroled_zones”:[{“zoneName”:"",
“zoneType”:0,
“zoneTypeStr”:"(null)",
“sensorId”:0,
“sensorType”:"(null)",
“sensorMake”:"(null)",
“signalStrength”:0,
“stat_doorOpen”:false,
“stat_bypased”:false,
“stat_lowBattery”:false,
“stat_active”:true,
“stat_tamper”:false},
{“zoneName”:"",
“zoneType”:0,
“zoneTypeStr”:"(null)",
“sensorId”:0,
“sensorType”:"(null)",
“sensorMake”:"(null)",
“signalStrength”:0,
“stat_doorOpen”:false,
“stat_bypased”:false,
“stat_lowBattery”:false,
“stat_active”:true,
“stat_tamper”:false},
{“zoneName”:"",
“zoneType”:0,
“zoneTypeStr”:"(null)",
“sensorId”:0,
“sensorType”:"(null)",
“sensorMake”:"(null)",
“signalStrength”:0,
“stat_doorOpen”:false,
“stat_bypased”:false,
“stat_lowBattery”:false,
“stat_active”:true,
“stat_tamper”:false}]}


(Antonio) #308

YHi all again,

I compiled the powermaxwin tool with my installer passas powerlink PID and it works nicely now.

I have got some " Packet not recognized"and “Packet not correctly formated”. How can I proceed to debug this protocol errors? is it publisehd some were the protocol?

Thank you in advance.


(cjcharles) #309

So everything is working? Where did you add your master/installer pin? If adding it to powermaxwin then presumably you are using the Wemos as a relay device?

You should also be aware that due to the time to process and display the debug information on the Wemos telnet interface you can end up with the device not working when you put it in debug mode. Once you take it out of debug mode it normally starts working as the Wemos runs a bit faster.

There are always some unknown packets on Powermax since Visonic have never published the full information behind the protocol, but it rarely causes a problem for operation since the errors are typically related to information that is not very important.


(Antonio) #310

Yes, the WEMOS is working as a relay device. WEMOS is not able to get powermax configuration and setup, but the remote windows client, conected to the WEMOS is able to manage the powermax system completly (arm/disarm/ zone names/ state / signal / etc…)

In the PMAX library, there is a “temporal” powerlink enrollment PIN. If I leave it with the default value (as it is suggested in the comentaries, “Does not have to match any of user or installer codes.”) my WEMOS is not able to enroll at all (i waited several times, with resets and power off, several minutes… and no enrollment is achieved).

If I put my master or normal instaler code there:

#define POWERLINK_PIN 0x3622;

It works nicely.

I will try to compile the WEMOS firmware with this parameter chaged and I will give you feedback with the results.

Thank you for the info Charles,

Antonio


(cjcharles) #311

Im Chris actually! I will integrate that code change into the settings page this week, since using a pin of AAAA is needed to get Powermaster systems pairing - so makes sense to make it accessible for everybody. I just havent seen any Powermax systems where you cannot use the default PIN which is defined by Powerlink… Maybe that is partly behind some of the systems online not working too…

Hence I suggest you can hold fire for a couple more days and then you can use the finished firmware file which should work completely.


(Antonio) #312

Ok Chris, keep me updated please!

Antonio


(Antonio) #313

I have recompiled your firmware with the installer code hardcoded and it works nicely too.

One question Chris, what is it exactly the MQTT functionality? is it reporting to the server each powermax message? I mean, can we monitor the PM messages in the same way that we can do it with the powermaxwin utility?

Thank you


(cjcharles) #314

Ok great, MQTT allows you to send Powermax messages to other Smart Home platforms which use MQTT as a message format. This it particularly relevant for things like OpenHAB or similar. It is probably not useful for most people, but for some it will be useful.


(cjcharles) #315

For everybody watching. The firmware on my Github page now includes the ability to set a custom PIN, this should help the Wemos pair with a few models of alarm that previously you couldnt enrol the Wemos. Probably relevant for you @lllll


(Seima) #316

Went back from Vera to Smarthing to try out this new firmware. Flashed but nonthing is working. I am not sure if it is because I don’t have Arduino adapter, just ordered one from your shop this morning hope getting it soon.


(cjcharles) #317

Maybe drop me a PM, it would be really interesting to diagnose this now, as I have a lot more knowledge about the weird intricacies of Powermax Serial comms and what the common problems are. I might have expected arm commands to work with this new firmware (after changing the PIN from default 3622 to your master PIN, and after that to try user PIN), even if nothing else did due to the lack of an Arduino.


#318

Hi Everyone

Thank you cjcharles! Last sunday I installed my new Powermax Pro panel and I just had to go look for interesting things to do with it. I stumbled over this thread and had to try this out with a NodeMCU I had laying around. After flashing it worked like a charm except I had to change the PIN to my master installer PIN to get the panel to enroll.
However, I cannot get the MQTT to work it seems…?
What is the purpose of the link at the bottom saying “?X=Y - inactivity_seconds, ip_for_st, port_for_st, mqtt_username, mqtt_password” ? Clicking on it takes me to /config which says “success”.
I’ll be happy to contribute to this with my somewhat limited programming skills…


(cjcharles) #319

That link is the config link so that it can be configured through ST, and now that I have added the advanced page it isnt needed by end users hopefully.
So you have added an MQTT ip address and port (under the HA IP and HA Port), plus username and password, and ticked the enable MQTT mode? You’ll need to use HTTP for the time being.


#320

I changed to websockets (had to reconfigure my broker for that). However when testing with a MQTT client I cannot send or receive any messages to alarm/panel or alarm/set unless I put a / in front, like /alarm/panel.
The ESP8266 doesn’t send or receive so I thought I’d try recompiling, after I changed to /alarm/panel and /alarm/set in the sketch but then I get compiling errors.

‘Pmax_ARMHOME_INSTANT’ was not declared in this scope
‘Pmax_ALARM’ was not declared in this scope


(cjcharles) #321

Ah, didnt realise all topics had to be preceeded by a slash in some environments - I tested with a small MQTT broker app and it worked fine without. In that case I’ll update the firmware to add the slashes. Can you drop me a message so we can confirm its fully ironed out?

EDIT: Ive just read online that you should never use topics which have a leading slash as it is outside of the specification of MQTT (since it results in a zero char topic at the start)…


#322

I’m new to this so don’t take my word for it. But I could not get any messages through without the leading slash.
I just did some tests again, using test.mosquitto.org:8080 but I cannot get it to work… Is a username and password needed to connect? I don’t use authentication (yet).


(cjcharles) #323

i think any old authentication is fine for it to work. Sadly due to the HA IP storage it will only work with an IP for the MQTT broker, not a web address. I’ll do some more testing this weekend but it surprises me it doesnt work!


#324

Sorry, I should have mentioned that I use the ip of the broker.


(cjcharles) #325

Updated firmware to fix an MQTT bug, and it now works smoothly - and with simplified messages that are easier to interpret (plus it now uses the retain flag so that a restart of the MQTT server will not cause a problem with previous status messages being lost.