Tertiush / ParadoxIP150v2

Python-based IP150 'middle-ware' that uses the IP module's software port for monitoring and control of the alarm via an MQTT Broker.
Eclipse Public License 1.0
73 stars 35 forks source link

Is there a guide on how to set this up? #36

Open jacoscar opened 5 years ago

jacoscar commented 5 years ago

Final goal: I'm trying to make my MG5050 work with homekit

I'm using Windows 10 and my computer is not on the same network as the alarm system (which is in another house)

I've downloaded this https://www.npmjs.com/package/homebridge-paradox-security-system and installed in homebridge

I've installed mosquitto (when I open it it's just a black screen, is this right?)

I've installed Python

I've downloaded https://github.com/Tertiush/ParadoxIP150 and configured the config file like this [IP150] Pincode: mypincode Password: mypassword IP: mystaticip HTTP_Port: 5000

[MQTT Broker] IP: localhost Port: 1883

[MQTT Topics] Topic_Publish_Zone_States = Paradox/ZS Payload_Publish_Zone_States_1 = OPEN Payload_Publish_Zone_States_0 = CLOSED Topic_Publish_Alarm_States = Paradox/AS Topic_Publish_Siren_Status = Paradox/SS Topic_Subscribe_Control = Paradox/C/

When I first opened IP150-MQTT.py it wouldn't connect; now I've opened the port on the router (edit: here I mean the router of the house where the alarm system is installed, not my local router) and the window closes a few seconds after I run IP150-MQTT.py, which I guess it means it's working

When I run homebridge, the only thing that I see is an accessory in HomeKit called "Default Room Alarm System" with an exclamation mark and "no response"

I'm sure I'm missing something, but what?

Tertiush commented 5 years ago

I think you have installed the wrong IP150 script, there's a V2. Your link points to V1. I have not used home bridge before so cannot comment on that package.

On Sat, Dec 1, 2018, 13:03 jacoscar notifications@github.com wrote:

Final goal: I'm trying to make my MG5050 work with homekit

I've downloaded this https://www.npmjs.com/package/homebridge-paradox-security-system and installed in homebridge

I've installed mosquitto (when I open it it's just a black screen, is this right?)

I've installed Python

I've downloaded https://github.com/Tertiush/ParadoxIP150 and configured the config file like this [IP150] Pincode: mypincode Password: mypassword IP: mystaticip HTTP_Port: 5000

[MQTT Broker] IP: localhost Port: 1883

[MQTT Topics] Topic_Publish_Zone_States = Paradox/ZS Payload_Publish_Zone_States_1 = OPEN Payload_Publish_Zone_States_0 = CLOSED Topic_Publish_Alarm_States = Paradox/AS Topic_Publish_Siren_Status = Paradox/SS Topic_Subscribe_Control = Paradox/C/

When I first opened IP150-MQTT.py it wouldn't connect; now I've opened the port on the router and the window closes a few seconds after I run IP150-MQTT.py, which I guess it means it's working

When I run homebridge, the only thing that I see is an accessory in HomeKit called "Default Room Alarm System" with an exclamation mark and "no response"

I'm sure I'm missing something, but what?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Tertiush/ParadoxIP150v2/issues/36, or mute the thread https://github.com/notifications/unsubscribe-auth/ALGOjDa94Q_v9XRNQIetiuymOzCyVazlks5u0mH0gaJpZM4Y818c .

jacoscar commented 5 years ago

I've tried V2 as well with the difference that V2's window closes after a few ms with both correct or wrong login details, so I have no feedback on whether it's actually working or not

Tertiush commented 5 years ago

I suggest you start the script from the command line, so that we can see what error it gives. That way the window will stay open.

On Sat, Dec 1, 2018, 14:09 jacoscar notifications@github.com wrote:

I've tried V2 as well with the difference that V2's window closes after a few ms with both correct or wrong login details, so I have no feedback on whether it's actually working or not

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Tertiush/ParadoxIP150v2/issues/36#issuecomment-443421764, or mute the thread https://github.com/notifications/unsubscribe-auth/ALGOjDw9lCfr9iQkIIPCKUDf8r_2n0wlks5u0nGWgaJpZM4Y818c .

jacoscar commented 5 years ago

here's the error

(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\Jacopo>cd C:\Users\Jacopo\Downloads\ParadoxIP150v2-master\ParadoxIP150v2-master

C:\Users\Jacopo\Downloads\ParadoxIP150v2-master\ParadoxIP150v2-master>IP150-MQTTv2.py logging to file /var/log/paradoxip.log reading config ERROR:root:*** Error reading config.ini file (will use defaults): [Errno 2] No such file or directory: 'C:\opt\paradoxip\paradoxip.log' Traceback (most recent call last): File "C:\Users\Jacopo\Downloads\ParadoxIP150v2-master\ParadoxIP150v2-master\IP150-MQTTv2.py", line 955, in logging.error( "MQTT connection error (" + str(attempts) + ": " + e.strerror) AttributeError: 'exceptions.AttributeError' object has no attribute 'strerror'

psyciknz commented 5 years ago

Why did you need port on router? Your paradox mosquito settings said local host, and I assume your alarm panel is local as well.

Did you have a log file set in the paradox config? And can you see connections being made in the mosquito logs? These are the things you need to figure out.


From: jacoscar notifications@github.com Sent: Sunday, December 2, 2018 02:38 To: Tertiush/ParadoxIP150v2 Cc: Subscribed Subject: Re: [Tertiush/ParadoxIP150v2] Is there a guide on how to set this up? (#36)

here's the error

(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\Jacopo>cd C:\Users\Jacopo\Downloads\ParadoxIP150v2-master\ParadoxIP150v2-master

C:\Users\Jacopo\Downloads\ParadoxIP150v2-master\ParadoxIP150v2-master>IP150-MQTTv2.py logging to file /var/log/paradoxip.log reading config ERROR:root:*** Error reading config.ini file (will use defaults): [Errno 2] No such file or directory: 'C:\opt\paradoxip\paradoxip.log' Traceback (most recent call last): File "C:\Users\Jacopo\Downloads\ParadoxIP150v2-master\ParadoxIP150v2-master\IP150-MQTTv2.py", line 955, in logging.error( "MQTT connection error (" + str(attempts) + ": " + e.strerror) AttributeError: 'exceptions.AttributeError' object has no attribute 'strerror'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Tertiush/ParadoxIP150v2/issues/36#issuecomment-443426964, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFGkcxM-DEB8iYWf0yP0zF5sCvvKngyrks5u0oY9gaJpZM4Y818c.

Tertiush commented 5 years ago

I see you are running the script in an windows environment. You will need to change the logging path to something windows understands, like c:\logs

Then some more questions:

What version IP module do you have? Above V4 is not supported. What version of Python are you running? I think 2.7 is needed.

jacoscar commented 5 years ago

Why did you need port on router? Your paradox mosquito settings said local host, and I assume your alarm panel is local as well. Did you have a log file set in the paradox config? And can you see connections being made in the mosquito logs? These are the things you need to figure out.

The alarm panel is not local; it's not even in the same country, that's why I had to set up a port forwarding on the router the panel is connected to; iParadox app on iPhone works fine How do I set/see the mosquitto logs?

I have MG5050 software 4.74.0 and IP150 software 1.32 (recently updated from 1.20 trying to avoid version 4)

I have Python 2.7.15

jacoscar commented 5 years ago

I think I managed to put a log file in the same directory, I now get

2018-12-02 10:53:47,834 INFO logging complete 2018-12-02 10:53:47,835 ERROR test 2018-12-02 10:53:47,842 ERROR *** Error reading config.ini file (will use defaults): No option 'ip_software_port' in section: 'IP150' 2018-12-02 10:53:47,848 INFO State01:Attempting connection to MQTT Broker: 10.0.0.130:1883

Tertiush commented 5 years ago

As the errors say, "error reading config.ini file". So none of your IP etc. settings are being pulled in. The 10.0.0.130 is my testing IP from back in the day.

You need to ensure the "working directory" is the same directory where the scripts and .ini file sits in. I'd suggest making a windows shortcut to launch "python c:\PathToTheScript\IP150-MQTTv2.py" and then change the working directory (windows calls this "start in") to be the same as the script and config.ini directory. I think this will sort it out.

jacoscar commented 5 years ago

As the errors say, "error reading config.ini file". So none of your IP etc. settings are being pulled in. The 10.0.0.130 is my testing IP from back in the day.

You need to ensure the "working directory" is the same directory where the scripts and .ini file sits in. I'd suggest making a windows shortcut to launch "python c:\PathToTheScript\IP150-MQTTv2.py" and then change the working directory (windows calls this "start in") to be the same as the script and config.ini directory. I think this will sort it out.

I just tried that but I keep getting the same error; it doesn't read the config.ini file

jacoscar commented 5 years ago

Ok, I was using the config.ini file from version 1 probably; I can now see my alarm zones in the python command window

jacoscar commented 5 years ago

However, after starting homebridge it says

[12/2/2018, 4:33:56 PM] [Alarm System] Getting current state [12/2/2018, 4:33:56 PM] [Alarm System] Not a valid HomeKit State: undefined

the only thing that I see in the Home app is an accessory called "Default Room Alarm System" with an exclamation mark and "no response"

psyciknz commented 5 years ago

That’s more a homebridge problem. You’ll need to tell it what the messages are from paradoxip on the Mosquitto bus things like home, away, triggered

On Mon, 3 Dec 2018 at 05:38, jacoscar notifications@github.com wrote:

However, after starting homebridge it says

[12/2/2018, 4:33:56 PM] [Alarm System] Getting current state [12/2/2018, 4:33:56 PM] [Alarm System] Not a valid HomeKit State: undefined

the only thing that I see in the Home app is an accessory called "Default Room Alarm System" with an exclamation mark and "no response"

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Tertiush/ParadoxIP150v2/issues/36#issuecomment-443521329, or mute the thread https://github.com/notifications/unsubscribe-auth/AFGkc6rAcCU-UU4Ei5T55_NavIaZAqnSks5u1AHwgaJpZM4Y818c .

jacoscar commented 5 years ago

It somehow started showing a status in the Home App after someone armed the alarm to "night" mode; the paradox system has 4 modes: Arm, Sleep, Stay, Disarm; HomeKit seems to have Home/Away/Night/Off; "Sleep" mode was showing as "Away" for some reason, while "Disarm" now shows correctly as "Off". Is this just something I need to correct in some config file?

Also, shouldn't I be able to see all my zones/doors/windows as sensors?

JeanDiv14 commented 5 years ago

I had this issue running the script in a jail on my FreeNAS box. What solved it for me was moving the directory to /opt/paradoxip.

Just incase anyone else had has these issues :-)

UbiMaiden commented 5 years ago

Hi, When I run the script (python3 IP150-MQTTv2.py) I get this message:

File"IP150-MQTTv2.py", line 146 except Exception, e:

SyntaxError: invalid syntax

Tertiush commented 5 years ago

Please read the instructions in the readme before posting questions. Python 3 is likely not compatible, you need version 2.7

UbiMaiden commented 5 years ago

Sry didn't know version 2 and 3 aren't compatible. To bad Hass.io doesn't support python v2.

Tertiush commented 5 years ago

You can install different python versions side by side. I haven't done it recently so don't recall the process, but I'm sure Google can help you out. Good luck.