e-mcgee / paradox_platform

Paradox alarm homebridge platform
25 stars 6 forks source link

Zone state not being updated #22

Closed sricard999 closed 5 years ago

sricard999 commented 6 years ago

Good evening,

First, let me thank you for publishing this plugin. I have an SP7000 and IP100, latest firmware. I am able to arm/disarm, connect/disconnect from the HomeKit app but I am not able to see any zone status change. It seems not to be able to detect zone state changes. I am running from the command line in debug mode and I see all my zones being reported as Zone X off (zone name).

Got it all installed and working this week-end so I should have the latest versions of the plugins. I am running on a fresh install of Debian 9.

Thanks in advance for you help Stephane

e-mcgee commented 6 years ago

The plugin detects all messages from the alarm. Are you able to trigger a zone (e.g. motion sensor) and then see any message pertaining to that zone on the command line?

e-mcgee commented 6 years ago

I mean the log output on the command line

sricard999 commented 6 years ago

I always see Zone 1 off every 5 seconds even if the zone should report opened. I see opened in the iOS app and on the keypad.

e-mcgee commented 6 years ago

That means that it is not reporting the zone status correctly. Not sure if there may be a difference on SP7000. I use MG5050.

sricard999 commented 6 years ago

Thanks,

This is what I figured. Looked at your code to try and figure out what could be happening but not simple. I’m sure you spent countless hours reverse engineering Paradox’s protocol. Do you have access to some documentation or you figured it all on your own?

I don’t understand the homebridge framework yet, so was wondering if there is a way to easily troubleshoot/ debug code when developing? Do you do it outside or within the framework?

I would love to get this working properly.

Thanks for your support.

Stéphane

Sent from my iPhone

On Mar 10, 2018, at 8:32 AM, e-mcgee notifications@github.com<mailto:notifications@github.com> wrote:

That means that it is not reporting the zone status correctly. Not sure if there may be a difference on SP7000. I use MG5050.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fe-mcgee%2Fparadox_platform%2Fissues%2F22%23issuecomment-372030243&data=02%7C01%7C%7Cd550ee104ade425f50e508d5868b5ec6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636562855526962920&sdata=aIBTiKrAY4%2FIJqh2XraE1y9ki9y%2BeXwJDAnXLSRDOvA%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAO9sw-qe17hpCE-1FsKcvqoqt_6r0rtSks5tc9XrgaJpZM4SbqAm&data=02%7C01%7C%7Cd550ee104ade425f50e508d5868b5ec6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636562855526962920&sdata=VO5mUhCoOGg1vTdg4kmDeLBI8sdyD0XEAndmqEzwd8k%3D&reserved=0.

e-mcgee commented 6 years ago

The Paradox network protocol is not available. There are a number of projects that have been developed which I studied and tried out over the last year to get to where I am now. There was a specific post I found that was apparently the first real reverse engineering of the protocol that worked and assisted in some of the code to get working with the alarms. However, Paradox forced the removal of the post so it was lost. I have a serial protocol doc which is pretty close to the network protocol that is still floating around that I used and it helped a lot to figure things out. See attached. Paradox MG Serial prototcol.pdf

I use Netbeans IDE for the code. The easiest way I found is to log output to the console to help finding the state of things. Netbeans is good to find code syntax errors. It does allow setup your Node.js location so it should be possible to debug through it. I have not tried it but in the settings you can configure your Node.js settings. The thing is to debug you actually need to communicate with the alarm and of course homebridge and the plugin so these would have to be installed locally. I initially used code from Tertiush (https://github.com/Tertiush/ParadoxIP150v2) which is written in Python to get me going. I ported it to javascript. The original code may also help you. The homebridge framework is also not well documented so it is a bit of a hit and miss in the beginning. The best way I found was to study other plugins which helped me a lot to get things going. There is a good tutorial (http://blog.theodo.fr/2017/08/make-siri-perfect-home-companion-devices-not-supported-apple-homekit/) available now which may help you. Also of course https://github.com/nfarina/homebridge has much info and samples to use in the section under writing plugins. The basics are fairly simple, you need to create the plugin using some of the samples and then you need to create the compulsory handler functions for the specific type op accessory that you are modelling in HomeKit. Mine is bit more complex because I defined the alarm as a platform with multiple accessories. This works well as the comms to the alarm is handled by the platform and then I model various accessories on it (alarm, motion sensor, contact sensor, smoke detector and garage door opener). The platform runs the code that updates the status to the accessories. In my code the platform plus all the comms code for the alarm are mixed. I should still separate the alarm code from the platform into its own module that I then "require" into the platform plugin, but for now it is easier to have all the code in one file as I am still actively developing it.

Hope this helps to get you going.

sricard999 commented 6 years ago

Thanks for the information! I will try and figure out why it’s not detecting the state of the zones for my panel model.

Stéphane

Sent from my iPhone

On Mar 10, 2018, at 5:03 PM, e-mcgee notifications@github.com<mailto:notifications@github.com> wrote:

The Paradox network protocol is not available. There are a number of projects that have been developed which I studied and tried out over the last year to get to where I am now. There was a specific post I found that was apparently the first real reverse engineering of the protocol that worked and assisted in some of the code to get working with the alarms. However, Paradox forced the removal of the post so it was lost. I have a serial protocol doc which is pretty close to the network protocol that is still floating around that I used and it helped a lot to figure things out. See attached. Paradox MG Serial prototcol.pdfhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fe-mcgee%2Fparadox_platform%2Ffiles%2F1799832%2FParadox.MG.Serial.prototcol.pdf&data=02%7C01%7C%7Ce8b42f39a2e84874da1508d586d2bc8b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636563162016425309&sdata=3RQIS4OovmkKDGv1PWcAHwFdLU6WEdfDAKIlHniVGx4%3D&reserved=0

I use Netbeans IDE for the code. The easiest way I found is to log output to the console to help finding the state of things. Netbeans is good to find code syntax errors. It does allow setup your Node.js location so it should be possible to debug through it. I have not tried it but in the settings you can configure your Node.js settings. The thing is to debug you actually need to communicate with the alarm and of course homebridge and the plugin so these would have to be installed locally. I initially used code from Tertiush (https://github.com/Tertiush/ParadoxIP150v2https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FTertiush%2FParadoxIP150v2&data=02%7C01%7C%7Ce8b42f39a2e84874da1508d586d2bc8b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636563162016425309&sdata=PRGNeMT6KlkOsZ9m9OIzDFT%2B56AIKXEBGSOoiauTrsM%3D&reserved=0) which is written in Python to get me going. I ported it to javascript. The original code may also help you. The homebridge framework is also not well documented so it is a bit of a hit and miss in the beginning. The best way I found was to study other plugins which helped me a lot to get things going. There is a good tutorial (http://blog.theodo.fr/2017/08/make-siri-perfect-home-companion-devices-not-supported-apple-homekit/https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.theodo.fr%2F2017%2F08%2Fmake-siri-perfect-home-companion-devices-not-supported-apple-homekit%2F&data=02%7C01%7C%7Ce8b42f39a2e84874da1508d586d2bc8b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636563162016425309&sdata=daP%2FT0qh9ROJd6HjGGd5EonPo8W92R71KWrEDAEGxVk%3D&reserved=0) available now which may help you. Also of course https://github.com/nfarina/homebridgehttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnfarina%2Fhomebridge&data=02%7C01%7C%7Ce8b42f39a2e84874da1508d586d2bc8b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636563162016425309&sdata=4FqVx%2BmDpM3mY%2Frusydryw3qSkr8q%2BHZmDg2ZWdZ4V8%3D&reserved=0 has much info and samples to use in the section under writing plugins. The basics are fairly simple, you need to create the plugin using some of the samples and then you need to create the compulsory handler functions for the specific type op accessory that you are modelling in HomeKit. Mine is bit more complex because I defined the alarm as a platform with multiple accessories. This works well as the comms to the alarm is handled by the platform and then I model various accessories on it (alarm, motion sensor, contact sensor, smoke detector and garage door opener). The platform runs the code that updates the status to the accessories. In my code the platform plus all the comms code for the alarm are mixed. I should still separate the alarm code from the platform into its own module that I then "require" into the platform plugin, but for now it is easier to have all the code in one file as I am still actively developing it.

Hope this helps to get you going.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fe-mcgee%2Fparadox_platform%2Fissues%2F22%23issuecomment-372070741&data=02%7C01%7C%7Ce8b42f39a2e84874da1508d586d2bc8b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636563162016581555&sdata=5mK0NNtJ3URKRpZfRqqrfw5nJoadT6kZUw58tlE1jmk%3D&reserved=0, or mute the threadhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAO9sw8FPDpyMCv1wXA1PyxPu2U1OEqUKks5tdE2ngaJpZM4SbqAm&data=02%7C01%7C%7Ce8b42f39a2e84874da1508d586d2bc8b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636563162016581555&sdata=XTjsXsDx7MEhb1649VRn4LsMTQYwHC3aXv5R%2F6ts1%2BQ%3D&reserved=0.