YET another take on an alarm system

post your script (replace private codes)

I have setup the HASS custom alarm using homekit, and ios. Does anyone know why the alarm states do not match between the HASS, Homekit, and Homekit notifications.

The modes in HASS are ‘home’,‘away’, and ‘perimeter’, the buttons in the homekit-home assistant entity are, ‘home’, ‘away’, and ‘night’. …and then the -notifications- I get from homekit are ‘stay’, ‘away’, and ‘night’.

I was trying to clean up the name mismatches, by looking through the files. I did find how to change the names for HASS (files in the .homeassistant directory and files in the /usr/local/lib/python3.7/site-packages/homeassistant directory.) I did some global name changes of the HASS mode buttons and variable names, which worked, but even after doing this, they did not change the mode names in homekit, or in the homekit notications-- they remained the same. I am clearly not finding where those mode names are stored.
( I did think maybe the old names are caches somewhere, and if I cleared those out, maybe it might work- so I deleted all the .pyc files, and the db file. but that didn’t help)

Does someone know how that works?
Darrin

Hi, I have been using this alarms and works flawlessly. But now I have an issue. I’ve installed the android app: ‘mqtt alarm panel’ by thanksmister and configured it. Everything works except the disarm. I can Arma home or away from the app and it works fine, if I arm or disarm from hassio it immediately updates in hassio. But if I try disarming from the app, nothing happens. It’s the only thing that is not working. Any thoughts??

Are you passing the disarm code ?

Im NOT sure what you mean by passing The code. But i have set the code in the app yes. Do i need to do anything else? I have defined the same code in the app as i have in the alarm.yaml

When doing it from a script you have to pass the disarm code to the alarm control panel. Like this:

alarm_disarm:
  sequence:
    service: alarm_control_panel.alarm_disarm
    entity_id: alarm_control_panel.house
    data:
      code: !secret alarm_code

Not sure how to pass this via mqtt. Check the docs at github?

Theres a solution , which is setting override to true in alarm.yaml so it accepts mqtt without a code

@johnplanetz that was it! Thanks for the suggestion. All I had to do was this, just like you said:

## [CUSTOM SENSOR STATUSES]
## These settings allow devices which are not natively supported by this panel to be used. 
## This is to be used when the state of the device is not recognised by the panel. Examples are provided below 
custom_supported_statuses_on:
 - '22'
custom_supported_statuses_off:
 - '23'

And the alarm now triggers when I open the door - well at least in the panel, it was instant, my actual siren didn’t go off but that’s another matter.

Edit: I just had to heal the node, it’s been unplugged for a while… The siren does turn on when the door opens. Awesome!

1 Like

Ok, now that I have the basic functions working…
Is there a way to make the system execute an external script if the alarm is triggered?
I use a VoIP service that offers a Perl script to send texts… So I guess you see where this is going, I would like that script to be executed in order to get a text if the alarm is activated.

Edit: I still need to do some digging but this seems to be what I was looking for…

Yes, you call the script from the alarm triggered automation:

- id: alarm_triggered
  alias: '[Alarm] Triggered'
  trigger:
    platform: state
    entity_id: alarm_control_panel.house
    to: triggered
  action:

Then possibly a shell command to call your perl script.

1 Like

Thank you @tom_l. I edited my original post before seeing your answer, I think I am almost there :slight_smile:

1 Like

Problem solved!

In case anyone needs this, here is what I did:

  1. In configuration.yaml:
shell_command:
 sendsms: perl /home/homeassistant/.homeassistant/sendsms.pl --msg="alarm triggered!"
  1. In automations.yaml:
- id: alarm_triggered
  alias: '[Alarm] Triggered'
  trigger:
  - platform: state
    entity_id: alarm_control_panel.house
    to: 'triggered'
  action:
  - service: switch.turn_on
    entity_id: switch.switch
  - service: notify.pushbullet
    data:
      message: 'ALARM TRIGGERED!!! {{ states[states.alarm_control_panel.house.attributes.changed_by.split(".")[0]][ states.alarm_control_panel.house.attribut$
      target: email/*****@gmail.com'
  - service: shell_command.sendsms

Nice. If you want to make your shell command send any message passed to it rather than hard coding it, have a look at this for inspiration, Centralized handling for text to speech (TTS)

1 Like

I have a sensor in delayed section under armed_away. However when the alarm is armed and this is activated the alarm goes not Warning state, not pending. The sensor change from locked to unlocked.

Put the sensor in the Override group. Delayed gives you time before disarming but still triggers. Override is ignored during arming.

but I want it to trigger the pending timer

Pending time is the time between activating the alarm and it arming.I think you mean the delay time.

The sensor can be in both groups. If it is in the Override group it will be ignored during the pending time when arming. If it is in the delayed group it will trigger the alarm after an entry delay.

If you really meant you want the pending time to be activated by the sensor your will have to make an automation that arms the alarm when the sensor is triggered.

Hi @gazoscalvertos
you still around mate

1 Like

this is confusing the code says:

##[OPTIONAL] Sensors in this group start the clock (pending_time) when tripped before the alarm is triggered 
delayed:

so the sensor is in there, as I read it should start the countdown before the alarm is triggered, but it gives a warning.

I have this sensor that gives locked/unlocked status on my front door. This sensor needs to have the possibility to change after the alarm countdown has started without triggering alarm. However when the alarm is already armed this sensor must start the countdown before alarm is triggered.

Hi Folks,

I’ve updated the branch dev with the new UI to include user specific codes and have squashed a few bugs. I’ll respond to the some of the comments above over the course of the next couple of days. I’ve got more bugs to sort then will merge with the master branch.

https://github.com/gazoscalvertos/Hass-Custom-Alarm/tree/newUI

4 Likes