Ajax alarm system

Since 2023.4 the alarm state isn’t translated to Swedish for me. Read somewhere that this needs to be adjusted in the integration. Is that true?

If so, changing the following would make it look a bit better :slight_smile:

  • Armed away = larmat
  • Disarmed = Avlarmat

I have Ajax in HA integrated by using SIA. I get the correct armed state in HA (in HA everything is working). Now I like to forward the state of ajax to homekit, but there I don’t get the correct state. It is on off all the time.
I would be happy to get the current armed state in homekit. If I change to armed night I see following error in HA:
Logger: homeassistant.helpers.event
Source: components/homekit/type_security_systems.py:160
First occurred: 21:28:24 (3 occurrences)
Last logged: 21:47:59

Error while processing state change for alarm_control_panel.ajax
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/event.py”, line 287, in _async_state_change_dispatcher
hass.async_run_hass_job(job, event)
File “/usr/src/homeassistant/homeassistant/core.py”, line 593, in async_run_hass_job
hassjob.target(*args)
File “/usr/src/homeassistant/homeassistant/components/homekit/accessories.py”, line 455, in async_update_event_state_callback
self.async_update_state_callback(event.data.get(“new_state”))
File “/usr/src/homeassistant/homeassistant/components/homekit/accessories.py”, line 477, in async_update_state_callback
self.async_update_state(new_state)
File “/usr/src/homeassistant/homeassistant/components/homekit/type_security_systems.py”, line 160, in async_update_state
self.char_current_state.set_value(current_state)
File “/usr/local/lib/python3.10/site-packages/pyhap/characteristic.py”, line 297, in set_value
self.valid_value_or_raise(value)
File “/usr/local/lib/python3.10/site-packages/pyhap/characteristic.py”, line 219, in valid_value_or_raise
raise ValueError(error_msg)
ValueError: SecuritySystemCurrentState: value=2 is an invalid value.

same question i have

Is anyone experiencing an abnormal amount of times where the alarm state is set to “unknown”?
This used to happen very rarely, like if there was a malfunction/connection issue or de-sync with SIA, but recently it is happening to me every single day. Automation to arm away or arm night works just fine, but automation to disarm are failing due to “unknown” state.

Ajax Hub 2 Plus
HW version: 82.2.9.10.3.5.1.0
FW version: EU 2.14.1

Home Assistant 2023.5.0b6
SIA integration
Mosquitto MQTT broker
Ajax Remote + Mini D1

Looks like I found one of the problems:

2023-05-04 00:12:50.946 ERROR (MainThread) [homeassistant.util.logging] Exception in async_handle_event when dispatching 'sia_event_8333_AAA': (SIAEvent(full_message='"*SIA-DCS"0459L0#AAA[B9AAAAAA53742F1AD0BB59978C39E59D3A3DB58AEE56D9DBCB52088CD343A803888623A18699990F331AAD4823F3F074', msg_crc='A9F7', length='0075', encrypted=True, message_type=<MessageTypes.SIADCS: 'SIA-DCS'>, receiver=None, line='L0', account='AAA', sequence='0459', content="DkW7'|#AAA|Nri0/RP0000]_23:12:48,05-03-2023", encrypted_content='B9AAAAAA53742F1AD0BB59978C39E59D3A3DB58AEE56D9DBCB52088CD343A803888623A18699990F331AAD4823F3F074', ti=None, id=None, ri='0', code='RP', message='0000', x_data=None, timestamp=datetime.datetime(2023, 5, 3, 23, 12, 48, tzinfo=datetime.timezone.utc), event_qualifier=None, event_type=None, partition=None, calc_crc='A9F7', extended_data=None),)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sia/sia_entity_base.py", line 132, in async_handle_event
relevant_event = self.update_state(sia_event)
File "/usr/src/homeassistant/homeassistant/components/sia/binary_sensor.py", line 135, in update_state
new_state = self.entity_description.code_consequences[sia_event.code]
KeyError: 'RP'

Home Assistant 2023.5
SIA integration
I have a warning:

Logger: pysiaalarm.aio.client
Source: components/sia/__init__.py:20
First occurred: 14:17:35 (1 occurrences)
Last logged: 14:17:35

This method is depricated and will be removed, use async_start instead.

The component is not working !!!

Still not working after update 2023.5.2 any news/solution? It’s an important component :slight_smile:

I’m currently running 2023.3.0. Before upgrading, I’d like to know whether SIA integration works or not under 2023.5.3. Thank you

See my comment from Oct 18 2021. Perhaps the correct multi zone night mode logic is still not implemented?

In short, the correct way to deal with night mode is to treat it like a separate global state. Night mode can be enabled or disabled independently of the individual zones. Zone X can be armed or disarmed back and forth while night mode is still enabled, affecting what state it will be in after night mode is disabled.

