Everything is working perfect! But I have a question? Is there any possibility to get the state of the sensor more frequent, because now the state of sensors stays without update for 30 minutes.
Can not comment on that. So far we had no problems with IP modules.
When PAI does something it logs it. See info messages. PAI does not do anything without a command.
Why do you need to send an update if state has not changed?
Hi yozik04, meanwhile I investigated more on this and looked at the code. The two switches I have, Lights_ON and Lights_OFF are sending a step going from LO to HI on the corresponding PGMs. What I need is a pulse LO->HI->LO. I installed devel version of the PAI and I saw that it is having some support for the pulse. However, I couldn’t figure out how to send a payload=pulse instead of payload=on? See below an excerpt from the log.
BTW, I can create the pulse by double clicking on the buttons instead of just single clicking but this is hard to do,
Happy new year!
Bogdan
I did added some more comments to appear in the log just to understand it.
2021-01-01 23:09:30,108 - INFO - PAI.paradox.interfaces.mqtt.basic - message topic=paradox/control/outputs/Lights_ON, payload=on
2021-01-01 23:09:30,109 - INFO - PAI.paradox.interfaces.mqtt.basic - Output command: Lights_ON=on user: None
2021-01-01 23:09:30,110 - INFO - PAI.paradox.interfaces.mqtt.basic - None
2021-01-01 23:09:30,111 - INFO - PAI.paradox.paradox - Control Output: Lights_ON - on
2021-01-01 23:09:30,112 - INFO - PAI.paradox.hardware.spectra_magellan.panel - BCD2
2021-01-01 23:09:46,955 - INFO - PAI.paradox.interfaces.mqtt.basic - message topic=paradox/control/outputs/Lights_OFF, payload=on
2021-01-01 23:09:46,957 - INFO - PAI.paradox.interfaces.mqtt.basic - Output command: Lights_OFF=on user: None
2021-01-01 23:09:46,958 - INFO - PAI.paradox.interfaces.mqtt.basic - None
2021-01-01 23:09:46,958 - INFO - PAI.paradox.paradox - Control Output: Lights_OFF - on
2021-01-01 23:09:46,958 - INFO - PAI.paradox.hardware.spectra_magellan.panel - BCD2
Hi,
so for now I did some changes in HA’s entities card to make the Lights_ON and Lights_OFF sending pulses. With this it works as expected. Here are the changes:
type: entities
entities:
- type: button
name: Lights_OFF
tap_action:
action: call-service
service: mqtt.publish
service_data:
topic: paradox/control/outputs/Lights_OFF
payload: pulse
- type: button
name: Lights_ON
tap_action:
action: call-service
service: mqtt.publish
service_data:
topic: paradox/control/outputs/Lights_ON
payload: pulse
title: Switch
and here is the log for turning ligths ON and then OFF:
2021-01-02 20:59:15,762 - INFO - PAI.paradox.interfaces.mqtt.basic - message topic=paradox/control/outputs/Lights_ON, payload=pulse
2021-01-02 20:59:17,527 - INFO - PAI.paradox.interfaces.mqtt.basic - message topic=paradox/control/outputs/Lights_OFF, payload=pulse
I am not sure if autodiscovery gets from panel info about pulse for PGMs. If yes it would be nice to create the correct buttons for those PGMs that use pulse so that it will require no manual intervention.
Bogdan
I’m still enjoying your integration, great work, really! I have one an annoyance, that is, few times a day all the sensors go unavailable for 10-20 seconds, and then they recover. I cannot see any pattern in that, it just happens irregularly. Do you have a clue, why this happens?
What I also noticed is that the outages actually come around 20 times during 24 hours. Mostly unavailable for 8-10 secs, rarely 20 or 25. It happens regardless of the state of the alarm, it both occurs in armed and disarmed states. After these everything returns to normal.
Have you specified IP_CONNECTION_EMAIL
and IP_CONNECTION_SITEID
? If yes remove and use local connection.
In my configuration, both are ‘null’. Is it corect?
Yes. Then I have no idea. Bad network? Dying IP150? Outdated panel fw?
During startup, I have an error message like this:
ERROR - PAI.paradox.lib.handlers - No handler for message 5
Does not influence anything.
More than that, during operation, I have recurring messages like this:
ERROR - PAI.paradox.hardware.evo.panel - ChecksumError Error in path (parsing)
Ignore. We do not know what it is. But packet is invalid.
Hi all, I tried to install PAI with MQTT and i have a hard time!
MQTT is install no problem
But PAI alway give me this error in the logs
Error parsing configuration value: Invalid value for config argument <class 'str'>. Allowed are: CONNECTION_TYPE
Attempting to load configuration from /data/options.json
Traceback (most recent call last):
File "/usr/local/bin/pai-service", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/paradox/console_scripts/pai_run.py", line 36, in main
main(args)
File "/usr/local/lib/python3.7/site-packages/paradox/main.py", line 118, in main
cfg.load()
File "/usr/local/lib/python3.7/site-packages/paradox/config.py", line 397, in load
raise (Exception(err))
Exception: Error parsing configuration value: Invalid value for config argument <class 'str'>. Allowed are: CONNECTION_TYPE
Here’s my config file for PAI
LOGGING_FILE: null
LOGGING_LEVEL_CONSOLE: 20
LOGGING_LEVEL_FILE: 40
LOGGING_DUMP_PACKETS: false
LOGGING_DUMP_MESSAGES: false
LOGGING_DUMP_STATUS: false
LOGGING_DUMP_EVENTS: false
CONNECTION_TYPE: ip
SERIAL_PORT: /dev/ttyUSB0
SERIAL_BAUD: 9600
IP_CONNECTION_HOST: 192.168.86.68
IP_CONNECTION_PORT: 10000
IP_CONNECTION_PASSWORD: paradox
IP_CONNECTION_SITEID: null
IP_CONNECTION_EMAIL: null
IP_CONNECTION_PANEL_SERIAL: null
IP_CONNECTION_BARE: false
LIMITS: {}
SYNC_TIME: true
PASSWORD: paradox
MQTT_ENABLE: true
MQTT_HOST: core-mosquitto
MQTT_PORT: 1883
MQTT_USERNAME: pai
MQTT_PASSWORD: xxxxx
MQTT_RETAIN: true
MQTT_BIND_ADDRESS: 192.168.86.100
MQTT_BIND_PORT: 0
MQTT_HOMEASSISTANT_AUTODISCOVERY_ENABLE: true
I connect thru IP150, i’m able to log direct web page, thru Babyware also.
Can someone steer me in right direction please?
CONNECTION_TYPE: Value case is wrong. IP or Serial
Thanks Yozik04, i’ve got a little farther! Now PAI try to connect to IP150, but always finish with authentification errors.
paradox.exceptions.AuthenticationFailed
Task exception was never retrieved
future: <Task finished coro=<HandlerRegistry.handle() done, defined at /usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py:101> exception=AuthenticationFailed()>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 112, in handle
await handler(data)
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 61, in __call__
result = self._handle(data)
File "/usr/local/lib/python3.7/site-packages/paradox/paradox.py", line 636, in handle_error_message
raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
2021-01-10 14:54:38,010 - ERROR - PAI.paradox.paradox - Got ERROR Message: Invalid PC Password
2021-01-10 14:54:38,011 - ERROR - PAI.paradox.lib.handlers - Exception caught during message handling
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 112, in handle
await handler(data)
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 61, in __call__
result = self._handle(data)
File "/usr/local/lib/python3.7/site-packages/paradox/paradox.py", line 636, in handle_error_message
raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
2021-01-10 14:54:38,013 - ERROR - PAI.paradox.exceptions - Unhandled exception in async loop(<_UnixSelectorEventLoop running=True closed=False debug=False>):
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 112, in handle
await handler(data)
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 61, in __call__
result = self._handle(data)
File "/usr/local/lib/python3.7/site-packages/paradox/paradox.py", line 636, in handle_error_message
raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
Task exception was never retrieved
future: <Task finished coro=<HandlerRegistry.handle() done, defined at /usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py:101> exception=AuthenticationFailed()>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 112, in handle
await handler(data)
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 61, in __call__
result = self._handle(data)
File "/usr/local/lib/python3.7/site-packages/paradox/paradox.py", line 636, in handle_error_message
raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
2021-01-10 14:54:39,014 - ERROR - PAI.paradox.paradox - Got ERROR Message: Invalid PC Password
2021-01-10 14:54:39,014 - ERROR - PAI.paradox.lib.handlers - Exception caught during message handling
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 112, in handle
await handler(data)
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 61, in __call__
result = self._handle(data)
File "/usr/local/lib/python3.7/site-packages/paradox/paradox.py", line 636, in handle_error_message
raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
2021-01-10 14:54:39,017 - ERROR - PAI.paradox.exceptions - Unhandled exception in async loop(<_UnixSelectorEventLoop running=True closed=False debug=False>):
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 112, in handle
await handler(data)
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 61, in __call__
result = self._handle(data)
File "/usr/local/lib/python3.7/site-packages/paradox/paradox.py", line 636, in handle_error_message
raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
Task exception was never retrieved
future: <Task finished coro=<HandlerRegistry.handle() done, defined at /usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py:101> exception=AuthenticationFailed()>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 112, in handle
await handler(data)
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 61, in __call__
result = self._handle(data)
File "/usr/local/lib/python3.7/site-packages/paradox/paradox.py", line 636, in handle_error_message
raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
2021-01-10 14:54:40,019 - ERROR - PAI.paradox.paradox - Got ERROR Message: Invalid PC Password
2021-01-10 14:54:40,019 - ERROR - PAI.paradox.lib.handlers - Exception caught during message handling
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 112, in handle
await handler(data)
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 61, in __call__
result = self._handle(data)
File "/usr/local/lib/python3.7/site-packages/paradox/paradox.py", line 636, in handle_error_message
raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
2021-01-10 14:54:40,022 - ERROR - PAI.paradox.exceptions - Unhandled exception in async loop(<_UnixSelectorEventLoop running=True closed=False debug=False>):
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 112, in handle
await handler(data)
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 61, in __call__
result = self._handle(data)
File "/usr/local/lib/python3.7/site-packages/paradox/paradox.py", line 636, in handle_error_message
raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
Task exception was never retrieved
future: <Task finished coro=<HandlerRegistry.handle() done, defined at /usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py:101> exception=AuthenticationFailed()>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 112, in handle
await handler(data)
File "/usr/local/lib/python3.7/site-packages/paradox/lib/handlers.py", line 61, in __call__
result = self._handle(data)
File "/usr/local/lib/python3.7/site-packages/paradox/paradox.py", line 636, in handle_error_message
raise AuthenticationFailed()
paradox.exceptions.AuthenticationFailed
2021-01-10 14:54:40,929 - ERROR - PAI.paradox.paradox - Timeout while connecting to panel. Is an other connection active?
2021-01-10 14:54:40,930 - ERROR - PAI - Unable to connect to alarm
There’S is no other active connection.
Here’s the new config:
LOGGING_FILE: null
LOGGING_LEVEL_CONSOLE: 20
LOGGING_LEVEL_FILE: 40
LOGGING_DUMP_PACKETS: false
LOGGING_DUMP_MESSAGES: false
LOGGING_DUMP_STATUS: false
LOGGING_DUMP_EVENTS: false
CONNECTION_TYPE: IP
SERIAL_PORT: /dev/ttyUSB0
SERIAL_BAUD: 9600
IP_CONNECTION_HOST: 192.168.86.68
IP_CONNECTION_PORT: 10000
IP_CONNECTION_PASSWORD: paradox
IP_CONNECTION_SITEID: null
IP_CONNECTION_EMAIL: null
IP_CONNECTION_PANEL_SERIAL: null
IP_CONNECTION_BARE: false
LIMITS: {}
SYNC_TIME: true
PASSWORD: '0000'
MQTT_ENABLE: true
MQTT_HOST: core-mosquitto
MQTT_PORT: 1883
MQTT_USERNAME: pai
MQTT_PASSWORD: xxxxxxx
MQTT_RETAIN: true
MQTT_BIND_ADDRESS: 192.168.86.100
MQTT_BIND_PORT: 0
MQTT_HOMEASSISTANT_AUTODISCOVERY_ENABLE: true
I don’t know if i have the right password at the right place, and i’m not sure about the 0000. Is this suppose to be my panel code?
“Invalid PC Password” in the log means you have entered Invalid PC Password. https://github.com/ParadoxAlarmInterface/pai/wiki/Configuration#pc-password
I think the PC password is not the Generic 0000. I also try with Swan still dont work.
I try this
CONNECTION_TYPE = 'IP' # Serial or IP
IP_CONNECTION_SITEID = '<siteid>' # SITE ID. IF defined, connection will be made through this method.
IP_CONNECTION_EMAIL = '[email protected]' # Email registered in the site
IP_CONNECTION_PANEL_SERIAL = None # Use a specific panel. Set it to None to use the first
siteid with brackets, without brackets, with the serial number, with serial number to None.
Here’S the log:
2021-01-11 00:47:51,090 - ERROR - PAI.paradox.connections.ip.connection - Unhandled exception while connecting (try 2/3)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 30, in connect
await self._try_connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 147, in _try_connect
await self.stun_session.connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/stun_session.py", line 49, in connect
module["panelSerial"]
TypeError: string indices must be integers
2021-01-11 00:47:51,091 - INFO - PAI.paradox.connections.ip.connection - Connecting. Try 3/3
2021-01-11 00:47:51,091 - INFO - PAI.paradox.connections.ip.stun_session - Connecting to Site: xxxxx
2021-01-11 00:47:51,092 - ERROR - PAI.paradox.connections.ip.connection - Unhandled exception while connecting (try 3/3)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 30, in connect
await self._try_connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 147, in _try_connect
await self.stun_session.connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/stun_session.py", line 49, in connect
module["panelSerial"]
TypeError: string indices must be integers
2021-01-11 00:47:51,093 - ERROR - PAI.paradox.paradox - Failed to connect to interface
2021-01-11 00:47:51,093 - ERROR - PAI - Unable to connect to alarm
2021-01-11 00:48:15,120 - INFO - PAI - Starting...
2021-01-11 00:48:15,121 - INFO - PAI.paradox.paradox - Disconnecting from the Alarm Panel
2021-01-11 00:48:15,121 - INFO - PAI.paradox.paradox - Clean Session
2021-01-11 00:48:15,122 - INFO - PAI.paradox.paradox - Connecting to interface
2021-01-11 00:48:15,122 - INFO - PAI.paradox.connections.ip.connection - Connecting. Try 1/3
2021-01-11 00:48:15,122 - INFO - PAI.paradox.connections.ip.stun_session - Connecting to Site: xxxxxx
2021-01-11 00:48:15,123 - ERROR - PAI.paradox.connections.ip.connection - Unhandled exception while connecting (try 1/3)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 30, in connect
await self._try_connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 147, in _try_connect
await self.stun_session.connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/stun_session.py", line 49, in connect
module["panelSerial"]
TypeError: string indices must be integers
2021-01-11 00:48:15,124 - INFO - PAI.paradox.connections.ip.connection - Connecting. Try 2/3
2021-01-11 00:48:15,124 - INFO - PAI.paradox.connections.ip.stun_session - Connecting to Site: xxxxx
2021-01-11 00:48:15,125 - ERROR - PAI.paradox.connections.ip.connection - Unhandled exception while connecting (try 2/3)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 30, in connect
await self._try_connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 147, in _try_connect
await self.stun_session.connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/stun_session.py", line 49, in connect
module["panelSerial"]
TypeError: string indices must be integers
2021-01-11 00:48:15,126 - INFO - PAI.paradox.connections.ip.connection - Connecting. Try 3/3
2021-01-11 00:48:15,126 - INFO - PAI.paradox.connections.ip.stun_session - Connecting to Site: luclaflamme
2021-01-11 00:48:15,127 - ERROR - PAI.paradox.connections.ip.connection - Unhandled exception while connecting (try 3/3)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 30, in connect
await self._try_connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 147, in _try_connect
await self.stun_session.connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/stun_session.py", line 49, in connect
module["panelSerial"]
TypeError: string indices must be integers
2021-01-11 00:48:15,129 - ERROR - PAI.paradox.paradox - Failed to connect to interface
2021-01-11 00:48:15,131 - ERROR - PAI - Unable to connect to alarm
2021-01-11 00:48:40,153 - INFO - PAI - Starting...
2021-01-11 00:48:40,153 - INFO - PAI.paradox.paradox - Disconnecting from the Alarm Panel
2021-01-11 00:48:40,154 - INFO - PAI.paradox.paradox - Clean Session
2021-01-11 00:48:40,154 - INFO - PAI.paradox.paradox - Connecting to interface
2021-01-11 00:48:40,154 - INFO - PAI.paradox.connections.ip.connection - Connecting. Try 1/3
2021-01-11 00:48:40,154 - INFO - PAI.paradox.connections.ip.stun_session - Connecting to Site: xxxxx
2021-01-11 00:48:40,155 - ERROR - PAI.paradox.connections.ip.connection - Unhandled exception while connecting (try 1/3)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 30, in connect
await self._try_connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 147, in _try_connect
await self.stun_session.connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/stun_session.py", line 49, in connect
module["panelSerial"]
TypeError: string indices must be integers
2021-01-11 00:48:40,156 - INFO - PAI.paradox.connections.ip.connection - Connecting. Try 2/3
2021-01-11 00:48:40,156 - INFO - PAI.paradox.connections.ip.stun_session - Connecting to Site: xxxxx
2021-01-11 00:48:40,156 - ERROR - PAI.paradox.connections.ip.connection - Unhandled exception while connecting (try 2/3)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 30, in connect
await self._try_connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 147, in _try_connect
await self.stun_session.connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/stun_session.py", line 49, in connect
module["panelSerial"]
TypeError: string indices must be integers
2021-01-11 00:48:40,157 - INFO - PAI.paradox.connections.ip.connection - Connecting. Try 3/3
2021-01-11 00:48:40,158 - INFO - PAI.paradox.connections.ip.stun_session - Connecting to Site: luclaflamme
2021-01-11 00:48:40,158 - ERROR - PAI.paradox.connections.ip.connection - Unhandled exception while connecting (try 3/3)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 30, in connect
await self._try_connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/connection.py", line 147, in _try_connect
await self.stun_session.connect()
File "/usr/local/lib/python3.7/site-packages/paradox/connections/ip/stun_session.py", line 49, in connect
module["panelSerial"]
TypeError: string indices must be integers
2021-01-11 00:48:40,159 - ERROR - PAI.paradox.paradox - Failed to connect to interface
2021-01-11 00:48:40,160 - ERROR - PAI - Unable to connect to alarm