Giter VIP home page Giter VIP logo

pysiaalarm's Introduction

Hi there 👋

I am Eduard van Valkenburg, a Cloud Solution Architect for Partners at Microsoft in the Netherlands. I have a background in everything Data and ML, but I also do a lot of python coding, mostly for Home Assistant.

Other stuff:

pysiaalarm's People

Contributors

eavanvalkenburg avatar mach0gr 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pysiaalarm's Issues

How to

Hello,

i am looking for some sort of how-to to install and run the pysiaalarm, can you help me with that?

Thanx in advance

IPC-A42-B and IPC-S42F imou cameras don't work in HA

IPC-A42-B and IPC-S42F imou cameras do not work in HA

After 6 months, I still can't get these two IMOU camera models to play video in HA.

has anyone been able to fix it? or can you help me

The model is: 4Mpx ranger 2 and 4mpx bullet cruiser.

Thanks a lot

Sia "v3" will not parse correctly

I am using a Scantronic (Eaton/Cooper) alarm and am getting the following error in HA generated by pssialarm

2020-09-29 20:44:45 DEBUG (MainThread) [pysiaalarm.aio.sia_server] Incoming line: 1908002B"SIA-DCS"0000L0#3080[#3080|Nti19:44/id1/RP] 2020-09-29 20:44:45 DEBUG (MainThread) [pysiaalarm.base_sia_server] Parsed event: Content: #3080|Nti19:44/id1/RP], Zone: , Code: Nt, Message: i19:44/id1/RP, Concerns: None, Type: None, Description: None, Account: 3080, Receiver: None, Prefix: L0, Timestamp: None, Length: 002B, Sequence: 0000, CRC: 1908, Calc CRC: 1908, Message type: None, Encrypted Content: None, Full Message: "SIA-DCS"0000L0#3080[#3080|Nti19:44/id1/RP].. 2020-09-29 20:44:45 WARNING (MainThread) [pysiaalarm.base_sia_server] Code not found, replying with DUH to account: 3080

As described in HA forum here
https://community.home-assistant.io/t/unknown-event-code-handling-with-sia-integration/230885/3?u=jamesarbrown

The alarm has direct ARC reporting as follows

The report types available are: Fast Format, Contact ID, SIA 1, SIA 2, Scancom SIA 3, Extended SIA 3 and Extended SIA3 v2.

Where SIA2 does work with pysialarm, but the issue for me is to enable the Secureconnect Eaton cloud, the cloud takes over the ARC reporting and that only offers the SIA3, ex SIA 3 and SIA 3. The above is with SC SIA3. Later I will try others.

I dont know if it helps but here is the Excerpt from the Eaton engineering guide about the SIA types

SIA 1, SIA 2, SIA 3 and Extended SIA 3
When using the SIA formats the control unit transmits data from the event log to the ARC.
The four SIA formats differ in the amount of data transmitted with each message:
Type Format
SIA1: #AAAAAA|NCCcc
SIA2: #AAAAAA|Nidnnn/rinn/CCcc
SIA3: #AAAAAA|Ntihh:mm/idnnn/rinn/CCcc
#AAAAAA|AS
Extended SIA
3:
#AAAAAA|Ntihh:mm/idnnn/rinn/CCcc/AS

Where:
AAAAAA 6-digit programmable account code (e.g. 123456).
“N” New Event (always N).
“ti”hh:mm/ time (e.g. ti10:23/).
“id”nnn/ user number, if applicable; otherwise not sent (e.g.
id123/ or id6/).
“ri”nn/ partition no. (e.g. ri12/ or ri3).
CC event code (e.g. FA = Fire Alarm).
cc zone number, if applicable; otherwise not sent
(e.g. 23 or 5).
“A”S text description of event, usually the log event
description.
(The control unit sends those characters shown between “ and “ above literally as they
appear in the text.)
For example, if there is a fire alarm on zone 2 of partition 4 at 10:15 (partition 4 account
number is 10), the message would be:
SIA1: #10|NFA2
SIA2: #10|N/ri4/FA2
SIA3: #10|Nti10:15/ri4/FA2 #10|AFire Zone 2
Extended SIA3: #10|Nti10:15/ri4/FA2/AFire Zone 2
Extended SIA3 V2
Some versions of the software that works in SIA receivers do not always recognise the “/”
text delimiter. This can cause problems with spurious “Mains Fail” messages appearing to
the ARC when the control unit sets, unsets or goes into or out or installer mode.
In version 2 of Extended SIA3 the “/” delimiter has been replaced by a “|”. So, for example,
the string:
#10|Nti10:15/ri4/FA2/AFire Zone 2
becomes:
#10|Nti10:15|ri4|FA2|AFire Zone 2
If you have experienced problems with spurious “Mains Fail” messages try using this
Extended SIA3 V2

Tellmon IP bridge - NULL frame not recognized

I am getting this error in HomeAssistant, using pysiaalarm 3.1.1:
Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: D2860025"NULL"0001#1997[]_17:07:08,05-23-2024. Line: D2860025"NULL"0001#1997[]_17:07:08,05-23-2024
I am suspecting that the 0001 before the account id is the problem, but not sure., any hints?

probleme entité SIA

l'entité SIA AJAX ALARME ne fonctionne pas . le périphérique ce déconnecte après une ou deux seconde

line could not be parsed as a SIAEvent or OHEvent

Hi,

I just updated to the 3.0.0b7 and i have now a problem with this message from Ajax alarm

BF940059"SIA-DCS"0004L0#AAA[#AAA|Nri1/PA501][X006E07.7777777][Y49N06.6666666]_20:45:46,04-22-2021

Thanks for your help
Phil

Dahua Airshield - SIA-DC09

Getting the following error while trying to setup Dahua Airshield hub - any ideas?

Logger: pysiaalarm.base_server
Source: runner.py:188
First occurred: 11:02:07 (2411 occurrences)
Last logged: 12:25:33

