Help about install and configure AlarmSystem

I’m using Hassio, I’ve installed AppDaemon, how I can install it from Hassio?

What steps did you made until now?
Did you followed some step by step tutorial?

I’ve installed the AppDaemon add-on from Hassio… now I need a step by step tutorial to install AlarmSystem…

I just downloaded code from https://gist.github.com/runningman84/b96a331b3486dbd1f5f2d00bc85d99ed
I copied alarm.py in appdaemon/addon and apps.yaml in config and added code in my configuration.yaml

in the apps.yaml file I will define my sensors
device_trackers: … i listed my phones
armed_home_sensors: what I will list? the sensors acivated when I’m at home? (windows sensors e.g.?)
armed_away_sensors: what I will list? the camera sensors? the main door?
alarm_control_buttons: the switches to arm/not arm the alarm?

and the others? how I will define them?
vacation_control: input_boolean.vacation_mode
guest_control: input_boolean.guest_mode
silent_control: input_boolean.silent_mode
alarm_volume_control: input_number.xiaomi_alarm_volume
info_volume_control: input_number.xiaomi_info_volume

I need some suggestions… please

Ciao Andrea @andyinno Auguri di Buon Anno!!!

Ciao vpomax, buon anno anche a te :slight_smile:

in device_trackers you can list the devices that you want to track home / not home.
If you put devices there you can have the alarm auto activated when all the phones are away.

armed_home_sensors: I put there all the peripheral sensors. For example the Door / Window sensor from xiaomi

armed_away_sensors: I put there all the sensors from armed_home_sensors plus the PIR sensors I have at home

alarm_control_bttons are some switches. I am using one like this one:

https://www.gearbest.com/smart-light-bulb/pp_257679.html

It gives you single press, long press, double click.

Single click is mapped to alarm home
double click is mapped to disarm
long press is mapped to alarm away

I didn’t define any of the other. but you can if you need them.
From the comment in the first thread I linked to you vacation_control is not active. It is just a placeholder so you can ignore it.

Hi @andyinno ok… I wrote so…in apps.yaml

alarm_system:
  module: alarm
  class: AlarmSystem
  device_trackers:
    - device_tracker.samsng_s8_wifi
    - device_tracker.samsung_s8_bt
  armed_home_sensors:
    - binary_sensor.door_window_sensor_aaaaaaaa
    - binary_sensor.door_window_sensor_bbbbbbbb
    - binary_sensor.door_window_sensor_ccccccccc
    - binary_sensor.door_window_sensor_dddddddd
    - binary_sensor.door_window_sensor_eeeeeeee
    - binary_sensor.door_window_sensor_fffffffffff
  armed_away_sensors:
    - binary_sensor.motion_sensor_ggggggggg
    - binary_sensor.motion_sensor_hhhhhhhhh
    - binary_sensor.motion_sensor_iiiiiiiiiiiii
    - binary_sensor.motion_sensor_jjjjjjjjjjjj
  alarm_control_buttons:
    - binary_sensor.switch_xxxxxxxxxx
  alarm_lights:
    - light.gateway_light_yyyyyyyyyyy
  alarm_pin: !secrets alarm_pin
  vacation_control: input_boolean.vacation_mode
  guest_control: input_boolean.guest_mode
  silent_control: input_boolean.silent_mode
  alarm_volume_control: input_number.xiaomi_alarm_volume
  info_volume_control: input_number.xiaomi_info_volume
  xiaomi_aqara_gw_mac: zzzzzzzzzzzzz
 notify_service: script/send_status_report_bob
 notify_title: "Intruder Alert"

Is it all right?

the row
notify_service: script/send_status_report_bob

call a script? which script?

looks almost good to me.
I placed the door/window sensors also in armed_away_sensors with the motion sensor.
They are duplicated.

Differences from my setup:

device_trackers:
  - group.person_A
  - group.person_B
  - group.person_C

remember the group setting I told you in the other thread?

as notify_service I set up smtp that sends an email when it detects movement / door - windows open.
notify_service: notify/gmail

For sending email from home assistant I had to add a body to the email otherwise it is not sent.
I just edited the code from the title adding the same text for the body.

What kind of notification service do you plan to use?

I didn’t use volume_control and other settings. the default values in the python script worked for me.

may I delete these rows?
vacation_control: input_boolean.vacation_mode
guest_control: input_boolean.guest_mode
silent_control: input_boolean.silent_mode
alarm_volume_control: input_number.xiaomi_alarm_volume
info_volume_control: input_number.xiaomi_info_volume

I wish to use gmail too for notificatons

I inserted these lines in confguration.yaml

notify:
  - name: HASSIO
    platform: smtp
    server: smtp.gmail.com
    port: 587
    timeout: 15
    sender: [email protected]
    encryption: starttls
    username: [email protected]
    password: xxxxxxxxxxxx
    recipient:
      - [email protected]
      - [email protected]
    sender_name: My Home Assistant

and then what I write in apps.yaml? instead of
notify_service: script/send_status_report_bob

notify_service: notify.HASSIO

I would suggest you to create a simple script and call the notify_service there. Right now the AlarmSystem just calls any “service” but it does not send custom arguments like email subject, email content and so on.

Any suggestion to create a script?
Can you report me a script example to use with gmail SMPT?

yes this is my current script:

Thanks… you script.yaml file is too complicated for me and have many calls.
At the moment I wish to begin with a more simple script that send me a message when system is armed, when system is disarmed and when system detect and intruder and s in alert.

you can strip it down to to this minimal example:

Thank you @runningman84bt your script is too coplicated for me.
I’m a newbie, for a first step I wish a script that send me a message when Systemalarm is armed, is disarmed, and when it detect an intrusion (alarmed)

my apps.yaml contain…

  notify_service: notify.hassio
  notify_title: "Intruder Alert"

then in my confguration.yaml I have…

notify:
  - name: hassio
    platform: smtp
    server: smtp.gmail.com
    port: 587
    timeout: 15
    sender: [email protected]
    starttls: 1
    username: [email protected]
    password: !secret email_password
    recipient: [email protected]
    sender_name: My Home Assistant

and in automation:

  - alias: Notifica SystemAlarm
    trigger:
      platform: state
      entity_id: alarm_control_panel.ha_alarm
      to: 'triggered'
    action:
      service: notify.hassio
      data:
        title: SystemAlarm
        message: 'Allarme Home attivato'
        target: 'aaaaabbbbb@gmailcom'

Now this works fine… but I receive the mail about 10/20 seconds after it happens

My scripts.yaml do not works, it do not send any message… WHAT IS WRONG?

my apps.yaml contain…

  notify_service: script/send_status_report
  notify_title: "Intruder Alert"

then in my confguration.yaml I have…

notify:
  - name: hassio
    platform: smtp
    server: smtp.gmail.com
    port: 587
    timeout: 15
    sender: [email protected]
    starttls: 1
    username:[email protected]
    password: !secret email_password
    recipient: [email protected]
    sender_name: My Home Assistant

in scripts.yaml

send_status_report:
  alias: "Send status report"
  sequence:
    - service: notify.hassio
      data_template:
        title: "AlertSystem triggered"
        message: {{  states('alarm_control_panel.ha_alarm') }}

Does it work now?

I moved the app from gist to a normal github repo: