Git Product home page Git Product logo

paradoxalarminterface / pai Goto Github PK

View Code? Open in Web Editor NEW
327.0 40.0 87.0 1.81 MB

Paradox Magellan, Spectra and EVO, with MQTT, Signal, Pushbullet, Pushover and others

Home Page: https://gitter.im/paradox-alarm-interface

License: Eclipse Public License 2.0

Python 99.84% Dockerfile 0.15% Shell 0.01%
security home-security paradox mqtt paradox-alarm python surveillance pushbullet signal homekit

pai's People

Contributors

benoit3 avatar carcinogoy avatar cybertza avatar dependabot[bot] avatar jakezp avatar jpbarraca avatar makstech avatar mradugin avatar radokristof avatar tekand avatar tochev avatar tomplus avatar trefex avatar yozik04 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pai's Issues

Not working on SP6000 with IP150

Hello,

I can't make it work with a SP6000. Login process is ok. But aftwer that it disconnects with ERROR Message: 0

Panel SP6000 version 4.148 build 0
IP Module. Version 20, Firmware: 1.50, Serial: 710235a5

Result: Got ERROR Message: 0
Log:

-- REDACTED --

2018-12-20 17:20:49,500 - INFO - PAI.paradox.hardware.spectra_magellan.panel - Initializing communication
2018-12-20 17:20:49,502 - DEBUG - PAI.paradox.paradox - PC -> A b'REDACTED'
2018-12-20 17:20:49,503 - DEBUG - PAI.paradox.connections.ip_connection - PC -> IP b'REDACTED'
2018-12-20 17:20:49,593 - DEBUG - PAI.paradox.connections.ip_connection - IP -> PC b'aa2500027300000000eeeeeeeeeeeeee802f8c0a3f55820c41738536a5bba9d0617d82726760687796db653a954bf535e480eb61c3b6793a5bd59a91f4dbaa58'
2018-12-20 17:20:49,596 - DEBUG - PAI.paradox.paradox - PC <- A b'70001200000000000000000000000000000000000000000000000000000000000000000082'
2018-12-20 17:20:49,596 - DEBUG - PAI.paradox.paradox - Container:
fields = Container:
data = b'p\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'... (truncated, total 36)
value = Container:
po = Container:
command = 112
not_used0 = 0
validation_byte = 18
not_used1 = None
message = (enum) (unknown) 0
source_id = (enum) NonValid_Source 0
user_high = 0
user_low = 0
offset1 = 0
offset2 = 36
length = 36
checksum = b'\x82' (total 1)
2018-12-20 17:20:49,596 - WARNING - PAI.paradox.paradox - Got ERROR Message: 0
2018-12-20 17:20:49,597 - ERROR - PAI - Unable to connect to alarm
2018-12-20 17:20:50,309 - INFO - PAI - Exit start
2018-12-20 17:20:50,309 - DEBUG - PAI.paradox.interfaces.interface_manager - Stopping all interfaces
2018-12-20 17:20:50,310 - DEBUG - PAI.paradox.interfaces.interface_manager - mqtt
2018-12-20 17:20:50,310 - INFO - PAI.paradox.interfaces.mqtt_interface - MQTT Broker Disconnected
2018-12-20 17:20:51,312 - DEBUG - PAI.paradox.interfaces.mqtt_interface - Stopping MQTT Interface
2018-12-20 17:20:51,312 - DEBUG - PAI.paradox.interfaces.interface_manager - All Interfaces stopped
2018-12-20 17:20:51,312 - INFO - PAI - Good bye!

Async message parsing

Currently we have situation that sometimes a message response comes out of an order and we fail to map it to a request as that request already failed. I periodically see this when loading labels and some events kick in.

I propose having a different model of request parsing.

When we issue a request that waits for a response we register it's handler in a queue. Then when a response comes we iterate through all handlers in a queue to find matching request handler. Request handler can tell if passed response was intended for it.

This handler queue can have permanent Event handler in it so all events are processed separately.

All this will allow us to start using async await in our code.

MQTT error

Hi there,

I'm having an issue whereby I get an exception in the MQTT thread saying that "Publish topic cannot contain wildcards". My environment is as follows:

IP150 running 4.40 (supports direct IP connect)
EVO192
Python 3.5.3

PAI connects to the EVO, enumerates all values (Zones, Partitions etc.), connects to my MQTT server and then throws the following error:

INFO:PAI.paradox.paradox:Connection OK
Exception in thread mqtt:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/home/pi/pai/paradox/interfaces/mqtt_interface.py", line 70, in run
self.handle_change(item[2])
File "/home/pi/pai/paradox/interfaces/mqtt_interface.py", line 296, in handle_change
"{}".format(publish_value), 0, cfg.MQTT_RETAIN)
File "/home/pi/pai/paradox/interfaces/mqtt_interface.py", line 361, in publish
self.mqtt.publish(topic, value, qos, retain)
File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 1134, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.

At this point, my MQTT servers shows that the client disconnects.

I have tried the DEV branch and the same seems to take place.

Thanks for all the hard work! Been desperate to finally get my Paradox into HA.

Justin

EVO192: construct.core.ChecksumError: wrong checksum, read b'00', computed b'95'

got another issue, after running few hours ChecksumError appeared. There seems to be quiet period before it and then suddenly ChecksumError, then again 27 minutes quiet and again. Could it be related to some timeouts, reconnections or similar?

2018-12-14 13:56:19,723 - DEBUG    - PAI.paradox.paradox - Change partition/Maja/ready from False to True
2018-12-14 13:56:19,723 - DEBUG    - PAI.paradox.paradox - Change partition/Maja/all_zone_closed from False to True
2018-12-14 13:56:19,724 - DEBUG    - PAI.paradox.paradox - Change partition/Maja/stay_instant_ready from False to True
2018-12-14 14:23:30,421 - ERROR    - PAI.paradox.hardware.evo.panel - Parsing message: 47  80  00  00  05  00  00  00  00  00  00  00  00  00  00  00  00  00
 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  0
0  00  00  00  00  00  00  00  00  00  00  00  1e  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
Traceback (most recent call last):
  File "/home/aivar/git/pai/paradox/hardware/evo/panel.py", line 85, in parse_message
    return PerformActionResponse.parse(message)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 304, in parse
    return self.parse_stream(io.BytesIO(data), **contextkw)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 316, in parse_stream
    return self._parsereport(stream, context, "(parsing)")
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 328, in _parsereport
    obj = self._parse(stream, context, path)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 1979, in _parse
    subobj = sc._parsereport(stream, context, path)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 328, in _parsereport
    obj = self._parse(stream, context, path)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 2468, in _parse
    return self.subcon._parsereport(stream, context, path)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 328, in _parsereport
    obj = self._parse(stream, context, path)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 5161, in _parse
    hash2 if not isinstance(hash2,bytestringtype) else binascii.hexlify(hash2), ))
construct.core.ChecksumError: wrong checksum, read b'00', computed b'cc'
2018-12-14 14:23:30,422 - DEBUG    - PAI.paradox.paradox - Unknown message: 47  80  00  00  05  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
00  00  00  00  00  00  00  00  00  1e  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
2018-12-14 14:51:41,881 - ERROR    - PAI.paradox.hardware.evo.panel - Parsing message: 47  80  00  00  04  00  00  00  00  00  01  00  00  00  00  00  01  00
 00  00  00  00  dd  07  fa  06  dd  07  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  0
0  00  00  00  00  00  00  00  00  00  00  00  e7  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
Traceback (most recent call last):
  File "/home/aivar/git/pai/paradox/hardware/evo/panel.py", line 85, in parse_message
    return PerformActionResponse.parse(message)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 304, in parse
    return self.parse_stream(io.BytesIO(data), **contextkw)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 316, in parse_stream
    return self._parsereport(stream, context, "(parsing)")
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 328, in _parsereport
    obj = self._parse(stream, context, path)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 1979, in _parse
    subobj = sc._parsereport(stream, context, path)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 328, in _parsereport
    obj = self._parse(stream, context, path)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 2468, in _parse
    return self.subcon._parsereport(stream, context, path)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 328, in _parsereport
    obj = self._parse(stream, context, path)
  File "/home/aivar/.local/lib/python3.6/site-packages/construct/core.py", line 5161, in _parse
    hash2 if not isinstance(hash2,bytestringtype) else binascii.hexlify(hash2), ))
construct.core.ChecksumError: wrong checksum, read b'00', computed b'95'
2018-12-14 14:51:41,882 - DEBUG    - PAI.paradox.paradox - Unknown message: 47  80  00  00  04  00  00  00  00  00  01  00  00  00  00  00  01  00  00  00  00  00  dd  07  fa  06  dd  07  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  e7  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00

in user.py there are set limits, if that matters:

LIMITS = { # By default all zones will be monitored
    'zone': range(1, 100),     # Zones to monitor and control
    'user': [1, 2, 3],     # Users to consider
    # 'door': range(1, 32),     # Doors to consider
    # 'output': range(1, 17),   # Outputs to monitor and control
    'partition': [1, 2, 3],      # Partitions to monitor and control
    'bus-module': range(1, 17),      # Buses to monitor
    # 'repeater': range(1, 9),  # Repeaters to monitor
    # 'keypad': range(1, 9)     # Keypads to monitor
}

Connection to MG5000

Hello @jpbarraca good evening,

I do not know if I am writing in the correct place because I am very new to all of this and I intend to use your interface with my MG5000 alarm system. Could you provide me detailled info please on how to set everything up to test the connection based on a Windows system. Which cable did you use. Sorry to ask all of this but I am really new to this and really would like to test your work and use it to control and verify the state of my alarm system in my home automation system openHAB.

Thanks in advance for all your help.

Best regards.

GSM modem issues?

Trying to hook up sim800l via serial interface. I can send commands via screen successfully and it seems that gsm interfaces also connects ok, but when receiving message it crashes:

2018-12-15 14:07:32,024 - ERROR    - PAI.paradox.interfaces.gsm_interface - modem failed
Traceback (most recent call last):
  File "/home/gytis/.local/lib/python3.5/site-packages/serial/serialposix.py", line 501, in read
    'device reports readiness to read but returned no data '
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gytis/pai/paradox/interfaces/gsm_interface.py", line 111, in run
    data = self.port.read(200)
  File "/home/gytis/.local/lib/python3.5/site-packages/serial/serialposix.py", line 509, in read
    raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
2018-12-15 14:07:33,032 - INFO     - PAI.paradox.interfaces.gsm_interface - Using /dev/ttyS2 at 115200 baud
2018-12-15 14:07:33,035 - INFO     - PAI.paradox.interfaces.gsm_interface - Started GSM Interface
2018-12-15 14:07:33,105 - ERROR    - PAI.paradox.interfaces.gsm_interface - modem failed
Traceback (most recent call last):
  File "/home/gytis/.local/lib/python3.5/site-packages/serial/serialposix.py", line 501, in read
    'device reports readiness to read but returned no data '
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gytis/pai/paradox/interfaces/gsm_interface.py", line 111, in run
    data = self.port.read(200)
  File "/home/gytis/.local/lib/python3.5/site-packages/serial/serialposix.py", line 509, in read
    raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
2018-12-15 14:07:34,110 - INFO     - PAI.paradox.interfaces.gsm_interface - Using /dev/ttyS2 at 115200 baud
2018-12-15 14:07:34,112 - INFO     - PAI.paradox.interfaces.gsm_interface - Started GSM Interface
2018-12-15 14:07:35,067 - INFO     - PAI.paradox.interfaces.gsm_interface - data from serial b'\xc0,\x1f1\\\xb4Dc\xa9\xbc\xb9\xf5\xf8\x11\x00\n\x01\x80hT\xd5*QOL\x96"*111#"}-\x9dUy\x82\xe6\xc4:Y\xf1\xdf\xd1\xff\x1en\xfd/\xb9\xfd\xac\xe8\xd4\xb55\xfb\xdd\x1a\xce\x1a\xb6\xe8\x82\xf6\x84\xe0\x82w8\xd7\x05\xda\x1eqx\xb1\xfd7\xab\xff\\\x8e\xfc4\xe9\xec\x1d\xf0e\xfeQ\x8d\x95\xe7\x9d\xe4\xf99\xcf\xbf\xc1U\xd0\xff\x18kpgz\'.\xf3\x8d\xdf<\x03\xba\xda\xc5>\x9f\xd3\xf7\xfd:l\xca\x11$\xc5\xf9\xac\xf8\xa3\xbdR\xd4\xf0\xde[\xcd\xdd\xa9\x8e\xfcP\xc1a\x97=\xcc\xc1\xd0\xd7#-\xf0g\xea\x9bEyD0)\xe3\xf7\tj\xae\xad\x9f\xe2\xad\x1d\xc8\xb5\xb4\xa5\xfe=^:\xb2\xf2\xf6\xb1\xc3P\xca\x85\xbb\xd5\xf3(\n:'

I've uncommented https://github.com/jpbarraca/pai/blob/master/paradox/interfaces/gsm_interface.py#L132 to see the actual exception (modem failed)

EVO HD connection error

Hi,

I would like to use my Paradox EVO HD under home assistant connecting via IP150 ( v 1.40.00).
It connects to the IP module successfully and Found Panel EVOHD version 6.144 build 8, but it can not connect the Panel. The panel has the default '0000' password and in the config file I use
PASSWORD = b'0000' # PC Password. Set to None if Panel has no Password
Below is the log. Can you please help?
Thanks

2019-02-11 18:17:29,611 - INFO - PAI - Starting Paradox Alarm Interface
2019-02-11 18:17:29,611 - INFO - PAI - Console Log level set to 20
2019-02-11 18:17:29,611 - INFO - PAI.paradox.interfaces.interface_manager - Using MQTT Interface
2019-02-11 18:17:29,803 - INFO - PAI.paradox.interfaces.mqtt_interface - MQTT Broker Connected
2019-02-11 18:17:30,792 - INFO - PAI - Using IP Connection
2019-02-11 18:17:31,243 - INFO - PAI - Starting...
2019-02-11 18:17:31,244 - INFO - PAI.paradox.paradox - Connecting to interface
2019-02-11 18:17:31,263 - INFO - PAI.paradox.connections.ip_connection - Authentication Success. Panel version 20, firmware: 1.64
2019-02-11 18:17:31,306 - INFO - PAI.paradox.connections.ip_connection - Session Established with IP Module
INFO:PAI.paradox.connections.ip_connection:Session Established with IP Module
2019-02-11 18:17:31,307 - INFO - PAI.paradox.paradox - Connecting to panel
INFO:PAI.paradox.paradox:Connecting to panel
2019-02-11 18:17:31,307 - INFO - PAI.paradox.paradox - Initiating communication
INFO:PAI.paradox.paradox:Initiating communication
2019-02-11 18:17:31,356 - INFO - PAI.paradox.paradox - Found Panel EVOHD version 6.144 build 8
INFO:PAI.paradox.paradox:Found Panel EVOHD version 6.144 build 8
2019-02-11 18:17:31,357 - INFO - PAI.paradox.paradox - Starting communication
INFO:PAI.paradox.paradox:Starting communication
2019-02-11 18:17:31,478 - INFO - PAI.paradox.hardware.spectra_magellan.panel - Initializing communication
INFO:PAI.paradox.hardware.spectra_magellan.panel:Initializing communication
2019-02-11 18:17:31,528 - ERROR - PAI.paradox.hardware.spectra_magellan.panel - Authentication Failed. Wrong Password?
ERROR:PAI.paradox.hardware.spectra_magellan.panel:Authentication Failed. Wrong Password?
2019-02-11 18:17:31,529 - ERROR - PAI - Unable to connect to alarm

MQTT or IP Interface Issue - Not sure

Hi

I did start writing in the HomeAssistant issue section to reply to your last message but thought I should start a new section instead.

To summarise I am not sure the cause of my issue. Initially I thought I was not calling the topics correctly in my .yaml script and thus not publishing into HomeAssistant properly but now im thinking its more to do with the IP module interface and thus its not even getting to the stage of publishing in HA.

I am connecting through the IP150 module v1.39. I am only using IP Connection details in my user.py (Not the IP Socket Interface). When I run the script the MQTT interface seems to establish ok, I get a fully established connection to the IP Module and then it connects to the Panel ok. Then all the panel information, zones, areas populate on the pi terminal followed by the the last message I receive on my pi through MQTT being:

2019-02-07 20:50:43,268 - INFO - PAI.paradox.paradox - Connection OK

Then I do not see any further comms or status updates in MQTT on the pi regardless of whether I activate a physical zone or alarm. I tried reducing the Keep_Alive_interval but no luck.

When I got no where with this I did try to also enable the 'IP Socket Interface' but received some parsing error messages and also on two occasions I saw the attached (Below) come up when I activated a zone.

Just not sure where my error is occurring and whether I need to enable the IP Socket Interface or is there another setting I have missed with the IP Module config. Also I am not sure how to increase my debug level.

Any help greatly appreciated as I think your Paradox Solution has a lot more to offer my Home Assistant setup than others I have used/seen.

Thanks

paradox snip

Feature: connect to IP150 using Panel ID + PC password

Currently it's not possible to connect to IP150 v4.10+ modules (I have a v4.30). They are connectable via recent BabayWare on port 10000 using the Panel ID and PC password of the panel, so I think it could be possible to connect using the same method. I haven't found a way to do so using current code.

Properties in status messages are not correctly updated.

System
All models

Describe the bug
Properties in status messages are not correctly updated.

To Reproduce
Run the script
Wait for events and status updates
Status updates do not impose property changes due to missing type and id.

IP client connection problem

Hello,

I have enabled ip client. But when i was trying to connect with BabyWare i`ve got error.
Basically in paradox.py it calls pause procedure which closes serial connection and exception is thrown that object is null:

File "/home/robiss/pai/paradox/interfaces/ip_interface.py", line 173, in process_client_message
   payload = self.alarm.send_wait_simple(message=message_payload[:37])
 File "/home/robiss/pai/paradox/paradox.py", line 212, in send_wait_simple
   data = self.connection.read()
 File "/home/robiss/pai/paradox/connections/serial_connection.py", line 59, in read
   recv_data = self.comm.read(read_sz)

I have commented connection clossing in paradoxy.py at pause function and now it works! I'm not sure why you was closing serial connection at pause function. Also i'm not good at python :)

Can i get some help

I have got to a point where I am getting this error :

2018-04-30 18:30:33,697 - INFO - PAI - Starting Paradox Alarm Interface
2018-04-30 18:30:33,700 - INFO - PAI - Console Log level set to 20
2018-04-30 18:30:33,703 - INFO - PAI - Using MQTT Interface
2018-04-30 18:30:34,354 - INFO - PAI.mqtt_interface - MQTT Broker Connected
2018-04-30 18:30:35,304 - INFO - PAI - Using Serial Connection
2018-04-30 18:30:35,315 - INFO - PAI - Starting...
2018-04-30 18:30:35,322 - INFO - PAI.paradox - Connecting to panel
2018-04-30 18:30:35,650 - INFO - PAI.paradox - Connected!
2018-04-30 18:30:35,652 - INFO - PAI.paradox - Updating Labels from Panel
2018-04-30 18:30:35,759 - ERROR - PAI.paradox - Connect error
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/construct/lib/containers.py", line 100, in getattr
return self[name]
KeyError: 'data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/pai/paradox.py", line 73, in connect
self.update_labels()
File "/home/pi/pai/paradox.py", line 183, in update_labels
template=partition_template)
File "/home/pi/pai/paradox.py", line 247, in load_labels
payload = reply.fields.value.data
File "/usr/local/lib/python3.5/dist-packages/construct/lib/containers.py", line 102, in getattr
raise AttributeError(name)
AttributeError: data
2018-04-30 18:30:35,781 - ERROR - PAI - Unable to connect to alarm
2018-04-30 18:30:35,787 - INFO - PAI.mqtt_interface - MQTT Broker Disconnected
2018-04-30 18:30:36,803 - INFO - PAI - Good bye!

MQTT reconnects

Broker connects and disconnects every couple seconds and resubscribes. Something is wrong here.

INFO:PAI.paradox.interfaces.mqtt_interface:MQTT Broker Connected
2018-11-17 20:41:09,492 - DEBUG    - PAI.paradox.interfaces.mqtt_interface - Subscribing to topics in paradox/control
DEBUG:PAI.paradox.interfaces.mqtt_interface:Subscribing to topics in paradox/control
2018-11-17 20:41:11,506 - INFO     - PAI.paradox.interfaces.mqtt_interface - MQTT Broker Disconnected
INFO:PAI.paradox.interfaces.mqtt_interface:MQTT Broker Disconnected
2018-11-17 20:41:13,520 - INFO     - PAI.paradox.interfaces.mqtt_interface - MQTT Broker Connected
INFO:PAI.paradox.interfaces.mqtt_interface:MQTT Broker Connected
2018-11-17 20:41:13,521 - DEBUG    - PAI.paradox.interfaces.mqtt_interface - Subscribing to topics in paradox/control
DEBUG:PAI.paradox.interfaces.mqtt_interface:Subscribing to topics in paradox/control
2018-11-17 20:41:15,539 - INFO     - PAI.paradox.interfaces.mqtt_interface - MQTT Broker Disconnected
INFO:PAI.paradox.interfaces.mqtt_interface:MQTT Broker Disconnected

[feature] EVO192: PGM control and statuses

System
IP150, Panel version 20, firmware: 1.38
Paradox Panel EVO192 version 3.0 build 40.
Raspberry Pi with Domoticz.
Node-RED.
Mosquitto.

Describe the bug
Statuses for Partitions are completely missing. I can only see statuses for Zones, Doors, and System.

To Reproduce
Steps to reproduce the behavior:
Run: mosquitto_sub -h localhost -v -t "paradox/#"
This will list all available Status except Partition (and perhaps others less important).

Logs
nzqmeister EVO192 Partition Status Problem.txt

Status updates stops comming to mqtt after some time

System
SP7000
TM70
serial connection to RPI3 where openhab2 and its embeded MQTT server is running
python 3.6
pai running as a service.

Describe the bug
For some reason pai stops posting updates to mqtt after some time -hard to say, maybe 20min to few hours. At least after a night its always stopped. Command topic is still read by pai- i can arm,etc. There in nothing in the log (INFO level).
Also i`m not sure if its supposed to work for my setup, but based on code i guess it should - i do not get ac,dc,vdc updates at any time, event then everything else if working.

To Reproduce
Just run pai for longer time period and status updates to MQTT stops.

Logs
I will try to collect them in DEBUG, since at INFO level there is nothing to catch on.

EVO 192 Got message 0 but expected 1

System
My alarm system is a Paradox EVO192 and I am trying to connect with the IP150 module (Version 1.34). I have installed the PAI binding on a Rasbian Pi running Linux/Arm and Openhab2 on the same local Lan as the alarm.

Describe the bug
I have installed the software as explained and edited the defaults.py file with whatever made sense. I activated the MQTT service connection as well. It appears as if some connection is established. Authentication is successful. The panel version and firmware is read with some communication. I then get the following error message: ERROR:root:Got message 0 but expected 1 After that I get Initialization failed and unable to connect messages.

To Reproduce
Steps to reproduce the behavior:

  1. Edit defaults.py
  2. Run: python3 run.py
  3. See error message

Logs
PLEASE DO NOT SEND LOGS IN CLEAR TEXT AS THEY MAY CONTAIN SENSITIVE INFORMATION
If you wish to add a log (which will greatly help us), please follow the following instructions:

  1. Go to https://keybase.io/encrypt
  2. Write 'jpbarraca' as the recipient
  3. Write your log or add a link to the log file (if using services such as dropbox).
  4. Click Encrypt
  5. Save the result to a text file and add it as an attachment.
    Paradox 2019-02-18.txt

Connecting to SP5500 via serial?

Serial used:

 3115.085884] usb 3-1: new full-speed USB device number 7 using ohci-platform
[ 3115.356874] usb 3-1: New USB device found, idVendor=067b, idProduct=2303
[ 3115.356886] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3115.356892] usb 3-1: Product: USB-Serial Controller
[ 3115.356898] usb 3-1: Manufacturer: Prolific Technology Inc.
[ 3115.359234] pl2303 3-1:1.0: pl2303 converter detected
[ 3115.381351] usb 3-1: pl2303 converter now attached to ttyUSB0

When connecting I get this error:

2018-12-11 20:10:46,901 - INFO     - PAI - Starting Paradox Alarm Interface
2018-12-11 20:10:46,903 - INFO     - PAI - Console Log level set to 10
2018-12-11 20:10:47,906 - INFO     - PAI - Using Serial Connection
2018-12-11 20:10:47,936 - INFO     - PAI - Starting...
2018-12-11 20:10:47,938 - INFO     - PAI.paradox.paradox - Connecting to interface
2018-12-11 20:10:47,939 - DEBUG    - PAI.paradox.connections.serial_connection - Opening Serial port: /dev/ttyUSB0
2018-12-11 20:10:47,957 - DEBUG    - PAI.paradox.connections.serial_connection - Serial port open!
2018-12-11 20:10:47,958 - INFO     - PAI.paradox.paradox - Connecting to panel
2018-12-11 20:10:47,960 - INFO     - PAI.paradox.paradox - Initiating communication
2018-12-11 20:10:47,968 - DEBUG    - PAI.paradox.paradox - PC -> A b'72000000000000000000000000000000000000000000000000000000000000000000000072'
2018-12-11 20:10:48,011 - DEBUG    - PAI.paradox.paradox - PC <- A b'72000000000000000000000000000000000000000000000000000000000000000000000072'
2018-12-11 20:10:48,014 - DEBUG    - PAI.paradox.paradox - Container:
    fields = Container:
        length = 36
        value = Container:
            po = Container:
                command = 7
                reserved0 = 2
            reserved1 = None
        data = b'r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'... (truncated, total 36)
        offset2 = 36
        offset1 = 0
    checksum = b'r' (total 1)
2018-12-11 20:10:48,019 - ERROR    - PAI.paradox.paradox - Connect error
Traceback (most recent call last):
  File "/home/gytis/.local/lib/python3.5/site-packages/construct/lib/containers.py", line 100, in __getattr__
    return self[name]
KeyError: 'label'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gytis/pai/paradox/paradox.py", line 78, in connect
    (reply.fields.value.label.strip(b'\0 ').decode('utf-8')),
  File "/home/gytis/.local/lib/python3.5/site-packages/construct/lib/containers.py", line 102, in __getattr__
    raise AttributeError(name)
AttributeError: label
2018-12-11 20:10:48,026 - ERROR    - PAI - Unable to connect to alarm

Tried to change the 78th line to:

                logger.info("DEBUG FOUND PANEL {}".format(reply.fields.value))
                #logger.info("Found Panel {} version {}.{} build {}".format(
                #    (reply.fields.value.label.strip(b'\0 ').decode('utf-8')),
                #    reply.fields.value.application.version,
                #     reply.fields.value.application.revision,
                #     reply.fields.value.application.build))

But then it fails with this:

2018-12-11 20:20:22,122 - INFO     - PAI - Starting Paradox Alarm Interface
2018-12-11 20:20:22,123 - INFO     - PAI - Console Log level set to 10
2018-12-11 20:20:23,126 - INFO     - PAI - Using Serial Connection
2018-12-11 20:20:23,156 - INFO     - PAI - Starting...
2018-12-11 20:20:23,157 - INFO     - PAI.paradox.paradox - Connecting to interface
2018-12-11 20:20:23,158 - DEBUG    - PAI.paradox.connections.serial_connection - Opening Serial port: /dev/ttyUSB0
2018-12-11 20:20:23,176 - DEBUG    - PAI.paradox.connections.serial_connection - Serial port open!
2018-12-11 20:20:23,177 - INFO     - PAI.paradox.paradox - Connecting to panel
2018-12-11 20:20:23,179 - INFO     - PAI.paradox.paradox - Initiating communication
2018-12-11 20:20:23,187 - DEBUG    - PAI.paradox.paradox - PC -> A b'72000000000000000000000000000000000000000000000000000000000000000000000072'
2018-12-11 20:20:23,229 - DEBUG    - PAI.paradox.paradox - PC <- A b'72000000000000000000000000000000000000000000000000000000000000000000000072'
2018-12-11 20:20:23,232 - DEBUG    - PAI.paradox.paradox - Container:
    fields = Container:
        data = b'r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'... (truncated, total 36)
        offset1 = 0
        offset2 = 36
        length = 36
        value = Container:
            po = Container:
                command = 7
                reserved0 = 2
            reserved1 = None
    checksum = b'r' (total 1)
2018-12-11 20:20:23,237 - INFO     - PAI.paradox.paradox - DEBUG FOUND PANEL Container:
    po = Container:
        command = 7
        reserved0 = 2
    reserved1 = None
2018-12-11 20:20:23,238 - INFO     - PAI.paradox.paradox - Starting communication
2018-12-11 20:20:23,245 - DEBUG    - PAI.paradox.paradox - PC -> A b'5f200000000000000000000000000000000000000000000000000000000000000002000081'
2018-12-11 20:20:23,287 - DEBUG    - PAI.paradox.paradox - PC <- A b'5f200000000000000000000000000000000000000000000000000000000000000002000081'
2018-12-11 20:20:23,291 - DEBUG    - PAI.paradox.paradox - Container:
    fields = Container:
        data = b'_ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'... (truncated, total 36)
        offset1 = 0
        offset2 = 36
        length = 36
        value = Container:
            po = Container:
                command = 95
            validation = 32
            not_used0 = None
            source_id = (enum) Winload_IP 2
            user_id = Container:
                high = 0
                low = 0
    checksum = b'\x81' (total 1)
ERROR:root:Got message 95 but expected 0
ERROR:root:Detail:
Container:
    fields = Container:
        data = b'_ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'... (truncated, total 36)
        offset1 = 0
        offset2 = 36
        length = 36
        value = Container:
            po = Container:
                command = 95
            validation = 32
            not_used0 = None
            source_id = (enum) Winload_IP 2
            user_id = Container:
                high = 0
                low = 0
    checksum = b'\x81' (total 1)
2018-12-11 20:20:23,298 - DEBUG    - PAI.paradox.paradox - PC -> A b'5f200000000000000000000000000000000000000000000000000000000000000002000081'
DEBUG:PAI.paradox.paradox:PC -> A b'5f200000000000000000000000000000000000000000000000000000000000000002000081'
2018-12-11 20:20:23,341 - DEBUG    - PAI.paradox.paradox - PC <- A b'5f200000000000000000000000000000000000000000000000000000000000000002000081'
DEBUG:PAI.paradox.paradox:PC <- A b'5f200000000000000000000000000000000000000000000000000000000000000002000081'
2018-12-11 20:20:23,345 - DEBUG    - PAI.paradox.paradox - Container:
    fields = Container:
        data = b'_ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'... (truncated, total 36)
        offset1 = 0
        offset2 = 36
        length = 36
        value = Container:
            po = Container:
                command = 95
            validation = 32
            not_used0 = None
            source_id = (enum) Winload_IP 2
            user_id = Container:
                high = 0
                low = 0
    checksum = b'\x81' (total 1)
DEBUG:PAI.paradox.paradox:Container:
    fields = Container:
        data = b'_ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'... (truncated, total 36)
        offset1 = 0
        offset2 = 36
        length = 36
        value = Container:
            po = Container:
                command = 95
            validation = 32
            not_used0 = None
            source_id = (enum) Winload_IP 2
            user_id = Container:
                high = 0
                low = 0
    checksum = b'\x81' (total 1)
ERROR:root:Got message 95 but expected 0

Any ideas? Previously i had code written on arduino and readonly events were consumed successfully

MQTT Disconnect when sending invalid partition command

MQTT broker disconnects after sending a partition command

2019-02-28 18:40:02,153 - INFO     - PAI.paradox.interfaces.mqtt_interface - message topic=paradox/control/partitions/PARTITION, payload=NIGHT_ARM
2019-02-28 18:40:02,155 - DEBUG    - PAI.paradox.interfaces.mqtt_interface - Partition command: PARTITION = arm_sleep
2019-02-28 18:40:02,156 - DEBUG    - PAI.paradox.paradox - Control Partition: PARTITION - arm_sleep
2019-02-28 18:40:26,277 - DEBUG    - PAI.paradox.paradox - Requesting status: 3
2019-02-28 18:40:56,320 - WARNING  - PAI.paradox.interfaces.mqtt_interface - Partition command refused: PARTITION=arm_sleep
2019-02-28 18:40:56,323 - INFO     - PAI.paradox.interfaces.mqtt_interface - message topic=paradox/control/partitions/PARTITION, payload=NIGHT_ARM
2019-02-28 18:40:56,324 - DEBUG    - PAI.paradox.interfaces.mqtt_interface - Partition command: PARTITION = arm_sleep
2019-02-28 18:40:56,325 - DEBUG    - PAI.paradox.paradox - Control Partition: PARTITION - arm_sleep
2019-02-28 18:41:31,370 - DEBUG    - PAI.paradox.paradox - Requesting status: 4
2019-02-28 18:41:56,405 - WARNING  - PAI.paradox.interfaces.mqtt_interface - Partition command refused: PARTITION=arm_sleep
2019-02-28 18:41:56,408 - INFO     - PAI.paradox.interfaces.mqtt_interface - MQTT Broker Disconnected
2019-02-28 18:41:58,429 - INFO     - PAI.paradox.interfaces.mqtt_interface - MQTT Broker Connected
2019-02-28 18:41:58,430 - DEBUG    - PAI.paradox.interfaces.mqtt_interface - Subscribing to topics in paradox/control
2019-02-28 18:42:09,451 - INFO     - PAI.paradox.interfaces.mqtt_interface - message topic=paradox/control/partitions/PARTITION, payload=STAY_ARM
2019-02-28 18:42:09,452 - DEBUG    - PAI.paradox.interfaces.mqtt_interface - Partition command: PARTITION = arm_stay
2019-02-28 18:42:09,453 - DEBUG    - PAI.paradox.paradox - Control Partition: PARTITION - arm_stay
2019-02-28 18:42:26,449 - DEBUG    - PAI.paradox.paradox - Requesting status: 5
2019-02-28 18:43:21,529 - WARNING  - PAI.paradox.interfaces.mqtt_interface - Partition command refused: PARTITION=arm_stay
2019-02-28 18:43:21,532 - INFO     - PAI.paradox.interfaces.mqtt_interface - message topic=paradox/control/partitions/PARTITION, payload=DISARM
2019-02-28 18:43:21,533 - DEBUG    - PAI.paradox.interfaces.mqtt_interface - Partition command: PARTITION = disarm
2019-02-28 18:43:21,534 - DEBUG    - PAI.paradox.paradox - Control Partition: PARTITION - disarm
2019-02-28 18:43:31,552 - DEBUG    - PAI.paradox.paradox - Requesting status: 0
2019-02-28 18:44:21,627 - WARNING  - PAI.paradox.interfaces.mqtt_interface - Partition command refused: PARTITION=disarm
2019-02-28 18:44:21,629 - INFO     - PAI.paradox.interfaces.mqtt_interface - MQTT Broker Disconnected
2019-02-28 18:44:23,651 - INFO     - PAI.paradox.interfaces.mqtt_interface - MQTT Broker Connected
2019-02-28 18:44:23,652 - DEBUG    - PAI.paradox.interfaces.mqtt_interface - Subscribing to topics in paradox/control
2019-02-28 18:44:26,641 - DEBUG    - PAI.paradox.paradox - Requesting status: 1
2019-02-28 18:44:56,687 - DEBUG    - PAI.paradox.paradox - Requesting status: 2

Feature: Add Support for MQTT Dash

Add support for MQTT Dash with an automatic dashboard of the panel. This is trivial for 2 partitions (MG/SP). EVO with more partitions may require a different approach

mqtt_dash

IP150 with firmware version < 4 connection stability

Connection stability to IP150 module is pretty bad.
IP module closes socket if interface is idle. I see winload constantly requests something, so the connection does not time out. I can't find any keep alive requests.
I have added some reconnection logic. But after long run and many disconnects IP module connects but panel does not respond anymore.

WinLoad out (disconnected) is sent after 4 seconds of inactivity.
Socket is still connected and receives events.
Socket times out after 60 seconds of inactivity.

SP6000 panel, IP Causes Loss of date and time

System
Describe your panel model, access mode (Serial, IP150, etc..) and hardware.
SP6000 panel IP150 v 1.39

Describe the bug
Took a bit of getting the config right...I'm unsure the difference between IP_CONNECTION and IP_INTERFACE

With a 1.39 FW module which should I use.