Last line could not be parsed succesfully. Error message: Parse content: no matches found in #ABC|3450 01 033][RLivingRoom][[email protected]]_11:02:31,01-25-2024 , using matcher: re.compile('\n[#]?(?P[A-F0-9]{3,16})?\n[|]?\n(?P<event_qualifier>\d{1})\n(?P<event_type>\d{3})\n\s\n(?P\d{2})\n\s\n(?P\d{3})\n[\]]\n(?:\[(?:(?<=\[)(?P.[^\\[\\]])(?=\])), re.VERBOSE). Line: 0836005E"ADM-CID"0006L0#ABC[#ABC|3450 01 033][RLivingRoom][[email protected]]_11:02:31,01-25-2024 1EB1005E"ADM-CID"0007L0#ABC[#ABC|1400 01 033][RLivingRoom][[email protected]]_11:02:36,01-25-2024 27CA005E"ADM-CID"0008L0#ABC[#ABC|1406 01 033][RLivingRoom][[email protected]]_11:02:36,01-25-2024
Last line could not be parsed succesfully. Error message: Parse content: no matches found in #ABC|1454 01 033][RLivingRoom][[email protected]]_11:02:08,01-25-2024 , using matcher: re.compile('\n[#]?(?P[A-F0-9]{3,16})?\n[|]?\n(?P<event_qualifier>\d{1})\n(?P<event_type>\d{3})\n\s\n(?P\d{2})\n\s\n(?P\d{3})\n[\]]\n(?:\[(?:(?<=\[)(?P.[^\\[\\]]
)(?=\])), re.VERBOSE). Line: A8D0005E"ADM-CID"0002L0#ABC[#ABC|1454 01 033][RLivingRoom][[email protected]]_11:02:08,01-25-2024 B9B5005E"ADM-CID"0003L0#ABC[#ABC|3450 01 033][RLivingRoom][[email protected]]_11:02:14,01-25-2024
Last line could not be parsed succesfully. Error message: Parse content: no matches found in #ABC|1454 01 033][RLivingRoom][[email protected]]_11:02:28,01-25-2024, using matcher: re.compile('\n[#]?(?P[A-F0-9]{3,16})?\n[|]?\n(?P<event_qualifier>\d{1})\n(?P<event_type>\d{3})\n\s\n(?P\d{2})\n\s\n(?P\d{3})\n[\]]\n(?:\[(?:(?<=\[)(?P.[^\\[\\]])(?=\])), re.VERBOSE). Line: B30E005E"ADM-CID"0005L0#ABC[#ABC|1454 01 033][RLivingRoom][[email protected]]_11:02:28,01-25-2024
Last line could not be parsed succesfully. Error message: Parse content: no matches found in #ABC|1130 01 003][RLivingRoom][IBackDoor]_11:02:28,01-25-2024, using matcher: re.compile('\n[#]?(?P[A-F0-9]{3,16})?\n[|]?\n(?P<event_qualifier>\d{1})\n(?P<event_type>\d{3})\n\s\n(?P\d{2})\n\s\n(?P\d{3})\n[\]]\n(?:\[(?:(?<=\[)(?P.[^\\[\\]]
)(?=\])), re.VERBOSE). Line: 22E20053"ADM-CID"0004L0#ABC[#ABC|1130 01 003][RLivingRoom][IBackDoor]_11:02:28,01-25-2024
Last line could not be parsed succesfully. Error message: Parse content: no matches found in #ABC|1454 01 033][RLivingRoom][[email protected]]_11:02:08,01-25-2024 , using matcher: re.compile('\n[#]?(?P[A-F0-9]{3,16})?\n[|]?\n(?P<event_qualifier>\d{1})\n(?P<event_type>\d{3})\n\s\n(?P\d{2})\n\s\n(?P\d{3})\n[\]]\n(?:\[(?:(?<=\[)(?P.[^\\[\\]]*)(?=\])), re.VERBOSE). Line: A8D0005E"ADM-CID"0002L0#ABC[#ABC|1454 01 033][RLivingRoom][[email protected]]_11:02:08,01-25-2024 B9B5005E"ADM-CID"0003L0#ABC[#ABC|3450 01 033][RLivingRoom][[email protected]]_11:02:14,01-25-2024 B30E005E"ADM-CID"0005L0#ABC[#ABC|1454 01 033][RLivingRoom][[email protected]]_11:02:28,01-25-2024

Parsing error on comxline 3516-2

Hi,
I got a parsing error if I try to connect my comxline 3516-2 to my HA. Can you help?
2022-08-07 19:56:14 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: Parse content: no matches found in %s, using matcher: %s. Line: CA910045"ADM-CID"0011R1L1#12345678[#12345678|1130 00 007]345678[] 2345678[]
2022-08-07 19:56:14 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: Parse content: no matches found in %s, using matcher: %s. Line: 9C1E0045"ADM-CID"0011R1L1#12345678[#12345678|1130 00 007]022 0)9a��t
2022-08-07 19:56:14 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: Parse content: no matches found in %s, using matcher: %s. Line: FD250045"ADM-CID"0011R1L1#12345678[#12345678|1130 00 007]022 G�5v

Alarm Eldes - sensor status.

Hello, can anyone help me ??
I would like to be able to check the status of my eldes alarm sensors (doors, perimeter, smoke, etc), which I have integrated in Home Assistant.

thanks

I am using a Dahua alarm system with SIA-DC09

and this is the error:

Logger: pysiaalarm.base_server
Source: runner.py:186
First occurred: 16:24:10 (5 occurrences)
Last logged: 16:24:38

Last line could not be parsed succesfully. Error message: Parse content: no matches found in #B12345|1602 00 000]_17:23:51,09-18-2023 , using matcher: re.compile('\n[#]?(?P[A-F0-9]{3,16})?\n[|]?\n(?P<event_qualifier>\d{1})\n(?P<event_type>\d{3})\n\s\n(?P\d{2})\n\s\n(?P\d{3})\n[\]]\n(?:\[(?:(?<=\[)(?P.[^\\[\\]])(?=\])), re.VERBOSE). Line: DABA003F"ADM-CID"0062L0#B12345[#B12345|1602 00 000]_17:23:51,09-18-2023 B0E60058"ADM-CID"0050L0#123456[#123456|3441 01 000][RLivingRoom][IuserName]_17:20:15,09-18-2023 BFEC0058"ADM-CID"0055L0#123456[#123456|1400 01 000][RLivingRoom][IuserName]_17:22:02,09-18-2023 2DE1004C"ADM-CID"0056L0#123456[#123456|1406 01 000][RLivingRoom]_17:22:02,09-18-2023 BA990058"ADM-CID"0057L0#123456[#123456|3441 01 000][RLivingRoom][IuserName]_17:22:30,09-18-2023 6AED0058"ADM-CID"0059L0#123456[#123456|1400 01 000][RLivingRoom][IuserName]_17:22:58,09-18-2023 6225004C"ADM-CID"0060L0#123456[#123456|1406 01 000][RLivingRoom]_17:22:58,09-18-2023
Event timestamp is no longer valid: 2023-09-18 17:24:26+00:00
Last line could not be parsed succesfully. Error message: Parse content: no matches found in #123456|3441 01 000][RLivingRoom][IuserName]_17:20:15,09-18-2023 , using matcher: re.compile('\n[#]?(?P[A-F0-9]{3,16})?\n[|]?\n(?P<event_qualifier>\d{1})\n(?P<event_type>\d{3})\n\s\n(?P\d{2})\n\s\n(?P\d{3})\n[\]]\n(?:\[(?:(?<=\[)(?P.[^\\[\\]]
)(?=\])), re.VERBOSE). Line: B0E60058"ADM-CID"0050L0#123456[#123456|3441 01 000][RLivingRoom][IuserName]_17:20:15,09-18-2023 BFEC0058"ADM-CID"0055L0#123456[#123456|1400 01 000][RLivingRoom][IuserName]_17:22:02,09-18-2023 2DE1004C"ADM-CID"0056L0#123456[#123456|1406 01 000][RLivingRoom]_17:22:02,09-18-2023 BA990058"ADM-CID"0057L0#123456[#123456|3441 01 000][RLivingRoom][IuserName]_17:22:30,09-18-2023 6AED0058"ADM-CID"0059L0#123456[#123456|1400 01 000][RLivingRoom][IuserName]_17:22:58,09-18-2023 6225004C"ADM-CID"0060L0#123456[#123456|1406 01 000][RLivingRoom]_17:22:58,09-18-2023 2A580058"ADM-CID"0064L0#B12345[#B12345|3441 01 000][RLivingRoom][IuserName]_17:24:26,09-18-2023 6F440029"NULL"0000L0#B12345[]_17:24:30,09-18-2023
Last line could not be parsed succesfully. Error message: Parse content: no matches found in #B12345|1400 01 000][RLivingRoom][IuserName]_17:24:42,09-18-2023, using matcher: re.compile('\n[#]?(?P[A-F0-9]{3,16})?\n[|]?\n(?P<event_qualifier>\d{1})\n(?P<event_type>\d{3})\n\s\n(?P\d{2})\n\s\n(?P\d{3})\n[\]]\n(?:\[(?:(?<=\[)(?P.[^\\[\\]]*)(?=\])), re.VERBOSE). Line: E02D0058"ADM-CID"0065L0#B12345[#B12345|1400 01 000][RLivingRoom][IuserName]_17:24:42,09-18-2023
Event timestamp is no longer valid: 2023-09-18 17:24:42+00:00

Logger: pysiaalarm.base_server
Source: runner.py:186
First occurred: 16:24:10 (9 occurrences)
Last logged: 16:25:50

Event timestamp is no longer valid: 2023-09-18 17:24:42+00:00
Event timestamp is no longer valid: 2023-09-18 17:24:46+00:00
Last line could not be parsed succesfully. Error message: Parse content: no matches found in #123456|3441 01 000][RLivingRoom][IuserName]_17:20:15,09-18-2023 , using matcher: re.compile('\n[#]?(?P[A-F0-9]{3,16})?\n[|]?\n(?P<event_qualifier>\d{1})\n(?P<event_type>\d{3})\n\s\n(?P\d{2})\n\s\n(?P\d{3})\n[\]]\n(?:\[(?:(?<=\[)(?P.[^\\[\\]])(?=\])), re.VERBOSE). Line: B0E60058"ADM-CID"0050L0#123456[#123456|3441 01 000][RLivingRoom][IuserName]_17:20:15,09-18-2023 BFEC0058"ADM-CID"0055L0#123456[#123456|1400 01 000][RLivingRoom][IuserName]_17:22:02,09-18-2023 2DE1004C"ADM-CID"0056L0#123456[#123456|1406 01 000][RLivingRoom]_17:22:02,09-18-2023 BA990058"ADM-CID"0057L0#123456[#123456|3441 01 000][RLivingRoom][IuserName]_17:22:30,09-18-2023 6AED0058"ADM-CID"0059L0#123456[#123456|1400 01 000][RLivingRoom][IuserName]_17:22:58,09-18-2023 6225004C"ADM-CID"0060L0#123456[#123456|1406 01 000][RLivingRoom]_17:22:58,09-18-2023 2A580058"ADM-CID"0064L0#B12345[#B12345|3441 01 000][RLivingRoom][IuserName]_17:24:26,09-18-2023 E02D0058"ADM-CID"0065L0#B12345[#B12345|1400 01 000][RLivingRoom][IuserName]_17:24:42,09-18-2023 C70F004C"ADM-CID"0066L0#B12345[#B12345|1406 01 000][RLivingRoom]_17:24:42,09-18-2023 6F850029"NULL"0000L0#B12345[]_17:25:30,09-18-2023
Event timestamp is no longer valid: 2023-09-18 17:25:51+00:00
Last line could not be parsed succesfully. Error message: Parse content: no matches found in #123456|3441 01 000][RLivingRoom][IuserName]_17:20:15,09-18-2023 , using matcher: re.compile('\n[#]?(?P[A-F0-9]{3,16})?\n[|]?\n(?P<event_qualifier>\d{1})\n(?P<event_type>\d{3})\n\s\n(?P\d{2})\n\s\n(?P\d{3})\n[\]]\n(?:\[(?:(?<=\[)(?P.[^\\[\\]]
)(?=\])), re.VERBOSE). Line: B0E60058"ADM-CID"0050L0#123456[#123456|3441 01 000][RLivingRoom][IuserName]_17:20:15,09-18-2023 BFEC0058"ADM-CID"0055L0#123456[#123456|1400 01 000][RLivingRoom][IuserName]_17:22:02,09-18-2023 2DE1004C"ADM-CID"0056L0#123456[#123456|1406 01 000][RLivingRoom]_17:22:02,09-18-2023 BA990058"ADM-CID"0057L0#123456[#123456|3441 01 000][RLivingRoom][IuserName]_17:22:30,09-18-2023 6AED0058"ADM-CID"0059L0#123456[#123456|1400 01 000][RLivingRoom][IuserName]_17:22:58,09-18-2023 6225004C"ADM-CID"0060L0#123456[#123456|1406 01 000][RLivingRoom]_17:22:58,09-18-2023 2A580058"ADM-CID"0064L0#B12345[#B12345|3441 01 000][RLivingRoom][IuserName]_17:24:26,09-18-2023 E02D0058"ADM-CID"0065L0#B12345[#B12345|1400 01 000][RLivingRoom][IuserName]_17:24:42,09-18-2023 C70F004C"ADM-CID"0066L0#B12345[#B12345|1406 01 000][RLivingRoom]_17:24:42,09-18-2023

line could not be parsed as a SIAEvent

Hi Eduard,
I just updated to the 5.0. beta 1.
Now I get this error when HA receives the message:

2021-04-11 22:40:56 DEBUG (MainThread) [pysiaalarm.base_server] Incoming line: 9618004D"SIA-DCS"7960L0#123456[#123456|Nri1CL0^VX FRONTE ^]_22:40:48,04-11-2021
2021-04-11 22:40:56 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed as a SIAEvent or OHEvent, line was: 9618004D"SIA-DCS"7960L0#123456[#123456|Nri1CL0^VX FRONTE ^]_22:40:48,04-11-2021

Thanks for your help

Stefano

How to add new value to AMD-CID mapping (adm_mapping.json)

I'm using your code installing your library with pip and your example file pysiaalarm/tests/run.py, and I don't understand how can I add new values to the mapping file adm_mapping.json. This is what I receive in my logs:

WARNING:pysiaalarm.base_server:Code not found, replying with DUH to account: 5555
DEBUG:pysiaalarm.base_server:Incoming line: A7C70040"ADM-CID"0224L000000#5555[#5555|3407 01 503]_09:06:27,01-15-2024
DEBUG:pysiaalarm.event:Content matches: {'account': '5555', 'event_qualifier': '3', 'event_type': '407', 'partition': '01', 'ri': '503', 'xdata': None, 'timestamp': '09:06:27,01-15-2024'}
WARNING:pysiaalarm.base_server:Code not found, replying with DUH to account: 5555
DEBUG:pysiaalarm.base_server:Incoming line: 778C0040"ADM-CID"0225L000000#5555[#5555|1456 01 503]_09:06:27,01-15-2024
DEBUG:pysiaalarm.event:Content matches: {'account': '5555', 'event_qualifier': '1', 'event_type': '456', 'partition': '01', 'ri': '503', 'xdata': None, 'timestamp': '09:06:27,01-15-2024'}
Evento ricevuto: Content: #5555|1456 01 503]_09:06:27,01-15-2024, Zone (ri): 503, Code: CG, Message: , Account: 5555, Receiver: None, Line: L000000, Timestamp: 2024-01-15 09:06:27+00:00, Length: 0040, Sequence: 0225, CRC: 778C, Calc CRC: 778C, Encrypted Content: None, Full Message: "ADM-CID"0225L000000#5555[#5555|1456 01 503]_09:06:27,01-15-2024.

In here you can see that event_type 456 works and event_type 407 doesn't, 407 is the one that I want to add, how can I do this?

ADM-CID: Last line could not be parsed as a SIAEvent or OHEvent

System informations:

System Health

version: core-2021.9.7
installation_type: Home Assistant OS
dev: false
hassio: true
docker: true
user: root
virtualenv: false
python_version: 3.9.7
os_name: Linux
os_version: 5.10.62
arch: x86_64
timezone: Europe/Rome

logged_in: false
can_reach_cert_server: ok
can_reach_cloud_auth: ok
can_reach_cloud: ok

host_os: Home Assistant OS 6.4
update_channel: stable
supervisor_version: supervisor-2021.09.6
docker_version: 20.10.7
disk_total: 30.8 GB
disk_used: 2.0 GB
healthy: true
supported: true
board: ova
supervisor_api: ok
version_api: ok
installed_addons: File editor (5.3.3)

dashboards: 1
resources: 0
views: 1
mode: storage

I get the following error message:

DEBUG (MainThread) [pysiaalarm.aio.client] Starting SIA.
DEBUG (MainThread) [pysiaalarm.base_server] Incoming line: D0850078"*ADM-CID"6879R0L0#123F[64F7ADD9BA9377DBF2C014BC709329BEEE345B5F20C60B7EB9D2C6B8C222666B13D0B4A114B448B0AC555FCC658DB6EE
WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed as a SIAEvent or OHEvent, line was: D0850078"*ADM-CID"6879R0L0#123F[64F7ADD9BA9377DBF2C014BC709329BEEE345B5F20C60B7EB9D2C6B8C222666B13D0B4A114B448B0AC555FCC658DB6EE

Can you maybe help me?

Thanks!

Regards
Patrick

ConnectionResetError: [Errno 104] Connection reset by peer

Hello,

I use your library for a community project but I have an issue with a hkivision AX PRO alarm.

Everything works perfectly fine for all incoming lines except for the following line :

