Add WiFi to your alarm with esp8266

Forum about Visonic products like Powermax Plus and Powermax Pro

Moderators: Rene, Willem4ever

Re: Add WiFi to your alarm with esp8266

Postby cjcharles » Mon Mar 27, 2017 10:36 pm

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: April 2016

Re: Add WiFi to your alarm with esp8266

Postby cjcharles » Sun Apr 09, 2017 6:02 pm

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!
cjcharles
Starting Member
Starting Member
 
Posts: 16
Joined: April 2016

Re: Add WiFi to your alarm with esp8266

Postby al30k » Tue Aug 15, 2017 10:42 pm

Hi, is it possible to "arm away" or "arm home" in instant mode with this app?
al30k
Starting Member
Starting Member
 
Posts: 5
Joined: August 2017

Re: Add WiFi to your alarm with esp8266

Postby cjcharles » Fri Sep 22, 2017 11:29 am

@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.
cjcharles
Starting Member
Starting Member
 
Posts: 16
Joined: April 2016

Re: Add WiFi to your alarm with esp8266

Postby coco2083 » Fri Dec 29, 2017 1:23 pm

Hi,

Thank you so much @irekz

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

Regards,
coco2083
Starting Member
Starting Member
 
Posts: 3
Joined: August 2015

Re: Add WiFi to your alarm with esp8266

Postby alkat » Fri Jun 01, 2018 5:36 pm

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: 3
Joined: June 2018

Re: Add WiFi to your alarm with esp8266

Postby alkat » Sun Jun 03, 2018 7:49 pm

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?
alkat
Starting Member
Starting Member
 
Posts: 3
Joined: June 2018

Re: Add WiFi to your alarm with esp8266

Postby CybFox » Mon Sep 24, 2018 10:37 am

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 ?
CybFox
Starting Member
Starting Member
 
Posts: 4
Joined: July 2012

Re: Add WiFi to your alarm with esp8266

Postby cjcharles » Mon Sep 24, 2018 9:57 pm

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.
cjcharles
Starting Member
Starting Member
 
Posts: 16
Joined: April 2016

Re: Add WiFi to your alarm with esp8266

Postby aburst42 » Thu Oct 25, 2018 12:59 am

@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++;
aburst42
Starting Member
Starting Member
 
Posts: 1
Joined: October 2018

Re: Add WiFi to your alarm with esp8266

Postby alkat » Fri Nov 02, 2018 4:31 am

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.
alkat
Starting Member
Starting Member
 
Posts: 3
Joined: June 2018

Previous

Return to Visonic Alarm systems

Who is online

Users browsing this forum: No registered users and 1 guest