Add WiFi to your alarm with esp8266

Forum about Visonic products like Powermax Plus and Powermax Pro

Moderators: Rene, Willem4ever

cjcharles
Starting Member
Starting Member
Posts: 16
Joined: Mon Apr 25, 2016 6:50 pm

Re: Add WiFi to your alarm with esp8266

Post by cjcharles »

Very nearly there now, it is doing everything I need, so thanks again!

Ive still not managed to solve my above message about the comms failure (despite trying a few options such as an unplug/reset 8266/replug). However, I am also finding that the ESP does sometimes miss events if they are close together. i.e. if I trigger two zones within about 2s then I do not catch the second event.

Does this mean I need to optimise my code as Im hogging too much CPU (I'd be disappointed if so as all I go is make a few HTTP POST commands after zone events), or is this part of the problem of working with the slow Serial interface to Visonic Powermax? I did try disabling my code and I do also miss them in the telnet debug panel, so potentially the second option. Has anybody else found this?
cjcharles
Starting Member
Starting Member
Posts: 16
Joined: Mon Apr 25, 2016 6:50 pm

Re: Add WiFi to your alarm with esp8266

Post by cjcharles »

FYI, as mentioned in another thread, I managed to solve the error about 'communications failure' by unplugging the Powermax and removing the battery, then waiting 30seconds before plugging in again. That now gives me no error messages! :)

I have also found that it misses none of my recent zone events, so perhaps it was just still processing something, so all is great!

Last thing to work out is how to get it to pair with Powermax Pro, which seems to give access denied errors (Complete and Express work like a charm). Have tried all sorts, but it is only ever able to arm (no status access or disarm access - presumably as it is blocking an unpaired device), cant see any options in any menu to pair. Will keep looking!!

Thanks again.

p.s. If anybody is interested I have been working on getting Powermax integrated with SmartThings and it is very nearly there! If you want to know more you can see it at https://community.smartthings.com/t/bet ... =cjcharles . Credit to irekz for a lot of it!
al30k
Starting Member
Starting Member
Posts: 5
Joined: Mon Aug 14, 2017 8:02 pm

Re: Add WiFi to your alarm with esp8266

Post by al30k »

Hi, is it possible to "arm away" or "arm home" in instant mode with this app?
cjcharles
Starting Member
Starting Member
Posts: 16
Joined: Mon Apr 25, 2016 6:50 pm

Re: Add WiFi to your alarm with esp8266

Post by cjcharles »

@al30k - have a look at my Visonic Integration for SmartThings, I have added Instant Arm to that, you could easily draw this into another project.
coco2083
Starting Member
Starting Member
Posts: 3
Joined: Thu Aug 06, 2015 5:17 pm

Re: Add WiFi to your alarm with esp8266

Post by coco2083 »

Hi,

Thank you so much @irekz

ESP8266 work with Wifi.
For security (scrambler) and the stability is it possible use RJ45 Ethernet plug ?

Regards,
alkat
Starting Member
Starting Member
Posts: 4
Joined: Fri Jun 01, 2018 5:11 pm

Re: Add WiFi to your alarm with esp8266

Post by alkat »

Thank you for the detailed instructions, it was easy to program esp8266 and connect to PM Complete. But for some reason I'm unable to arm/disarm or control the system. I'm able to connect and get status through browser or telnet but should I configure PM so it will accept command?

{"stat":0,
"stat_str":"Disarmed",
"lastCom":6623,
"panelType":-1,
"panelTypeStr":"16",
"panelModelType":0,
"alarmState":0,
"alarmStateStr":"None",
"alarmTrippedZones":[],
"flags":5,
"flags_ready":true,
"flags_alertInMemory":false,
"flags_trouble":true,
"flags_bypasOn":false,
"flags_last10sec":false,
"flags_zoneEvent":false,
"flags_armDisarmEvent":false,
"flags_alarmEvent":false,
"enroled_zones":[]}
alkat
Starting Member
Starting Member
Posts: 4
Joined: Fri Jun 01, 2018 5:11 pm

Re: Add WiFi to your alarm with esp8266

Post by alkat »

I 'm still struggling to make it working with PM Complete but looks like the issue is "panelType":-1
means it can't recognize panel. But from other side I can see statuses such as "Disarmed", "Exit Delay" means serial communication is working.

What could be the reason for not identifying the panel?
CybFox
Starting Member
Starting Member
Posts: 4
Joined: Mon Jul 09, 2012 12:54 pm

Re: Add WiFi to your alarm with esp8266

Post by CybFox »

Hi,

Has anybody had success with a Powermax Pro panel ? I'm searching in all menu's but can't find the "Install Powerlink" option.

Here's what I have (tried) so far:
- ESP8266 board connected to gnd/tx/rx on the panel, adapt wifi settings in sketch, compiled and uploaded the sketch, first by USB, now OTA
- telnet keeps printing these:

Code: Select all

Passing invalid packet to packetManager
checksum: 0000
checksum OK
Packet received
BufferSize: 2
Buffer: 00 00 
Packet not recognized
BufferSize: 2
Buffer: 00 00 
Sending the following buffer to serial TTY
checksum: 00FD
serial write OK
End of packet treatment
occasionally a longer message appears and that got decoded like

Code: Select all

Command found: 'Status Update Zone Battery'
or messages like:

Code: Select all

Passing invalid packet to packetManager
checksum: 009C
Packet not correctly formated
BufferSize: 17
Buffer: A5 00 02 00 00 00 00 00 00 00 00 43 16 0A 58 00 00 
End of packet treatment
status:

Code: Select all

{"stat":13,
"stat_str":"Not Ready",
"lastCom":0,
"panelType":-1,
"panelTypeStr":"16",
"panelModelType":0,
"alarmState":0,
"alarmStateStr":"None",
"alarmTrippedZones":[],
"flags":0,
"flags_ready":false,
"flags_alertInMemory":false,
"flags_trouble":false,
"flags_bypasOn":false,
"flags_last10sec":false,
"flags_zoneEvent":false,
"flags_armDisarmEvent":false,
"flags_alarmEvent":false,
"enroled_zones":[]}
I tried changing the POWERLINK_PIN define to my installer code, but that didn't help so I reset it.

The enrolment page on Github says that for Powermax Pro the enrolment should go via the "Installer menu". Installer menu's are numbered (1= Instal. code, 4= Centrale,...) could someone tell me in which number I should find the enroll option ? Does this menu appear when the powerlink is correctly detected ?
cjcharles
Starting Member
Starting Member
Posts: 16
Joined: Mon Apr 25, 2016 6:50 pm

Re: Add WiFi to your alarm with esp8266

Post by cjcharles »

There are a few problems I have found which some may overlap with your symptoms:
1) The voltages are not tied together with a good ground, this creates noise on the serial connection and can give those fake 00 packets (which is just noise). I dont know what model of ESP you are using, but I have found Wemos chips work better since they have more voltage regulation circuitry on them.
2) I have found the ESP doesnt have the best serial pins, when trying to talk to some models of Powermax (though typically this is the case for Powermax+ not Pro). I get around this by using a simple Arduino 168/328 to act as a serial mirror which allows you to fix the timings, which can help ensure good timing of packets.
3) Be aware that using the debug interface applies significant latency to the connection, some models of alarm will not pair if you attempt to use the debugging code at the same time as actually pairing (since the pairing process requires quicker timings). I suggest relying on it to do its thing. Or have a look at some of my modified libraries on the SmartThings forum, since there I have enabled mirroring or packets to Serial1, which can be done with no adverse performance impacts.
aburst42
Starting Member
Starting Member
Posts: 1
Joined: Thu Oct 25, 2018 1:42 am

Re: Add WiFi to your alarm with esp8266

Post by aburst42 »

@CybFox, @cjcharles, I have a PowerMax Pro panel. I hadn't been able to connect to it (with either Irek's code or Charles' code) until another friend updated the code a bit. Then, it worked wonderfully. The code change is small, in the serialHandler method (bolded below).

The procedure I then followed was:
1. Compile and upload the code to the Wemos
2. Let the Wemos warm up to the point where I could access the onboard "status" website
3. On the panel, enter the Installer menu, then exit it immediately - as Irek pointed out, this causes the PowerMax Pro panel to start scanning for PowerLink modules, which enrolls the Wemos as a "virtual" PowerLink module.
4. After that, I could see zone information and control the alarm status after only a couple of seconds.

@cjcharles where do you pick up the latest copy of pmax.h and pmax.cpp? I'd love to have the version that contains the definitions of Pmax_ALARM and Pmax_ARMHOME_INSTANT, so those actions are also available...

bool serialHandler(PowerMaxAlarm* pm) {
bool packetHandled = false;

PlinkBuffer commandBuffer ;
memset(&commandBuffer, 0, sizeof(commandBuffer));

char oneByte = 0;
while ( (os_pmComPortRead(&oneByte, 1) == 1) )
{
// wait for the preamble
if (commandBuffer.size == 0 && oneByte != 0x0D)
continue;


if (commandBuffer.size<(MAX_BUFFER_SIZE-1))
{
*(commandBuffer.size+commandBuffer.buffer) = oneByte;
commandBuffer.size++;
alkat
Starting Member
Starting Member
Posts: 4
Joined: Fri Jun 01, 2018 5:11 pm

Re: Add WiFi to your alarm with esp8266

Post by alkat »

Thank you very much - your one line code modification fixed connection issue with PM Complete!

Quick question, except telnet (using arm/disamr etc.) are you able to connect Visonic Driver Windows application? ANy suggestion for mobile (iOS/Android apps) etc?

I'm just looking for some useful application for this esp8266 solution. What are you guys using, please suggest.
ayasystems
Starting Member
Starting Member
Posts: 40
Joined: Wed May 28, 2014 5:05 pm

Re: Add WiFi to your alarm with esp8266

Post by ayasystems »

I have coded a new ESP8266 program using the irekzielinski library

If you want to test it -> https://github.com/ayasystems/PowerMaxEsp8266
alkat
Starting Member
Starting Member
Posts: 4
Joined: Fri Jun 01, 2018 5:11 pm

Re: Add WiFi to your alarm with esp8266

Post by alkat »

Could you please provide some instructions, such as where to specify SSID, Password etc. I was able to compile the sketch but can't see constants to change for my local network.

Thank you
Post Reply

Return to “Visonic Alarm systems”