Anyway, with my module password (text) in the IP_CONNECTION_PASSWORD and a PASSWORD of the PC Panel Password (it's a 4 digit pin) - that value "PASSWORD" isn't listed in the default.py I notice. I managed to get a connection and start seeing motion events.

But after doing that I receive an email from the panel about a loss

From your Paradox internet module
Site: SiteID
Message: Loss of time and date restored
Time: 14 Feb 2019 18:48

And the time seems to have reset itself to GMT given it's 15 Feb 2019 07:48 at time of writing.

I also think I'm getting an mqtt error....but I'll get the connection issue first.

To Reproduce
Steps to reproduce the behavior:

  1. Start script '...'

Logs
PLEASE DO NOT SEND LOGS IN CLEAR TEXT AS THEY MAY CONTAIN SENSITIVE INFORMATION
If you wish to add a log (which will greatly help us), please follow the following instructions:

  1. Go to https://keybase.io/encrypt
  2. Write 'jpbarraca' as the recipient
  3. Write your log or add a link to the log file (if using services such as dropbox).
  4. Click Encrypt
  5. Save the result to a text file and add it as an attachment.

Update paradox/states/partitions/Area_1/current topic on service start

Is it possible to update the paradox/states/partitions/Area_1/current topic on system start?

Currently, everything is working, but home-assistant will be in a 'Unknown' state until I manually change the state (arm / disarm) the system at least once using the remote or keypad. Once I've changed the state the paradox/states/partitions/Area_1/current topic is updated and and the MQTT Alarm Panel in home-assistant functions as normal.

Connection to MG5000

Hello @jpbarraca good evening,

I do not know if I am writing in the correct place because I am very new to all of this and I intend to use your interface with my MG5000 alarm system. Could you provide me detailled info please on how to set everything up to test the connection based on a Windows system. Which cable did you use. Sorry to ask all of this but I am really new to this and really would like to test your work and use it to control and verify the state of my alarm system in my home automation system openHAB.

Thanks in advance for all your help.

Best regards.

Locked state after alarm is triggered & disarmed from the TM70 panel

Hi Guys,

So i normally arm from my phone, if the alarm is triggered on a partition it does not parse the ALARM_TRIGGERED to MQTT broker and after i DISARM from the TM70 touch keyboard the partition remains in a locked state.

It will show in homekit as being in the last state it was put in AWAY/NIGHT/STAY, no matter what command i give nothing gets passed to MQTT.

If i manually publish DISARM to the current state of the partition everything starts working again.

feature: support command aliases?

What do you think about command aliases support? E.g. now you must send long commands like partition main arm or partition main disarm. What if config file could contain aliases like

COMMAND_ALIASES = {
 "arm" :"paritition main arm",
 "disarm" :"paritition main disarm",
<....>
}

what do you think? I would make a PR for this, if this is acceptable

connect serial to IP150

Hi,
I have a IP150 and I would like to still use it together with your interface.
I connected my RPI to the serial output of the IP150 (so not on the panel). I get 37 bytes events from a console attached to the uart.
But using your library, it cannot connect. (No reply from the InitiateCommunication message). Seems that I can only get messages, but not sending them.
Do you have some experience with using this connection?
Note that using the regular socket on the panel, the library is working
Thanks

HomeAssistant states

I've made a very quick edit to add HomeAssistant MQTT Alarm Control Panel compatible states - https://www.home-assistant.io/components/alarm_control_panel.mqtt/

I've tested it and it seems to be working for me, but you will possibly have a better way of doing it. Perhaps include a check to ensure MQTT_HOMEBRIDGE_ENABLE & MQTT_HOMEASSIST_ENABLE is not set to True simultaneously and ensure it doesn't break anything else?

If you want to include it?

I know you're invesitgating a plugin, but this works.

Attached - homeassistant-changes.txt

Error when using arming in stay mode

When I arm the system in stay mode, I get the following error in the console:

Currently I am still testing and familiarizing myself with everything. So it might very possibly be something I am doing wrong. It seem to still work, as the alarm is armed in stay mode.

I would publish either arm_stay or STAY_ARM (depending if I have MQTT_HOMEBRIDGE_ENABLE as True or False).

topic=paradox/control/partitions/Area_1, payload=arm_stay
topic=paradox/control/partitions/Area_1, payload=STAY_ARM

topic=paradox/control/partitions/all, payload=arm_stay
topic=paradox/control/partitions/all, payload=STAY_ARM

I experience the same when using the existing remote for the alarm.

Details:
Panel MG5050 version 5.33 build 2
IP150 Module (downgraded to <4 firmware)

Current user.conf:

LOGGING_LEVEL_CONSOLE = logging.DEBUG
CONNECTION_TYPE = 'IP'
IP_CONNECTION_HOST = '1.1.1.1'
IP_CONNECTION_PASSWORD = b'my_password'
MQTT_ENABLE = True
MQTT_HOST = '1.1.1.2'
MQTT_USERNAME = None
MQTT_PASSWORD = None
PASSWORD = None
MQTT_HOMEBRIDGE_ENABLE = True (or False)

Test, disam the system, wait a few seconds and arm it again. Below is the console output with DEBUG switched on.

Console output:
REDACTED

Bug: Authentication in SP panels

Not clear how the password is transformed from the value provided by the user to the value sent to the panel.

Affects SP panels

MQTT Interface topic not updating to "Offline' state

System
Paradox MG5050 v4.133
IP150 firmware 1.39
Using Dev branch

Describe the bug
The state/value in the 'paradox/interface/MQTTInterface' topic does not change to 'offline' when you disconnect/stop the pai script. I also tested this by entering in the wrong user/pass MQTT credentials in the pai.conf thus causing the script to not connect MQTT on startup. In each case the state is always "Online". The topic does seem to update the "Online" state though without issue.

To Reproduce
Steps to reproduce the behavior (2 methods):
METHOD 1:

  1. Start script
  2. Control C to disconnect/stop the script
  3. View the 'paradox/interface/MQTTInterface' topic value in MQTT client

METHOD 2:

  1. Modify MQTT username or password credentials in pai.conf so that they are incorrect
  2. Start script
  3. View the 'paradox/interface/MQTTInterface' topic value in MQTT client

Home Assistant states (again)...

Reference: HomeAssistant states #19 (#19)

I cannot seem to reopen #19 so creating a new issue with my update / suggestion / request.

Apologies for being inactive for so long. I've been busy renovating and things are a mess and most things are unplugged at the moment. I've connected everything again and updated home assistant and pai to see if all is working now.

Seems with the new HA lovelace interface, the alarm panel has states available to be used:
arm_home
arm_away
arm_night
arm_custom_bypass

In addition to this, there is still the option to use the previous way to configure the alarm.

I was wondering if it might not be worthwhile make the home assistant COMMANDS and STATES configurable in user.py? Then it can set to a default value in defaults.py, but configurable in user.py? This will allow future HA changes to be updated in the config file instead of requiring the code to be changed again.

self.loop_wait = True

could you please explain what is the reason of this self.loop_wait = True in the loop of checking statuses...?
cause with the value set to true, i get check about every 10th second and miss lots of events that where triggered...if i disable this waiting, i receive every event...

Partition names...

Panel MG5050 version 5.33 build 2

Why did the partition names update from Area_1 / Area_2 to Output_07_______Output_08, Output_08_______Output_09

Log output:

2018-11-30 22:18:19,178 - INFO - PAI.paradox.hardware.panel - Partition: Output_07_______Output_08, Output_08_______Output_09

Is this change permanent? Or is it something I need to configure on my panel / alarm?

Homebridge mqttthing securitySystem

Hi!

How should I configure my homebridge plugin when MQTT_HOMEBRIDGE_ENABLE=True?

I tried

 {
    "accessory": "mqttthing",
    "type": "securitySystem",
    "name": "Alarm",
    "url": "<url>",
    "username": "<user>",
    "password": "<password>",
    "topics": {
        "setTargetState": "paradox/control/partitions/Area_1/target",
        "getTargetState": "paradox/control/partitions/Area_1/current",
        "getCurrentState": "paradox/control/partitions/Area_1/current"
    },
    "targetStateValues": [
        "STAY_ARM",
        "AWAY_ARM",
        "NIGHT_ARM",
        "DISARM"
    ],
    "currentStateValues": [
        "STAY_ARM",
        "AWAY_ARM",
        "NIGHT_ARM",
        "DISARM",
        "Triggered"
    ]
}

But it seems like it doesn't work well when I manually enable/disable the alarm system.

Any clues? Maybe we should add an example in the wiki?

AssertionError in EVO192 loop: assert vars.address in RAMDataParserMap

When tried latest master code (first time) with my EVO192 got AssertionError after entering loop:

2018-12-13 16:32:21,925 - INFO - PAI.paradox.paradox - Connection OK
2018-12-13 16:32:21,926 - DEBUG - PAI.paradox.paradox - Loop start
2018-12-13 16:32:21,959 - ERROR - PAI.paradox.paradox - Loop
Traceback (most recent call last):
File "/home/aivar/git/pai/paradox/paradox.py", line 146, in loop
self.panel.handle_status(reply)
File "/home/aivar/git/pai/paradox/hardware/evo/panel.py", line 147, in handle_status
assert vars.address in RAMDataParserMap
AssertionError
2018-12-13 16:32:32,032 - ERROR - PAI.paradox.paradox - Loop
Traceback (most recent call last):
File "/home/aivar/git/pai/paradox/paradox.py", line 146, in loop
self.panel.handle_status(reply)
File "/home/aivar/git/pai/paradox/hardware/evo/panel.py", line 147, in handle_status
assert vars.address in RAMDataParserMap
AssertionError

IP connection seems to establish well:

2018-12-13 16:32:07,155 - DEBUG - PAI.paradox.connections.ip_connection - Connecting to IP Panel
2018-12-13 16:32:07,155 - DEBUG - PAI.paradox.connections.ip_connection - IP Connection established
2018-12-13 16:32:07,160 - INFO - PAI.paradox.connections.ip_connection - Connected to IP Module. Version 20, Firmware: 1.38, Serial: 7101c1c9

and:

2018-12-13 16:32:07,171 - INFO - PAI.paradox.connections.ip_connection - Connection fully established
2018-12-13 16:32:07,171 - INFO - PAI.paradox.paradox - Connecting to panel
2018-12-13 16:32:07,171 - INFO - PAI.paradox.paradox - Initiating communication
2018-12-13 16:32:07,197 - INFO - PAI.paradox.paradox - Found Panel EVO192 version 2.144 build 25
2018-12-13 16:32:07,197 - INFO - PAI.paradox.paradox - Starting communication
2018-12-13 16:32:07,233 - INFO - PAI.paradox.hardware.evo.panel - Initializing communication
2018-12-13 16:32:07,255 - INFO - PAI.paradox.hardware.evo.panel - Authentication Success

Zones, Partitions, Users seem to read also correctly.

Edit:
in user.py I have set

SYNC_TIME = False
MQTT_ENABLE = True

Feature: IP150 emulation

Provide an IP interface so that the panel can be managed remotely using Winload/Babywire

Need dump of communication between babywire/winload and IP150 panel

WinError 10056 error on recv(1024)

this is my log:

2019-02-20 22:08:28,478 - INFO - PAI - Starting Paradox Alarm Interface
2019-02-20 22:08:28,479 - INFO - PAI - Console Log level set to 10
2019-02-20 22:08:29,480 - INFO - PAI - Using IP Connection
2019-02-20 22:08:29,646 - INFO - PAI - Starting...
2019-02-20 22:08:29,647 - INFO - PAI.paradox.paradox - Connecting to interface
2019-02-20 22:08:29,654 - DEBUG - PAI.paradox.connections.ip_connection - Authenticating with IP Module
2019-02-20 22:08:29,655 - DEBUG - PAI.paradox.connections.ip_connection - PC -> IP b'aa04000309f0000001eeeeeeeeeeeeee'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2019-02-20 22:08:34,909 - ERROR - PAI.paradox.connections.ip_connection - Unable to establish session with IP Module
Traceback (most recent call last):
File "C:\paradox150\pai-master\pai-master\paradox\connections\ip_connection.py", line 138, in connect_to_panel
data = self.socket.recv(1024)
socket.timeout: timed out
2019-02-20 22:08:34,913 - ERROR - PAI.paradox.connections.ip_connection - Try 2/3. Unable to connect to IP Module
Traceback (most recent call last):
File "C:\paradox150\pai-master\pai-master\paradox\connections\ip_connection.py", line 60, in connect
self.socket.connect((self.host, self.port))
OSError: [WinError 10056] A connect request was made on an already connected socket
2019-02-20 22:08:34,918 - ERROR - PAI.paradox.connections.ip_connection - Try 3/3. Unable to connect to IP Module
Traceback (most recent call last):
File "C:\paradox150\pai-master\pai-master\paradox\connections\ip_connection.py", line 60, in connect
self.socket.connect((self.host, self.port))
OSError: [WinError 10056] A connect request was made on an already connected socket

it seems that after it sends the first packet after connecting to the module and tries to read stream from the socket, it receives the exception, cause there is nothing to read..i tries to put some delay in between send and recv but did not help.

Unpacking login response apparently not working for me.

2018-12-10 03:52:34,051 - INFO - PAI.paradox.connections.ip_connection - response : Container:
login_status = (enum) (unknown) 31
key = b'\xc8x|SYm\x91\r\xc2H+\xf7\xbc\xd2\x14' (total 16)
hardware_version = 30545
ip_firmware_major = 205
ip_firmware_minor = 99
ip_module_serial = b'0\x15i\xda' (total 4)

2018-12-10 03:52:33,502 - INFO - PAI.paradox.connections.ip_connection - Connected to Site: OmeDoxSec
2018-12-10 03:52:33,502 - DEBUG - PAI.paradox.connections.ip_connection - Connecting to IP Panel
2018-12-10 03:52:33,503 - DEBUG - PAI.paradox.connections.ip_connection - IP Connection established
2018-12-10 03:52:33,504 - DEBUG - PAI.paradox.connections.ip_connection - PC -> IP b'aa04000309f0000001eeeeeeeeeeeeeef21915305f644ae6b3b649f755930ba7'
2018-12-10 03:52:34,042 - DEBUG - PAI.paradox.connections.ip_connection - IP -> PC b'aa1b000129f0000000eeeeeeeeee8415400351487e01fc6914d317e1291c7df24ce980b5667632b120fdadc9cd43e030'
2018-12-10 03:52:34,044 - INFO - PAI.paradox.connections.ip_connection - #DM message dump : Container:
header = Container:
sof = 170
length = 27
unknown0 = 1
flags = 41
command = 240
sub_command = 0
unknown1 = 0
encrypt = 0
payload = b'@\x03QH~\x01\xfci\x14\xd3\x17\xe1)\x1c}\xf2'... (truncated, total 32)
2018-12-10 03:52:34,050 - INFO - PAI.paradox.connections.ip_connection - decrypt :
2018-12-10 03:52:34,050 - INFO - PAI.paradox.connections.ip_connection - #DM message dump : b'\x1f\xc8x|SYm\x91\r\xc2H+\xf7\xbc\xd2\x14wQ\xcdc0\x15i\xda\xa1\x12'
2018-12-10 03:52:34,051 - INFO - PAI.paradox.connections.ip_connection - response : Container:
login_status = (enum) (unknown) 31
key = b'\xc8x|SYm\x91\r\xc2H+\xf7\xbc\xd2\x14' (total 16)
hardware_version = 30545
ip_firmware_major = 205
ip_firmware_minor = 99
ip_module_serial = b'0\x15i\xda' (total 4)
2018-12-10 03:52:34,051 - ERROR - PAI.paradox.connections.ip_connection - Error connecting to IP Module: 31
2018-12-10 03:52:34,051 - ERROR - PAI.paradox.paradox - Failed to connect to interface
2018-12-10 03:52:34,051 - ERROR - PAI - Unable to connect to alarm
2018-12-10 03:52:35,052 - INFO - PAI - Starting...
20

EVO192 support

I am working on EVO192 support.
It has different LiveEvent message:

  struct ParadoxPacket { //37 byte
       byte armstatus;       //00
       byte requested_event_nr; //01 0xFF: Event just occurred (serial port only)
       uint16_t event_nr;    //02-03
       byte century;         //04
       byte year;            //05
       byte month;           //06
       byte day;             //07
       byte hour;            //08
       byte minute;          //09
       byte event_group;     //10
       byte partition;       //11
       byte event_1;         //12
       byte event_2;         //13
       char serial_nr[4];    //14-17
       LabelType label_type; //18
       char label[16];       //19-34
       byte not_used;        //35
       byte checksum;        //36
  };

Example Zone Open event:
b'\xe0\xffeb\x14\x12\n\x12\x132\x01\x01\x05\x00\x00\x00\x00\x00\x02Living room     \x00\x1c'

@jpbarraca I need some help make code flow to branch into SP/Magellan and EVO.
I will populate EVO part and test with my system.

Event retention in MQTT

I think this kind of events should not be retained. Otherwise there will be too much junk retained in MQTT.
paradox/events {"major": [37, "Trouble restore"], "minor": [6, "Clock loss restore"], "type": "Trouble"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.