ParadoxAlarmInterface / hassio-repository

HASS.IO repository
Eclipse Public License 2.0
12 stars 17 forks source link

hassio addon repository #1

Closed tonica closed 4 years ago

tonica commented 4 years ago

I tried to add this project as a hassio addon repository but shows no new addon

yozik04 commented 4 years ago

It is WIP. As I do not have Hass.io device I need some logs that would point me to a mistake.

tonica commented 4 years ago

It is WIP. As I do not have Hass.io device I need some logs that would point me to a mistake.

19-12-13 06:45:30 INFO (MainThread) [hassio.store.git] Update add-on https://github.com/ParadoxAlarmInterface/hassio-repository repository 19-12-13 06:45:32 WARNING (MainThread) [hassio.store.data] Can't read /data/addons/git/e92a3241/paradox_alarm_interface/config.json: does not match regular expression for dictionary value @ data['image']. Got 'paradoxalarminterface/pai:1.1.0'

yozik04 commented 4 years ago

Try once again.

tonica commented 4 years ago

Try once again.

great! addon installed! now the log is full of errors... but its ok because my config string is empty. Any documentation about the {} syntax?

I tried: Local connection For IP150 firmware versions: < 4.x and >= 4.40.004

{ CONNECTION_TYPE = 'IP', IP_CONNECTION_HOST = 'x.x.x.x', IP_CONNECTION_PORT = 10000, IP_CONNECTION_PASSWORD = b'paradox' } but save button is disabled

yozik04 commented 4 years ago

Great! First step done. Do you know how to configure addons that require editing text file configurations?

yozik04 commented 4 years ago

I have added "map": ["share:rw"]. Probably settings should be available somehow via network share... Not sure.

tonica commented 4 years ago

Great! First step done. Do you know how to configure addons that require editing text file configurations?

sorry but I have no experience with that. I'll check some docs and let you know if can help.

tonica commented 4 years ago

FYI without configuration the logs shows this:

2019-12-13 08:55:10,268 - INFO - PAI.paradox.paradox - Clean Session 2019-12-13 08:55:10,269 - INFO - PAI.paradox.paradox - Connecting to interface 2019-12-13 08:55:10,270 - INFO - PAI.paradox.connections.serial_connection - Connecting to serial port /dev/ttyS1 2019-12-13 08:55:10,271 - ERROR - PAI.paradox.connections.serial_connection - Serial Port Timeout 2019-12-13 08:55:10,274 - ERROR - PAI - Restarting Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/serial/serialposix.py", line 265, in open self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK) FileNotFoundError: [Errno 2] No such file or directory: '/dev/ttyS1' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/pai/paradox/main.py", line 96, in main if alarm.connect(): File "/usr/local/pai/paradox/paradox.py", line 96, in connect self.work_loop.run_until_complete(task) File "/usr/local/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete return future.result() File "/usr/local/pai/paradox/paradox.py", line 104, in connect_async if not await self.connection.connect(): File "/usr/local/pai/paradox/connections/serial_connection.py", line 137, in connect self.baud) File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 212, in coro res = func(*args, kw) File "/usr/local/lib/python3.6/site-packages/serial_asyncio/init.py", line 410, in create_serial_connection ser = serial.serial_for_url(*args, *kwargs) File "/usr/local/lib/python3.6/site-packages/serial/init.py", line 88, in serial_for_url instance.open() File "/usr/local/lib/python3.6/site-packages/serial/serialposix.py", line 268, in open raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg)) serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyS1: [Errno 2] No such file or directory: '/dev/ttyS1' 2019-12-13 08:55:40,306 - INFO - PAI - Starting... 2019-12-13 08:55:40,307 - INFO - PAI.paradox.paradox - Disconnecting from the Alarm Panel 2019-12-13 08:55:40,308 - INFO - PAI.paradox.paradox - Clean Session 2019-12-13 08:55:40,308 - INFO - PAI.paradox.paradox - Connecting to interface 2019-12-13 08:55:40,309 - INFO - PAI.paradox.connections.serial_connection - Connecting to serial port /dev/ttyS1 2019-12-13 08:55:40,311 - ERROR - PAI.paradox.connections.serial_connection - Serial Port Timeout 2019-12-13 08:55:40,313 - ERROR - PAI - Restarting Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/serial/serialposix.py", line 265, in open self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK) FileNotFoundError: [Errno 2] No such file or directory: '/dev/ttyS1' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/pai/paradox/main.py", line 96, in main if alarm.connect(): File "/usr/local/pai/paradox/paradox.py", line 96, in connect self.work_loop.run_until_complete(task) File "/usr/local/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete return future.result() File "/usr/local/pai/paradox/paradox.py", line 104, in connect_async if not await self.connection.connect(): File "/usr/local/pai/paradox/connections/serial_connection.py", line 137, in connect self.baud) File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 212, in coro res = func(args, kw) File "/usr/local/lib/python3.6/site-packages/serial_asyncio/init.py", line 410, in create_serial_connection ser = serial.serial_for_url(*args, kwargs) File "/usr/local/lib/python3.6/site-packages/serial/init.py", line 88, in serial_for_url instance.open() File "/usr/local/lib/python3.6/site-packages/serial/serialposix.py", line 268, in open raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg)) serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyS1: [Errno 2] No such file or directory: '/dev/ttyS1' 2019-12-13 08:56:10,346 - INFO - PAI - Starting... 2019-12-13 08:56:10,347 - INFO - PAI.paradox.paradox - Disconnecting from the Alarm Panel 2019-12-13 08:56:10,347 - INFO - PAI.paradox.paradox - Clean Session 2019-12-13 08:56:10,348 - INFO - PAI.paradox.paradox - Connecting to interface 2019-12-13 08:56:10,349 - INFO - PAI.paradox.connections.serial_connection - Connecting to serial port /dev/ttyS1 2019-12-13 08:56:10,350 - ERROR - PAI.paradox.connections.serial_connection - Serial Port Timeout 2019-12-13 08:56:10,352 - ERROR - PAI - Restarting Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/serial/serialposix.py", line 265, in open self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK) FileNotFoundError: [Errno 2] No such file or directory: '/dev/ttyS1' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/pai/paradox/main.py", line 96, in main if alarm.connect(): File "/usr/local/pai/paradox/paradox.py", line 96, in connect self.work_loop.run_until_complete(task) File "/usr/local/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete return future.result() File "/usr/local/pai/paradox/paradox.py", line 104, in connect_async if not await self.connection.connect(): File "/usr/local/pai/paradox/connections/serial_connection.py", line 137, in connect self.baud) File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 212, in coro res = func(*args, *kw) File "/usr/local/lib/python3.6/site-packages/serial_asyncio/init.py", line 410, in create_serial_connection ser = serial.serial_for_url(args, kwargs) File "/usr/local/lib/python3.6/site-packages/serial/init.py", line 88, in serial_for_url instance.open() File "/usr/local/lib/python3.6/site-packages/serial/serialposix.py", line 268, in open raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg)) serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyS1: [Errno 2] No such file or directory: '/dev/ttyS1'