Back in 2021 the SIA integration couldn’t handle that so I bypassed it and implemented my own logic with input_booleans and event triggers, which I still use and it’s rock solid.

Hello,

I try to use SIA for an ajx alarm but I have a weird issue, entity become unvailable for few minute then it’s ok and again available… :

Did someone else have this issue ? How can I fix it ?

Thank in advance.

I had the same issue but roughly fixed this by toggling a helper based on the state changes. So toggle alarm helper on when state changes to armed and toggle alarm helper off when state changes to disarmed. This way the switch to unavailable, which seems to occur 90s after a state change, is filtered out and the state is stored by HA instead of read from SIA. Not ideal but works like a charm for my automations. Also means all the different armed states are translated into a simple on/off toggle

1 Like

What HA version are you running? I’m running HAOS 2023.3.0. No issue with this one

I’am on 2023.5.4, latest version. But since I restart HA yesterday it’s ok, I don’t known why it’s weird… Are they any setting to disable unknown state ?

I’m not aware of such option

going to unknown is determined by the setting for the ping interval/periodic report, so make sure the settings for those are the same!

Hello,

I’am a developper, I just finish a call with Ajax and I talk with api developer team about to add on SIA state of door event if alarm is not arm. It’s a first time they hear so they will study that. But I think if lot user ask for it, it can be possible. So I think you can ask Ajax to do that (on linkdin, facebook, telegram, mail or any other communication you have). I also ask Jeedom community to do the same.

I’am not sure they will do something but we need to try.

Did someone managed to connect SIA Ajax Alarm to mqtt broker?
Want to add external status read / control…
Would apreciate for example

Here is what I did to get it integrated with Domoticz. If I recall well, this was my first work with HA, I can tell you that I sweat a lot :wink:
There are four zones as you can see. Mosquitto MQTT broker is installed on a specific RasPI gear.

  - id: '1642926428231'
    alias: Alarm integration with dz
    description: Intégration des zones d'alarme
    variables:
      device_type: '{{trigger.entity_id.split("_") | last}}'
    trigger:
    - platform: state
      entity_id: alarm_control_panel.5656_ccc_zone_4_alarm
    - platform: state
      entity_id: alarm_control_panel.5656_ccc_zone_3_alarm
    - platform: state
      entity_id: alarm_control_panel.5656_ccc_zone_2_alarm
    - platform: state
      entity_id: alarm_control_panel.5656_ccc_zone_1_alarm
    condition:
    - condition: template
      value_template: '{{ (state_attr(trigger.entity_id,''last_zone'')) | int != 0 }}'
    - condition: or
      conditions:
      - condition: template
        value_template: '{{ (state_attr(trigger.entity_id,''last_code'')) == "OG" }}'
      - condition: template
        value_template: '{{ (state_attr(trigger.entity_id,''last_code'')) == "CG" }}'
      - condition: template
        value_template: '{{ (state_attr(trigger.entity_id,''last_code'')) == "NL" }}'
      - condition: template
        value_template: '{{ (state_attr(trigger.entity_id,''last_code'')) == "NP" }}'
        enabled: true
    action:
    - service: rest_command.ajax2dz_event
      data:
        state: '{{states(trigger.entity_id)}}'
        zone: '{{state_attr(trigger.entity_id,''last_zone'')}}'
        deviceClass: '{{device_type}}'
        lastMessage: '{{state_attr(trigger.entity_id,''last_message'')}}'
        previousState: '{{trigger.from_state.state}}'
    max: 10
    mode: queued

in configuration.yaml I have:

rest_command:
  ajax2dz_event:
    url: !secret dzCustomEventAlarm
    method: get

in secrets.yaml I have:

dzCustomEventAlarm:
  'http://ip:port/json.htm?username=xxxxxxx&password=xxxxxxxxx
  &type=command&param=customevent&event=haAlarm&data={"state": "{{state}}", "zone": "{{zone}}", "deviceClass": "{{deviceClass}}",
    "lastMessage": "{{lastMessage}}", "previousState": "{{previousState}}"}'

So smth. like this wouldn’t work? and i need to use automations to publush state?

alarm_control_panel:
  - platform: manual
    name: "Ajax Alarm"
    state_topic: "home/alarm"
    command_topic: "home/alarm/set"
    availability_topic: "home/alarm/availability"
    payload_arm_home: "ARM_HOME"
    payload_arm_away: "ARM_AWAY"
    payload_disarm: "DISARM"
    state_arm_home: "armed_home"
    state_arm_away: "armed_away"
    state_disarm: "disarmed"

You have to bear in mind that you cannot drive Ajax alarm system with SIA. This integration is read only. So the code that I posted is for the sole purpose to let Domoticz know what is the status of each zone. If you wan’t to arm away/dismarm/armed night, as of now you have to tinkere a bit. Please see this post.
The basic idea is to use three controllable relays of your flavor, mine are IP controllable and mimic space control button press.