DEBUG:pysiaalarm.sia_server:Incoming line: CA2F0038"NULL"0000L0#7890[#0000|0000 00 000]_22:13:29,12-29-2022
DEBUG:pysiaalarm.base_sia_server:Parsed event: Content: #0000|0000 00 000]_22:13:29,12-29-2022, Zone: 0, Code: RP, Message:  00 000, Concerns: Unused, Type: Automatic Test, Description: Automatic communication test report, Account: 7890, Receiver: None, Prefix: L0, Timestamp: 2022-12-29 22:13:29, Length: 0038, Sequence: 0000, CRC: CA2F, Calc CRC: CA2F, Message type: Automatic Test, Encrypted Content: None, Full Message: "NULL"0000L0#7890[#0000|0000 00 000]_22:13:29,12-29-2022..
----------------------------------------
Exception happened during processing of request from ('185.238.6.49', 52770)
Traceback (most recent call last):
  File "/usr/lib/python3.7/socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
    self.handle()
  File "/usr/local/lib/python3.7/dist-packages/pysiaalarm/sia_server.py", line 49, in handle
    raw = self.request.recv(1024)
ConnectionResetError: [Errno 104] Connection reset by peer
----------------------------------------

I use the default test program run.py.
Any idea ?
Thanks a lot ;-)

Ajax Alarm - trigger issue

Hi there, I'm trying to set up some automations when my ajax alarm is armed and disarmed. While the disarmed trigger works as intended, there is no armed or armed away trigger, only arming, which doesn't appear to do anything when I arm the alarm. Also the arming trigger doesn't show the device name while the 2 others do. Is this a known issue?

image

Unsupported code

Hello,

I got an error while trying to connect SATEL Perfecta alarm that supports DC-09 codes set; I am unable to add the 'ID' code into the config, can you please support me?

DEBUG:pysiaalarm.base_server:Incoming line: 80DA0040"SIA-DCS"0002L0#AA1234[#AA1234|Nri2/id15/OP]_10:03:32,06-14-2023
DEBUG:pysiaalarm.event:Content matches: {'account': 'AA1234', 'ti': None, 'id': None, 'ri': '2', 'code': 'id', 'message': '15/OP', 'xdata': None, 'timestamp': '10:03:32,06-14-2023'}
WARNING:pysiaalarm.base_server:Code not found, replying with DUH to account: AA1234

sia doesn't work

Hi,
I have amc x824 alarm panel. I believe this alarm panel is ADM-CID capable. I'm struggling for ages to get this thing connect to my home assistant instance. In alarm configuration I set up cms parameters, for ip I use my ha ip, port 10000 protocol DC 09 SIA.
In sia configuration in ha I use port 10000 and for account_id I use hex number of my pin code for alarm system.
I enable debug mode in configuraion.yaml and all I get is
2022-11-19 16:11:12.985 DEBUG (MainThread) [pysiaalarm.aio.client] Starting SIA.
When I set up sia I get 6 devices. I don't have moisture and smoke sensors. My alarm is disconnected and pir sensor status is, of course, unavailable.
Maybe I'm doing something wrong, I don't know. All I know that I tried everything that cross my mind and nothing seems to work.
Alarm works, it's connected to amc cloud and I can control it over android app.

Jablotron JA100: UDP instead of TCP, some non-standard fields

I would like to use pysiaalarm with a Jablotron JA100+ alarm system. This system only supports UDP and requires a few quirks - the CRC field is encoded in binary instead of ASCII and thus uses only two bytes instead of 4.

Do you have interest in supporting this and how to best implement it?

ADM-CID not works

Hi,
My alarm uses adm-cid, i added it to HA without setting the encryption key because i can set max 8 char on my alarm, the configuration is ok but from HA the status is always unknown.
Can you help me please?

Case sensitiveness

Hi,

It took me a while to get a proper connection between my Ajax alarm system and pysiaalarm:

  • Account ID is case sensitive (while I was expecting hexadecimal strings would not be), I was getting:
WARNING:pysiaalarm.base_server:There is no account for a encrypted line, line was:
  • Same seems to be the case for the encryption key, I was getting:
WARNING:pysiaalarm.base_server:Last line could not be parsed succesfully. Error message: Parse content: no matches found in %s, using matcher: %s. Line:

In the end, I got it working by having account id all uppercase (same as in the Ajax Hub application) and encryption key all lowercase.

Thanks for the useful lib!
Best,

Socket exhaustion with SIA

Hi,

I am using the asyncio version of pysiaalarm as per the test example (https://github.com/eavanvalkenburg/pysiaalarm/blob/master/tests/run_aio.py) and I am regularly getting errors such as

févr. 21 02:05:29 domotique python[2711]: ERROR - 2022-02-21 02:05:29 - asyncio: socket.accept() out of system resource
févr. 21 02:05:29 domotique python[2711]: socket: <asyncio.TransportSocket fd=13, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('0.0.0.0', 8001)>
févr. 21 02:05:29 domotique python[2711]: Traceback (most recent call last):
févr. 21 02:05:29 domotique python[2711]:   File "/usr/lib/python3.9/asyncio/selector_events.py", line 164, in _accept_connection
févr. 21 02:05:29 domotique python[2711]:     conn, addr = sock.accept()
févr. 21 02:05:29 domotique python[2711]:   File "/usr/lib/python3.9/socket.py", line 293, in accept
févr. 21 02:05:29 domotique python[2711]:     fd, addr = self._accept()
févr. 21 02:05:29 domotique python[2711]: OSError: [Errno 24] Too many open files

I am using pysialarm with an Ajax alarm system.

It seems that for some reason pysiaalarm is not releasing sockets. See

$ lsof | grep 8001  | wc -l
12000

all of them being between my Ajax hub IP and pysiaalarm system (connection status "ESTABLISHED") with a bunch of different source ports on the Ajax hub IP side.

Upon restart of the client app, I only get

$ lsof | grep 8001  | wc -l
15

10 being LISTEN status on *:8001 (pysiaalarm listener) and 5 being ESTABLISHED between my Ajax hub (single source port) and pysiaalarm.

Has anyone already noticed this behavior?

Thanks!

Integration with Focus Alarm Systems

Hello,

I use a simple but reliable alarm system: FOCUS FC-7688. According to the manual, it can handle SIA2013 and CID.

It offers fields in the CMS configuration that do not match those of the SIA integration:

  • user and PWD do not appear in the SIA integration.
  • the "Heart beat Contact ID Code:" allows only 8 HEX digits - if it corresponds at all to the ID in the SIA Integration, which expects min 16 digits..

My configuration.yaml contains

sia:
  port: 7974
  hubs:
    name: focus7688
    account: FFAA1122
    # password: n/a

The integration detects the alarm system. It sets up entities and devices but does not fill them:
"binary_sensor.7974_ffaa1122_connectivity" == off
"alarm_control_panel.7974_ffaa1122_zone_1_alarm" == unavailable
"binary_sensor.7974_ffaa1122_power" == unavailable
"binary_sensor.7974_ffaa1122_zone_1_moisture" == unknown
"binary_sensor.7974_ffaa1122_zone_1_smoke" == unknown

The log repeats fastly this line:

2022-09-05 23:47:28.266 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: %s. Line: 7A28002F"ADM-CID"6616R0L0#foc7688[#foc7688|1351 01 000]

Does this mean that the system does not work at all with this integration or can I configure it somehow?

Many greetings,
Eckart

220905 15_59_18-TCP_IP PANEL

Integration with ELDES alarm systems

Hi ! I'm trying to integrate with an alarm system by ELDES.
I have the same issue with the thread here Cheaterdev/sia-ha#3

My options on Alarm system side are like this
image

image
with the following being the messages being transmitted, sorry long image

image

On HA side these are some logs that keep on comming.
2021-08-12 19:11:31 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: AA1A, Calculated CRC: 1B95. Line was "ADM-CID"0227R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:11:43 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: 155A, Calculated CRC: 1A3E. Line was "ADM-CID"0228R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:11:54 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: C89B, Calculated CRC: DA12. Line was "ADM-CID"0229R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:12:58 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: 8D07, Calculated CRC: 06E1. Line was "ADM-CID"0233R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:13:10 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: 1C46, Calculated CRC: C623. Line was "ADM-CID"0234R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:13:21 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: C187, Calculated CRC: 060F. Line was "ADM-CID"0235R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:13:44 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: E7C7, Calculated CRC: 0678. Line was "ADM-CID"0236R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:13:56 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: 3A06, Calculated CRC: C654. Line was "ADM-CID"0237R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:14:07 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: 8546, Calculated CRC: C7FF. Line was "ADM-CID"0238R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:14:26 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: 5887, Calculated CRC: 07D3. Line was "ADM-CID"0239R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:14:38 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: 9B16, Calculated CRC: 97D7. Line was "ADM-CID"0240R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:14:50 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: 46D7, Calculated CRC: 57FB. Line was "ADM-CID"0241R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:15:08 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: 6097, Calculated CRC: 578C. Line was "ADM-CID"0242R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:15:20 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: BD56, Calculated CRC: 97A0. Line was "ADM-CID"0243R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:15:31 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: 2C17, Calculated CRC: 5762. Line was "ADM-CID"0244R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:15:50 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: F1D6, Calculated CRC: 974E. Line was "ADM-CID"0245R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:16:01 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: D796, Calculated CRC: 9739. Line was "ADM-CID"0246R4F39L4F39#4F39[#4F39|3401 01 057] 2021-08-12 19:16:13 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: 0A57, Calculated CRC: 5715. Line was "ADM-CID"0247R4F39L4F39#4F39[#4F39|3401 01 057]

I'd love to get this done somehow

Bentel Absoluta compatible

hello,
I have a Bentel Absoluta alarm system that runs as SIA client over FIBRO (UDP), so it needs a receiver to communicate.
Do you know if this python module is compatible with it?
Can you please share a simple code to run an UDP server and parse the client message with pysiaalarm lib?

thanks.

[ADM-CIC] Not working with Eldes

Without timestamp:
2022-01-19 04:09:45 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: BCD3, Calculated CRC: 52A3. Line was "ADM-CID"1533L0#4F39[#4F39|1412 00 000]
2022-01-19 04:09:57 WARNING (MainThread) [pysiaalarm.base_server] CRC mismatch, ignoring message. Sent CRC: FCDF, Calculated CRC: 1E5C. Line was "ADM-CID"1534L0#4F39[#4F39|1412 00 000]

With timestamp:
2022-01-19 04:12:36 WARNING (MainThread) [pysiaalarm.base_server] Code not found, replying with DUH to account: 4F39
2022-01-19 04:12:48 WARNING (MainThread) [pysiaalarm.base_server] Code not found, replying with DUH to account: 4F39

Used both offical integration from HA itself, and tried from Master branch.

[ADM-CID] Not working with Aritech

Hello,
Integration is not working with Aritech alarm system

Error message:
Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: %s. Line: LFQ=600#CRC=C9868A4C470F970426ECDD8F00B761BC##
Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: %s. Line: HID=16:00:00:00:02:09#UID=1234#TMPV=1.00#FW=05.07#HW=Ecoline_SIA#HWGID=16:00:00:00:02:09#PROV=PROXIMUS#LFQ=600#CRC=91477F80BC33FEA59561963B46912D26##
Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: %s. Line: LFQ=600#CRC=332F95BF8C32A8DE2858164C50EBB1B3##
Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: %s. Line: HID=16:00:00:00:02:09#UID=1234#TMPV=1.00#FW=05.07#HW=Ecoline_SIA#HWGID=16:00:00:00:02:09#PROV=PROXIMUS#LFQ=600#CRC=DCDE39411098129468EE7ECB8AEE0C8F##
Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: %s. Line: LFQ=600#CRC=5145C3215C570B9DA1F720C04D6ADB53##

Thank you for your support,
Alex

SIA failed from Galaxy dimension 96 v7.04 HAOS on RPI 3B

hi tried to set up with honey well galaxy dimension 96 v7.04 on HAOS on RPI 3B but the bellow fault happens with SIA levels 1, 2, 3
note! account number edited to 001234 not original account number but account in format 00xxxx

Logger: pysiaalarm.base_server
Source: runner.py:120
First occurred: 17:19:03 (8906 occurrences)
Last logged: 18:03:17

Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: %s. Line: F#001234

Not a SIA or ADM Spec event, compatibility

Hi guys, I've been trying to set up a SIA monitor on HA, but have problems.
The alarm is a DSC board with an ethernet module:
https://www.trikdis.com/alarm-communicators/ethernet-alarm-communicators/ethernet-communicator-e16/

Now, it says it supports TRK, TL150, DC-09_2007 and DC-09_2012 protocols.
When I set it to DC-09_2012 without encryption, the log is as follows:

Can somebody point me in any direction?

2023-08-30 22:05:31.097 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: K0029"NULL"0000R1L1#9413[]_23:05:28,08-30-2023. Line: K0029"NULL"0000R1L1#9413[]_23:05:28,08-30-2023
2023-08-30 22:05:31.203 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: 003D"ADM-CID"0001R1L1#9413[#9413|1700 99 999]_23:05:28,08-30-2023. Line: 003D"ADM-CID"0001R1L1#9413[#9413|1700 99 999]_23:05:28,08-30-2023
2023-08-30 22:05:33.007 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: 0n003D"ADM-CID"0002R1L1#9413[#9413|1602 99 999]_23:05:30,08-30-2023. Line: 0n003D"ADM-CID"0002R1L1#9413[#9413|1602 99 999]_23:05:30,08-30-2023
2023-08-30 22:05:33.759 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: N"003D"ADM-CID"0003R1L1#9413[#9413|1411 99 999]_23:05:30,08-30-2023. Line: N"003D"ADM-CID"0003R1L1#9413[#9413|1411 99 999]_23:05:30,08-30-2023
2023-08-30 22:06:03.898 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: @0029"NULL"0000R1L1#9413[]_23:05:58,08-30-2023. Line: @0029"NULL"0000R1L1#9413[]_23:05:58,08-30-2023
2023-08-30 22:06:10.863 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: �003D"ADM-CID"0004R1L1#9413[#9413|1401 01 040]_23:06:05,08-30-2023. Line: �003D"ADM-CID"0004R1L1#9413[#9413|1401 01 040]_23:06:05,08-30-2023
2023-08-30 22:06:41.001 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: 0029"NULL"0000R1L1#9413[]_23:06:36,08-30-2023. Line: 0029"NULL"0000R1L1#9413[]_23:06:36,08-30-2023
2023-08-30 22:07:11.203 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: E'0029"NULL"0000R1L1#9413[]_23:07:06,08-30-2023. Line: E'0029"NULL"0000R1L1#9413[]_23:07:06,08-30-2023
2023-08-30 22:07:41.305 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: "0029"NULL"0000R1L1#9413[]_23:07:36,08-30-2023. Line: "0029"NULL"0000R1L1#9413[]_23:07:36,08-30-2023
2023-08-30 22:08:11.507 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: Ah0029"NULL"0000R1L1#9413[]_23:08:06,08-30-2023. Line: Ah0029"NULL"0000R1L1#9413[]_23:08:06,08-30-2023
2023-08-30 22:08:17.327 WARNING (MainThread) [pysiaalarm.base_server] Last line could not be parsed succesfully. Error message: No matches found, event was not a SIA or ADM Spec event, line was: "003D"ADM-CID"0005R1L1#9413[#9413|1412 99 999]_23:08:12,08-30-2023. Line: "003D"ADM-CID"0005R1L1#9413[#9413|1412 99 999]_23:08:12,08-30-2023
2023-08-30 22:08:36.795 WARNING (MainThread) [pysiaalarm.base_server] Event timestamp is no longer valid: 2023-08-30 23:08:32+00:00
2023-08-30 22:08:36.895 WARNING (MainThread) [pysiaalarm.base_server] Code not found, replying with DUH to account: 9413
2023-08-30 22:08:37.700 WARNING (MainThread) [pysiaalarm.base_server] Event timestamp is no longer valid: 2023-08-30 23:08:33+00:00
2023-08-30 22:09:07.888 WARNING (MainThread) [pysiaalarm.base_server] Event timestamp is no longer valid: 2023-08-30 23:09:05+00:00
2023-08-30 22:09:37.991 WARNING (MainThread) [pysiaalarm.base_server] Event timestamp is no longer valid: 2023-08-30 23:09:35+00:00
2023-08-30 22:09:48.667 WARNING (MainThread) [pysiaalarm.base_server] Event timestamp is no longer valid: 2023-08-30 23:09:45+00:00
2023-08-30 22:10:18.793 WARNING (MainThread) [pysiaalarm.base_server] Event timestamp is no longer valid: 2023-08-30 23:10:16+00:00
2023-08-30 22:10:48.895 WARNING (MainThread) [pysiaalarm.base_server] Event timestamp is no longer valid: 2023-08-30 23:10:46+00:00
2023-08-30 22:11:18.999 WARNING (MainThread) [pysiaalarm.base_server] Event timestamp is no longer valid: 2023-08-30 23:11:16+00:00
2023-08-30 22:11:49.206 WARNING (MainThread) [pysiaalarm.base_server] Event timestamp is no longer valid: 2023-08-30 23:11:46+00:00
2023-08-30 22:12:19.401 WARNING (MainThread) [pysiaalarm.base_server] Event timestamp is no longer valid: 2023-08-30 23:12:16+00:00
2023-08-30 22:12:31.458 WARNING (MainThread) [pysiaalarm.base_server] Code not found, replying with DUH to account: 9413

typo mistake for xdata identifier

in xdata.json

 "Y": {
        "identifier": "A",
        "name": "Latitude",
        "description": "Location of event, latitude.",
        "length": 12,
        "characters": "ASCII"
    },

must be (I think)

 "Y": {
        "identifier": "Y",
        "name": "Latitude",
        "description": "Location of event, latitude.",
        "length": 12,
        "characters": "ASCII"
    },

identifier is wrong

Please help me

I m sorry but I don´t have knowledge in programming etc. I have Ajax alarm with different sensors and in differents rooms. I use three alarm methods, one full activation, another night and another a partical activation.

Also I have two smoke sensors and two water detectors.

Please could you help me how to integrate all this devices and methods?

Thanks

Bosch AMAX3000 Integration

Hi,

I configured my Bosch AMAX 3000 Panel w/ HA

It seems that events does not recognized successfully i.e:

messages during partition 2 away arm

2023-02-14 15:22:22.346 DEBUG (MainThread) [pysiaalarm.base_server] Incoming line: 33FC002B"ADM-CID"0014L0#000001[#000001|3401 02 001] 2023-02-14 15:22:22.347 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '000001', 'event_qualifier': '3', 'event_type': '401', 'partition': '02', 'ri': '001', 'xdata': None, 'timestamp': ''} 2023-02-14 15:22:22.358 DEBUG (MainThread) [homeassistant.components.sia.hub] Adding event to dispatch and bus for code CL for port 7475 and account 000001 2023-02-14 15:22:22.359 DEBUG (MainThread) [homeassistant.components.sia.sia_entity_base] Received event: Content: #000001|3401 02 001], Zone (ri): 001, Code: CL, Message: , Account: 000001, Receiver: None, Line: L0, Timestamp: None, Length: 002B, Sequence: 0014, CRC: 33FC, Calc CRC: 33FC, Encrypted Content: None, Full Message: "ADM-CID"0014L0#000001[#000001|3401 02 001]. 2023-02-14 15:22:22.359 DEBUG (MainThread) [homeassistant.components.sia.alarm_control_panel] New state will be armed_away

messages during partition 3 away arm

2023-02-14 15:21:50.605 DEBUG (MainThread) [pysiaalarm.base_server] Incoming line: 33B4002B"ADM-CID"0013L0#000001[#000001|1441 03 001] 2023-02-14 15:21:50.606 DEBUG (MainThread) [pysiaalarm.event] Content matches: {'account': '000001', 'event_qualifier': '1', 'event_type': '441', 'partition': '03', 'ri': '001', 'xdata': None, 'timestamp': ''} 2023-02-14 15:21:50.623 DEBUG (MainThread) [homeassistant.components.sia.hub] Adding event to dispatch and bus for code CG for port 7475 and account 000001 2023-02-14 15:21:50.624 DEBUG (MainThread) [homeassistant.components.sia.sia_entity_base] Received event: Content: #000001|1441 03 001], Zone (ri): 001, Code: CG, Message: , Account: 000001, Receiver: None, Line: L0, Timestamp: None, Length: 002B, Sequence: 0013, CRC: 33B4, Calc CRC: 33B4, Encrypted Content: None, Full Message: "ADM-CID"0013L0#000001[#000001|1441 03 001]. 2023-02-14 15:21:50.624 DEBUG (MainThread) [homeassistant.components.sia.alarm_control_panel] New state will be armed_away

both events trigger entity "alarm_control_panel.7475_000001_zone_1_alarm" all other entities are Unavailable state

image

Also Stay arm and Away arm does not have any differences on code, all the messages on debug log came as "armed_away"

Is there any config that I can do to fix these? at least to specify the partition of execution on different entity id ?

thanks in advance

Event timestamp is no longer valid

Hi there,
since few days I noticed the SIA home-assistant HACS integration is failing.

In my logs, lots of:

2021-05-24 16:57:19 WARNING (MainThread) [pysiaalarm.base_server] Event timestamp is no longer valid: 2021-05-24 14:58:20+00:00

I triple-checked all my timezones configurations in home-assistant, all is fine.
I see in the logs that you modified the way the integration behaves according to timestamps, maybe it's related ?
I tried to downgrade but I'm facing further errors (like key error timestamp).

any clue ? any further intel needed maybe ?

Aritech - ATS1000A - test connection

We have a php sia pac script but trying to switch to pysiaalarm for HA intergration.

If I start run.py with the same port and key, my alarm generates the following error

Config:  {'host': '0.0.0.0', 'port': 12300, 'account_id': '123456', 'key': 'xxxxxxxxxxxxxx'}
DEBUG:pysiaalarm.sync.client:Starting SIA.
----------------------------------------
Exception happened during processing of request from ('x.x.x.x', 1203)
Traceback (most recent call last):
  File "/usr/lib/python3.8/socketserver.py", line 683, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.8/socketserver.py", line 747, in __init__
    self.handle()
  File "/home/jacobs/github/Kiwatt/pysiaalarm/tests/pysiaalarm/sync/handler.py", line 44, in handle
    raw = self.request.recv(1024)
ConnectionResetError: [Errno 104] Connection reset by peer
----------------------------------------

I think this is due to the fact that the alarm first needs a (scrambled) 48 hex key send to it before it gives the sia message. After the alarm connects to the port my php script send the key to the alarm:

	function connect($socket){
		$client = new pacClient($this, $socket, $this->clientNr++);
		$this->clients[(int)$socket] = $client;
		$this->sockets[] = $socket;

		socket_getpeername($socket, $addr);
		$this->clients[(int)$socket]->ip = $addr;
		$this->log('#'.$client->id.': client connected '.$socket.' ('.$addr.')', 'light_green');
		$client->sendKey();
	}


	function sendKey(){
		$scramble = hex2bin('xxxxxxxxxxxxxxxxxxxxxxxxxxxx');
		$keyLength = strlen($scramble);

		$key = openssl_random_pseudo_bytes($keyLength);
		$this->key = $key;

		for($i = 0; $i < $keyLength; $i++){
			$key[$i] = $key[$i] ^ $scramble[$i];
		}
		$this->server->log($this->key, 'light_red');
		$this->send($key);
	}

	function send($message, $encrypt = false){
		if($this->server->debug){
			$this->server->log('#'.$this->id.": send\n".hexdump($message), 'red');
		}

		if($encrypt){
			$message = $this->encrypt($message);
		}
		socket_write($this->socket, $message, strlen($message));
	}
[Wed, 10 May 2023 15:03:59 +0200] #21: client connected Resource id #33 (x.x.x.x)
[Wed, 10 May 2023 15:03:59 +0200] #21: send
0000: 79 59 BB 2A 21 F0 20 58 C6 DE 85 2D 02 B8 94 CA  yY.*!..X...-....
0010: E8 6F FF 0B 16 9F 2F D4                          .o..../.

[Wed, 10 May 2023 15:03:59 +0200] #21: recv
0000: 53 52 30 30 30 31 4C 30 30 30 31 20 20 20 20 31  SR0001L0001....1
0010: 32 33 34 35 36 58 58 20 20 20 20 00 00 00 00 00  23456XX.........

[Wed, 10 May 2023 15:03:59 +0200] #21: send
0000: 41 43 4B 0D 00 00 00 00                          ACK.....

please advice

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.