Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can i get some help #1

Closed
maragelis opened this issue Apr 30, 2018 · 17 comments
Closed

Can i get some help #1

maragelis opened this issue Apr 30, 2018 · 17 comments

Comments

@maragelis
Copy link

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!

@maragelis maragelis changed the title Can i get some help p Can i get some help Apr 30, 2018
@maragelis
Copy link
Author

your other project ParadoxMulti-MQTT works just fine

@jpbarraca
Copy link
Collaborator

What Panel do you have? Can you enable full debug, including packet dumps?

@maragelis
Copy link
Author

I am using a sp4000 I havent gotten around to debugging whats going on. will get back soon

@jpbarraca
Copy link
Collaborator

If you wish, provide a log here or by email.

@maragelis
Copy link
Author

maragelis commented May 14, 2018

I think i see your problem, SP panels need to be authenticated through serial communication.
I dont see a 911 register (PC password) been passed to the panel when message 0x00 is passed back after initial 0x5f message. If this password is changed on the panel from the default 0000 your script will fail to control the panel. You will only receive live events.

@maragelis
Copy link
Author

Message 0x00
As you can see byte 10 and 11 is what i was talking about.. This is taken from the coms manual.
(I have used this in my project and it works fine)

Command 0x00 : Initialize communication
PC request

Byte Value Description
00 0x00 Command
01-03 0x00 N/U
04 0xXX Panel Product ID 0x15 = SP5500 0x16 = SP6000 0x17 = SP7000 0x40 = MG5000 0x41 = MG5050
05 0xXX Panel Firmware Version (Cmd 0x5F answer).
06 0xXX Panel Firmware Revision (Cmd 0x5F answer).
07 0xXX Panel Firmware Build (Cmd 0x5F answer).
08 0xXX Programmed Panel ID Digit 1 & 2  (Cmd 0x5F answer – N/U by NEware)
09 0xXX Programmed Panel ID Digit 3 & 4  (Cmd 0x5F answer – N/U by NEware)
10 0xXX Programmed PC Password Digit 1 & 2 (N/U by NEware)
11 0xXX Programmed PC Password Digit 3 & 4 (N/U by NEware)
12 0x00 N/U
13 0xXX Source mode (old method) 0x00 = Winload connection. 0x55 = NEware connection.
14 0xXX User Code digit 1&2 (N/U by Winload)
15 0xXX User Code digit 3&4 (N/U by Winload)
16 0xXX User Code digit 5&6 (N/U by Winload)
17-32 0x00 N/U
33 0xXX Source ID (See table 1)
34 0xXX User ID high byte
35 0xXX User ID low byte
36 0xXX Checksum Note 1

@jpbarraca
Copy link
Collaborator

Great find. The ops manual is available somewhere?

@maragelis
Copy link
Author

SPXXXX-Serial-Port-Protocol.docx
https://www.dropbox.com/sh/dztab03vwdmw8ya/AABNac4VglpRPQMMHVh5myCea?dl=0

@maragelis
Copy link
Author

maragelis commented May 14, 2018

I dont know what will happen if you pass the connection as NEware and use
14 | 0xXX | User Code digit 1&2 (N/U by Winload)
15 | 0xXX | User Code digit 3&4 (N/U by Winload)
16 | 0xXX | User Code digit 5&6 (N/U by Winload)

I think this would be better as an everyday user would know his user code, but may not now the pc password (911 register password)

@maragelis
Copy link
Author

I will try changing SerialInitialization byte(33) of message 0x5f to 0x05 NEware direct, and get back to you.

@BMBIT-oss
Copy link

Hi Maragelis,
Your project is very helpful.
Is there any way you can help me in inverting the process.
Instead of receiving the codes and sending them over mgtt to actually replicate them.
Basically to send a mqtt command from a a device and replicate the 37 bytes sent normally by Paradox Sp.
I have built my own Alarm Panel in OPENHAB and my only way to report is thru SMS but now I need to report to a security Company and they only work with Paradox 37 Bytes Protocol.

@maragelis
Copy link
Author

@SilviuMarchidanu what exactly do you mean by inverting. If you mean sending your own event using the paradox protocol thats easy, just use the above document. Where can I help you exactly.

@jpbarraca
Copy link
Collaborator

Have you managed to connect?

@jpbarraca
Copy link
Collaborator

@maragelis I have a new branch with many other states being reported and with authentication.

@maragelis
Copy link
Author

Will try and get back to you.

@jpbarraca
Copy link
Collaborator

In one case, a password of 0000 required sending 0xaaaa. No idea why, but I still not analysed the issue properly.

@jpbarraca
Copy link
Collaborator

I have created a new issue to deal with the authentication

yozik04 added a commit that referenced this issue Nov 26, 2019
yozik04 pushed a commit that referenced this issue Jun 18, 2024
Home Assistant auto-discovery - set "code required" flags to false - Fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants