Mickaelh51 / rsi-alarm-gateway

RSI Videofied tcp / mqtt gateway
MIT License
9 stars 4 forks source link

how to mount and configure the container #13

Open disgran opened 11 months ago

disgran commented 11 months ago

No matter how much I think about it, I can't mount and modify the config.json. Could you give more specific instructions?

Francisk0 commented 10 months ago

You need mount the local file in this docker location: /usr/src/app/config.json

disgran commented 4 months ago

Hello, I can now connect to the server, but it gives me the following error in the log, why could it be?

[2024-06-06 10:48:24,936] - mqtt - INFO - Trying MQTT connection to xxx.xxx.xxx.xxx:1883 [2024-06-06 10:48:24,937] - mqtt - INFO - Connection with User and Password [2024-06-06 10:48:24,942] - mqtt - INFO - Connected to MQTT broker [2024-06-06 10:48:24,942] - mqtt - INFO - Send configuration to MQTT broker for alarm_arm [2024-06-06 10:48:24,943] - mqtt - INFO - Send default state (ON) to MQTT broker for alarm_arm [2024-06-06 10:48:24,943] - mqtt - INFO - Send configuration to MQTT broker for alarm_arm_source [2024-06-06 10:48:24,943] - mqtt - INFO - Send default state (nobody) to MQTT broker for alarm_arm_source [2024-06-06 10:48:24,943] - mqtt - INFO - Send configuration to MQTT broker for alarm_power [2024-06-06 10:48:24,944] - mqtt - INFO - Send default state (ON) to MQTT broker for alarm_power [2024-06-06 10:48:24,944] - mqtt - INFO - Send configuration to MQTT broker for alarm_autoprotection [2024-06-06 10:48:24,944] - mqtt - INFO - Send default state (OFF) to MQTT broker for alarm_autoprotection [2024-06-06 10:48:24,944] - mqtt - INFO - Send configuration to MQTT broker for alarm_autoprotection_source [2024-06-06 10:48:24,944] - mqtt - INFO - Send default state (nothing) to MQTT broker for alarm_autoprotection_source [2024-06-06 10:48:24,945] - mqtt - INFO - Send configuration to MQTT broker for alarm_alert [2024-06-06 10:48:24,945] - mqtt - INFO - Send default state (OFF) to MQTT broker for alarm_alert [2024-06-06 10:48:24,945] - mqtt - INFO - Send configuration to MQTT broker for alarm_alert_source [2024-06-06 10:48:24,945] - mqtt - INFO - Send default state (nothing) to MQTT broker for alarm_alert_source [2024-06-06 10:48:24,945] - mqtt - INFO - Send configuration to MQTT broker for alarm_ping [2024-06-06 10:48:24,945] - mqtt - INFO - Send default state (ping) to MQTT broker for alarm_ping [2024-06-06 10:48:24,946] - server - INFO - Socket now listening [2024-06-06 10:49:15,276] - server - INFO - ### Connected with 46.xxx.xxx.xxx:17332 ### [2024-06-06 10:49:15,277] - server - INFO - Start new thread: 140265724353312 [2024-06-06 10:49:15,277] - server - INFO - Number of threads: 3 Exception in thread Thread-2: Traceback (most recent call last): File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/local/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "server.py", line 95, in client_thread if (client_auth(connection)): File "/usr/src/app/utils.py", line 25, in client_auth serial = serial.decode().split(',')[1] IndexError: list index out of range

[2024-06-06 10:51:20,250] - server - INFO - ### Connected with 46.xxx.xxx.xxx:11229 ### [2024-06-06 10:51:20,250] - server - INFO - Start new thread: 140265724353312 [2024-06-06 10:51:20,250] - server - INFO - Number of threads: 3

I paste the config.json, I don't see any typographical errors, let's see if you can find them.

{ "socket_bind": "", "socket_listen_port": 888, "socket_timeout" : 5.0, "mqtt_host": "XXX.XXX.XXX.XXX", "mqtt_user": "user", "mqtt_pwd": "Password", "mqtt_port": 1883, "mqtt_prefix": "RsiToAlarm", "home_assistant_integration": 1, "home_assistant_sensors": { "alarm_arm": { "device_class": "lock", "default_state": "ON", "sensor_type": "binary_sensor" }, "alarm_arm_source": { "device_class": "None", "default_state": "nobody", "sensor_type": "sensor" }, "alarm_power": { "device_class": "plug", "default_state": "ON", "sensor_type": "binary_sensor" }, "alarm_autoprotection": { "device_class": "safety", "default_state": "OFF", "sensor_type": "binary_sensor" }, "alarm_autoprotection_source": { "device_class": "None", "default_state": "nothing", "sensor_type": "sensor" }, "alarm_alert": { "device_class": "problem", "default_state": "OFF", "sensor_type": "binary_sensor" }, "alarm_alert_source": { "device_class": "None", "default_state": "nothing", "sensor_type": "sensor" }, "alarm_ping": { "device_class": "None", "default_state": "ping", "sensor_type": "sensor" } }, "mapping_events": { "1": { "type": "alarm_alert", "state": "ON", "comment": "alarm alert !", "device_index": 1 }, "3": { "type": "alarm_autoprotection", "state": "ON", "comment": "autoprotection !", "device_index": 1 }, "4": { "type": "alarm_autoprotection", "state": "OFF", "comment": "autoprotection recovery" }, "5": { "type": "panic_button", "state": "OFF", "comment": "Panic Buttons", "device_index": 1}, "6": { "type": "alarm_5_wrong_codes", "state": "OFF", "comment": "5 wrong codes" }, "7": { "type": "alarm_disarmed_code", "state": "OFF", "comment": "disarmed with duress code +1" }, "8": { "type": "alarm_armed_code:", "state": "OFF", "comment": "armed with duress code +2" }, "19": { "type": "alarm_power", "state": "OFF", "comment": "ac power lost" }, "20": { "type": "alarm_power", "state": "ON", "comment": "ac power recovery" }, "24": { "type": "alarm_arm", "state": "OFF", "comment": "armed", "mapping_users": 1 }, "25": { "type": "alarm_arm", "state": "ON", "comment": "disarmed", "mapping_users": 1 }, "26": { "type": "alarm_ping", "state": "pong", "comment": "ping / pong" }, "27": { "type": "alarm_alert", "state": "OFF", "comment": "intrusion ack" } }, "mapping_users": { "1": "User1", "2": "User2", "3": "User3" }, "device_index": { "1": { "name": "Teclado1", "zone": 1 }, "2": { "name": "Mando1", "zone": 1 }, "3": { "name": "Teclado2", "zone": 1 }, "4": { "name": "Salon", "zone": 2 }, "5": { "name": "Mando2", "zone": 1 }, "6": { "name": "Cocina", "zone": 1 }, "7": { "name": "Pasillo bajo", "zone": 2 }, "8": { "name": "Comedor", "zone": 2 }, "9": { "name": "Pasillo Boardill", "zone": 2 }, "10": { "name": "Sirena1", "zone": 1 } }, "zones": { "1": { "name": "zone1" }, "2": { "name": "zone2" }, "3": { "name": "zone3" }, "4": { "name": "zone4"} } }

I have changed some parameters for privacy. Thanks.