Ajax alarm system

That is the alarm_control_panel, the smoke (FireProtect) and water leak (LeaksProtect) sensors will show up as Binary_sensors in HA with device classes Smoke and Moisture, see docs for those here: https://www.home-assistant.io/integrations/binary_sensor/

2 Likes

Iā€™m facing the same issue.

Run two fresh installation of HA 0.108.9, one on macos and another on synology/docker. Sia 0.2.4 was installed through hacs. The Ajax hub is on Wifi, ethernet port is being used because of lockdownā€¦

Both setups behave the same : hub status and mode change get updated for one minute or two and then the alarm remains in an unavailable state.

The ping frequency set to ā€˜1ā€™ in Ajax and to ā€˜1ā€™ in sia (tried setting to ā€˜60ā€™ in sia in vain).

Looking at the logs, iā€™ve seen some CRC mismatch events after restarting HA, could the sia server crash after erroneous packets have been received ?

Tried to wireshark, but canā€™t get the packets to the sia server.

CRC mismatch is most likely due to encryption key not being correct, not sure what happens if that happens with each message. In general the component creates a server that runs on the specified port, the Alarm system needs to be able to reach that server and port (with ip and port specified in your alarm). But if you do get the CRC mismatch messages it means it is able to read the message coming in, but the CRC in the message does not equal the CRC that is calculated based on the content. The ping frequency basically means that the alarm system sends a message every X minutes to say ā€œI"m still aliveā€ and other than that it is silent unless something happens with the systems (alarms armed, disarmed, changes to config and the heartbeat), usually for debugging I set both to 1 minutes so you get at least those messages every minute.

Oh and the unavailable happens if the component does not get a new message (of any kind) from your alarm within the ping interval (in minutes) + a margin, so if you have your component setup with 1 minute ping interval, but your alarm is set to 10 minutes, then after 1 minute your alarm goes into state unavailable so that you can do automations based on your alarm being offline. So keep those settings in sync between your alarm and HA.

Thank for your explanations, Iā€™ve synced back ping intervals on both systems, encryption is not used.

I have two issues,

  • ping are not sent/received/processed after 2 minutes : the lovelace card says ā€œlast heartbeat : XX ago.ā€ XX being as of now 4 minutes.
  • When changing the ajax hub from armed/disarmed mode manually several times, the lovelace card is correctly updated until it freezes : the state either goes unavailable or remains in the last known state.

After restarting HA, I see CRC mismatch events, I will try switching to wired, that could eliminate wifi connections issues.

Here is one CRC mismatch event from HA logs :

2020-04-29 17:49:50 DEBUG (Thread-2) [custom_components.sia] TCP: Handle Line: event: CRC: 19A5, Calc CRC: 8FE9, Full Message: "SIA-DCS"1384L0#AAA[, Message type: SIA-DCS, Sequence: 1384, Receiver: , Prefix: L0, Account: AAA, Encrypted Content: , Content: , Zone: , Code: , Message: , Timestamp: , Code: , Type: , Description: , Concerns: 
2020-04-29 17:49:50 ERROR (Thread-2) [custom_components.sia] TCP: Handle Line: CRC mismatch, received: 19A5, calculated: 8FE9

hmm, Iā€™ve not used the unencrypted version a lot myself, so might be a bug in the parsing of the message when not encrypted, could you turn on encryption to verify? just needs 16 HEX characters.

Turned encryption on and wired Ajax hub.

When setting the Ajax hub to disarmed, ping are processed properly every minute and events show instantly in HA.
When the hub is in armed mode, looks like a 1 minute ā€˜stallā€™ something happens. After that, processing goes back to normal.

As I donā€™t which of these two changes (or both) made the setup work, my advice is to :

  • turn encryption on
  • try using the hub wired instead of wifi.

Eduard, thanks for your support :grinning:

Xavier.

thanks for checking, I think it is likely due to encryption so will fix that, Iā€™m currently working through making it an official component, so might not show up in this version.

Hello! Wondering if anyone has Ajax running with the uartBridge at the moment?
I would like to know if it is possible to find out the status of the sensors by this method.

1 Like

I donā€™t have one, but considering this component is based on a industry spec (SIA DC-09) Iā€™m not sure which Event codes would be sent by the component, what you could do is run my new python package (which I created to start creating a official integration) and then check the output to see which events are sent, it is here, a new pypi version will be created later today after some final testing: https://github.com/eavanvalkenburg/pysiaalarm

1 Like

this is the official documentation

This looks like it is a completely separate protocol from the SIA protocal, created by Ajax themselves. So my component wonā€™t be able to interact with it, will have to be built from scratch.

1 Like

As I get it from the docs, this is totally separated hardware and it was designed to organize Ajax devices into network but it does not work with Ajax software. So you buy uartBridge and can connect all ajax devices to it programm your own interactions with low level programming.

1 Like

Having the same issue :frowning:

@eavanvalkenburg hey, sorry for the direct link Iā€™ve just managed to get this all installed using HACS however, I am very confused as to what should actually be populated within the config.yaml?

sia:
  port:  port
  hubs:
    - name: hubname
      account: account
      encryption_key: password
      zones:
        - zone: 1
          name: zonename
          sensors:
           - alarm
           - moisture
           - smoke

More specifically all of the variables, I am unsure how to populate these I have imagined it would be something like this?

sia:
  port:  port (what is this? some port for communication within ajax?)
  hubs:
    - name: Home (i guess, this is what the hub is called within my ajax environment?)
      account: account (no idea what this is? the email account setup on the ajax app?)
      encryption_key: (is this the one i set for encryption within the AJAX app?)
      zones:
        - zone: 1
          name: Upstairs (its what its called in ajax?)
          sensors: (do i remove the ones i dont have here)
           - alarm 
           - moisture
           - smoke
        - zone: 2
          name: Downstairs (its what its called in ajax?)
          sensors: (do i remove the ones i dont have here)
           - alarm 
           - moisture
           - smoke

Hi @Teshiburu, in general there are a couple of things that have to match between what you setup for Remote Monitoring in your Ajax app and here and does are the account, encryption key and port. This component creates a server that listens on that port, your alarm will send messages to that port to indicate status changes, the rest are more about naming etc, see all the details here: https://github.com/eavanvalkenburg/sia#configuration-options

Superb! It makes total sense now.

I have initially opted for the ā€œminimum configā€

Following on from the comment that other sensors will be added dynamically, Iā€™m guessing this is when they check in with the hub, then your component will detect them?

Thanks @eavanvalkenburg so much for pointing me towards that readme lol!

1 Like

Hi all, I have created a pre-release for the new version which is much better (if I say so myself) and it is pretty much the code that also has been submitted to be included as a official component! It works with a config flow, so if you install the beta (which you can do by going into reinstall in HACS) you can then add the component and open the config flow from Integrations. The way it works is similar to the current setup with some notable differences (which is why I put it in as a beta), you set the port that it listens on, you add the first account, specifying account name, encryption_key (optional), ping_interval and the number of zones for that account, you can then add a checkbox to add additional accounts on that port, if you have two alarm systems for some reason. Per account/zone combination three entities are created 1 alarm_control_panel, 2 binary_sensors (smoke and moisture) and for each account a last heartbeat sensor is added. You can then rename and/or hide them as you see fit in the interface. In order to support this I had to change the naming of the entities so be careful when you move over that you also change any automations or scripts that use the state. I expect that the official version will keep the same names and settings so once youā€™re on this version it shouldnā€™t be jarring to move over! You can also create multiple instances that listen on different ports.

3 Likes

Thank you for your work. I have installed the beta 0.3.2b, but I cant find the component under Integrations?

Donā€™t know why that happens, Iā€™ve sometimes had custom components immediately show up, as is expected (without a reboot) but also times when I had to reboot and force refresh a couple of timesā€¦