yozik04 commented 4 years ago

Because CONNECTION_TYPE is Serial by default. You need to configure anyway.

danygi79 commented 4 years ago

i have configured in hass.io docker container but configurazion file not found. i try to place pai.conf in this folder:

in all folder file not work

in this configuration what is the correct folder where I would put the file?

lsta commented 4 years ago

I'm trying to figure out how to edit the config file too from a HASS install (clicking install after adding this repository)

Obviously it needs configuration and the configuration is a non-homeassistant standard.

So far I've figured out that hass.io runs this as a container, and I can docker cp the /etc/pai/pai.conf into/out of the container, but then the changes are lost when I click restart, as HA simply destroys the container and starts another.

anyone know where the config can be edited from in this case?

edit: I've had a good look around for the config file within several containers and as well as on the host file system, and I cannot find it.

I can see how this might be easier if I wasn't running HASS.IO appliance, as it doesn't seem to be standard docker configuration.

If anyone has this working with home assistant, please share how you got it to work!

yozik04 commented 4 years ago

Please readd the repo. It should be now configurable via options.

yozik04 commented 4 years ago

All supported configuration parameters are here: https://github.com/ParadoxAlarmInterface/pai/blob/master/config/pai.conf.example

Use https://github.com/ParadoxAlarmInterface/pai/wiki to get more info.

lsta commented 4 years ago

@yozik04 thank you for working on this! It's definitely closer but not working for me yet;

I can see that when I import the new repo to homeassistant (hassio vm appliance), the configuration parameters are now editable and I can save it and start the service like any other addon.

However no matter what I do the logs indicate a serial connection is being used, the configuration parameters that I enter in, do not seem to apply.

example: here's my config entered through the Hassio interface:

{ "LOGGING_FILE": null,= "LOGGING_LEVEL_CONSOLE": 10, "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/ttyS1", "SERIAL_BAUD": 9600, "IP_CONNECTION_HOST": "192.168.220.235", "IP_CONNECTION_PORT": 10000, "IP_CONNECTION_PASSWORD": "mypasswordgoeshere", "IP_CONNECTION_SITEID": null, "IP_CONNECTION_EMAIL": null, "IP_CONNECTION_PANEL_SERIAL": null, "IP_CONNECTION_BARE": false, "LIMITS": {}, "STATUS_REQUESTS": [ 0, 1, 2, 3, 4, 5 ], "SYNC_TIME": true, "PASSWORD": "0000", "MQTT_ENABLE": "true", "MQTT_HOST": "127.0.0.1", "MQTT_PORT": 1883, "MQTT_USERNAME": "alarm", "MQTT_PASSWORD": "alarm", "MQTT_RETAIN": true, "MQTT_BIND_ADDRESS": "127.0.0.1", "MQTT_BIND_PORT": 0, "MQTT_HOMEASSISTANT_AUTODISCOVERY_ENABLE": "true" }

yet here's the logs:

2019-12-26 22:21:11,937 - INFO - PAI - Config loaded from /etc/pai/pai.conf 2019-12-26 22:21:11,937 - INFO - PAI - Starting Paradox Alarm Interface 2019-12-26 22:21:11,937 - INFO - PAI - Console Log level set to 20 2019-12-26 22:21:12,939 - INFO - PAI - Starting... 2019-12-26 22:21:12,939 - INFO - PAI.paradox.paradox - Disconnecting from the Alarm Panel 2019-12-26 22:21:12,939 - INFO - PAI.paradox.paradox - Clean Session 2019-12-26 22:21:12,939 - INFO - PAI.paradox.paradox - Using Serial Connection 2019-12-26 22:21:12,939 - INFO - PAI.paradox.paradox - Connecting to interface 2019-12-26 22:21:12,939 - INFO - PAI.paradox.connections.serial_connection - Connecting to serial port /dev/ttyS1 2019-12-26 22:21:12,940 - ERROR - PAI - Restarting Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/serial/serialposix.py", line 265, in open self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK) FileNotFoundError: [Errno 2] No such file or directory: '/dev/ttyS1' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/paradox/main.py", line 98, in main if alarm.connect(): File "/usr/local/lib/python3.7/site-packages/paradox/paradox.py", line 97, in connect self.work_loop.run_until_complete(task) File "/usr/local/lib/python3.7/asyncio/base_events.py", line 583, in run_until_complete return future.result() File "/usr/local/lib/python3.7/site-packages/paradox/paradox.py", line 105, in connect_async if not await self.connection.connect(): File "/usr/local/lib/python3.7/site-packages/paradox/connections/serial_connection.py", line 53, in connect self.baud) File "/usr/local/lib/python3.7/asyncio/coroutines.py", line 120, in coro res = func(*args, *kw) File "/usr/local/lib/python3.7/site-packages/serial_asyncio/init.py", line 410, in create_serial_connection ser = serial.serial_for_url(args, **kwargs) File "/usr/local/lib/python3.7/site-packages/serial/init.py", line 88, in serial_for_url instance.open() File "/usr/local/lib/python3.7/site-packages/serial/serialposix.py", line 268, in open raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg)) serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyS1: [Errno 2] No such file or directory: '/dev/ttyS1'

so i had a look at the container; it doesn't look like the config is coming through for some reason. I assume /etc/pai/pai.conf is the right place.

image

yozik04 commented 4 years ago

/etc/pai/pai.conf is a wrong place. /data/options.json is the right place... And I need to figure out why config file path is not taken from the env variable I pass to the container.

yozik04 commented 4 years ago

I've did another attempt to fix. Please try one more time.

yozik04 commented 4 years ago

People in gitter report that it is working now. Please confirm.

lsta commented 4 years ago

confirm, yes working now thanks! (now just need to figure out how to use it from a HA perspective)

danygi79 commented 4 years ago

work now, but PGM not puglished in MQTT and non usable, if this were also inserted it would be perfect.

yozik04 commented 4 years ago

work now, but PGM not puglished in MQTT and non usable, if this were also inserted it would be perfect.

What panel?

danygi79 commented 4 years ago

work now, but PGM not puglished in MQTT and non usable, if this were also inserted it would be perfect.

I explained myself wrongly, the PGM are visible as states but it is not possible to send commands and therefore they are unusable. At present it is only possible to see its status, it would be correct to be able to activate and deactivate it via mttq.

I have tested in HASS.IO via MQTT broker and I'm viewing the state through MQTT Explorer

yozik04 commented 4 years ago

Please create separate issue. It is possible to control via mqtt.