Ajax alarm system

The JC events are just strange the RP still works, JC has to do with restoring from this: “Too many unsuccessful attempts have been made to enter a user ID” so not sure what is going on with your system…

Thanks, what would the User ID be??

It is now back working, uninstalled, removed files and restarted and readded, hopefully it was a weird glitch!!

Did you eventually manage to connect your Bentel Absoluta System to Home assistant?

Hoping there are some MQTT experts on here. I’m trying to use the Space Control with a Wemos D1 Lite described above by a few others. The coding doesn’t account for logging on to the MQTT server. Can anyone suggest where to add the MQTT login details?


include <ESP8266WiFi.h>
#include <PubSubClient.h>

#define  ARM_ZONE2     D1
#define  DISARM_ZONE2  D5
#define  DISARM_ZONE1  D2
#define  ARM_ZONE1     D6
#define  NIGHT         D7

WiFiClient   espClient;
PubSubClient mqtt(espClient);
const char* ssid     = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";
const char* host     = "YOUR_MQTT_BROKER_IP";

void setup() {
  Serial.begin(115200);
  //built in led on because it looks good
  pinMode(LED_BUILTIN, OUTPUT);

  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print('.');
    delay(500);
  }
  mqtt.setServer(host, 1883);
  mqtt.setCallback(callback);
}

void reconnect() {
  while (!mqtt.connected()) {
    Serial.print("Attempting MQTT connection...");
    String clientId = "ESP8266Client-";
    clientId += String(random(0xffff), HEX);
    // if (mqtt.connect(clientId.c_str())) {
    if (mqtt.connect(clientId.c_str(), "mqtt", "RANDOM_20_CHARACTER_ID")) {
      mqtt.subscribe("ajax/alarm");
    } else {
      Serial.print("failed, rc=");
      Serial.print(mqtt.state());
      Serial.println(" try again in 5 seconds");
      delay(5000);
    }
  }
  Serial.println("MQTT Connected.");
}

void loop() {
  if (!mqtt.connected()) {
    reconnect();
  }
  mqtt.loop();
}


void callback(
  char* topic,
  byte* payload,
  unsigned int length
) {
  Serial.print("Message arrived [");
  Serial.print(topic);
  Serial.print("] ");
  String msg = "";
  for (int i = 0; i < length; i++) {
    Serial.print((char)payload[i]);
    msg = msg+(char)payload[i];
  }

  if (strcmp(topic, "ajax/alarm") == 0 && msg == "arm_zone1") {
    pressButton(ARM_ZONE1);
  } else if (strcmp(topic, "ajax/alarm") == 0 && msg == "disarm_zone1") {
    pressButton(DISARM_ZONE1);
  } else if (strcmp(topic, "ajax/alarm") == 0 && msg == "arm_zone2") {
    pressButton(ARM_ZONE2);
  } else if (strcmp(topic, "ajax/alarm") == 0 && msg == "disarm_zone2") {
    pressButton(DISARM_ZONE2);
  } else if (strcmp(topic, "ajax/alarm") == 0 && msg == "night") {
    pressButton(NIGHT);
  }
}

void pressButton(int buttonId) {
  pinMode(buttonId, OUTPUT);
  digitalWrite(buttonId, LOW);
  delay(300);
  pinMode(buttonId, INPUT);
  Serial.println(" SENT SIGNAL");
}

Hi @eavanvalkenburg,

Since your latest update (Beta branch), see there : https://github.com/eavanvalkenburg/sia/releases/tag/v0.4.0-beta.1
You’ve implemented an event which can be triggered by HA with all SIA codes.

Can you provide me an example on HA for an event on SIA based Ajax System like using Nodered ?

Thank you.

Not sure what you mean @Drealine. The sia event is received and a ha event is created with several of the info fields from the sia event, in this file you can see the mapping: custom_components/sia/hub.py. How to use the ha event in nodered isnt something I’ve done, so can’t help you there, but should be possible!

Ok, thank you @eavanvalkenburg, it work! I can see the event which is in the format : “sia_event_‘siaport’_‘siaaccount’” on Ajax.

Codes are ok using armed/disarmed mode.

Just a question, it’s not possible to have the description of the event ? Like in this GDocs : https://docs.google.com/spreadsheets/d/1-N-RZVS8IiwM5zuw2u4gt8Bx_5xo_JOwuagHJgSJxUw/edit#gid=2144546461 “Event description”.

It would be great to have that for filtering the event using keyword like “door”, etc…

Sure, I’ll see how I can add more info on the event, I’ve been mostly working on the package for sia, so might take some time, with the custom component you could just add fields yourself be editing the hub file in the folder of your instance

Ok, I see.

Like the doc, it seems that the description can pass arguments like device and room.
You’ve see this also ? Example : low battery, [device] in [room]

What am I missing here? Please help!

In the Ajax app
Protocol: SIA Protocol
Object number (Account?): ACAB
Connect on demand: On
IP Address: 192.168.1.183
Port: 8120

I installed the SIA Integration via HACS. I put in “ACAB” as account (“Object number” in the app) and the port 8120 which I choose.

In the app is says
Monitoring Station: Connected

But I get “Unknown” for all the added entities, like below:
image

I get below WARNING in the log:

2021-03-24 22:08:21 WARNING (MainThread) [pysiaalarm.aio.sia_server] Last event: Content: #ACAB|Nri0/RP0000]_21:08:10,03-24-2021, Zone (ri): 0, Code: RP, Message: 0000, Concerns: Unused, Type: Automatic Test, Description: Automatic communication test report, Account: ACAB, Receiver: None, Prefix: L0, Timestamp: 2021-03-24 21:08:10, Length: 003B, Sequence: 0375, CRC: 76BD, Calc CRC: 76BD, Message type: Automatic Test, Encrypted Content: None, Full Message: "SIA-DCS"0375L0#ACAB[#ACAB|Nri0/RP0000]_21:08:10,03-24-2021., gave error in user function: 'NoneType' object has no attribute 'disabled'.

Anyone else with the same issue?

Thanks in advance.

I’ll need to check that message, but overall it looks ok, because sia is a passive protocol, it only sends a message when something happened, other than the RP one, so arm and disarm your alarm to see what happens then! Also are you running the 4… Beta version, if not please do, is much better, just have to finalize some things before making that the main!

Ahaa, it’s working! Thanks! :slight_smile:
Now I can see “Disarmed”:
image

Maybe this can be added to the documentation and also add that the “Account” is the same as “Object number” in the app?

Hi there!

Can’t install SIA integration.

Having this error — https://img.netpeak.ua/fireblast/21-eu437-ljt4n.png

And, there is what I see in the logs:

Logger: custom_components.sia.config_flow
Source: custom_components/sia/config_flow.py:108
Integration: sia (documentation)
First occurred: 15:08:53 (4 occurrences)
Last logged: 15:13:18

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/sia/config_flow.py", line 108, in async_step_user
    await self.async_set_unique_id(f"{DOMAIN}_{self.data[CONF_PORT]}")
TypeError: 'NoneType' object is not subscriptable

Hi! Thanks for giving it a try, what did you fill in for the port (0 is not allowed, it needs to be a open port)? Also what version of the integration are you using?

I tried to use last beta. But, when I tried 3.11 version it worked good. Then I updated SIA to last beta, and now everything is working good.

I have a small annoying issue that is very specific so I doubt this is a common problem.

The back plate of my alarm panel (code panel?) is a bit loose so when I activate/deactivate the alarm Ajax often sends me a push notification saying that the back panel is open. This causes my Home Assistant to send an alarm triggered event. I have changed my code to only send this type of notification/event when state goes from armed_away to triggered so I don’t really think this should happen. Any idea?

Hi everyone, I have a problem.
I have installed SIA from HACS and when I go to add the integration by configuring the port and account I get an error “Unexpecter error”.
How can I solve it?
Thanks

Hi, guys. Do you now is there any chance to add a Ajax motion sensor support to this supercool plug-in ?

With the SIA protocol, that is not possible by default, I think there were some people who replicated that by splitting each sensor into a zone and then having that zone armed, which causes it to trigger a “alarm” when a door is opened, the same might work with motion sensors.